Set up -> Stream is Working
This commit is contained in:
@@ -49,14 +49,11 @@ func Verify(pub crypto.PubKey, data, sig []byte) (bool, error) {
|
||||
|
||||
func LoadKeyFromFilePrivate() (crypto.PrivKey, error) {
|
||||
path := conf.GetConfig().PrivateKeyPath
|
||||
fmt.Println("extract " + path)
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println(data)
|
||||
block, _ := pem.Decode(data)
|
||||
fmt.Println(block.Bytes)
|
||||
keyAny, err := x509.ParsePKCS8PrivateKey(block.Bytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -71,7 +68,6 @@ func LoadKeyFromFilePrivate() (crypto.PrivKey, error) {
|
||||
|
||||
func LoadKeyFromFilePublic() (crypto.PubKey, error) {
|
||||
path := conf.GetConfig().PublicKeyPath
|
||||
fmt.Println("extract " + path)
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -100,7 +96,6 @@ func LoadPSKFromFile() (pnet.PSK, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println("PSK found.")
|
||||
return psk, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user