nws/protocol/nip44.go
asmogo a77add0859
replaced nip04 with nip44 (#43)
* replaced nip04 with nip44

* Refactor key decoding logic to use common function

* Refactor key decoding logic to use common function

* fix nostr connection read test
2024-11-08 14:21:43 +01:00

18 lines
383 B
Go

package protocol
import (
"encoding/hex"
)
func GetEncryptionKeys(privateKey, publicKey string) ([]byte, []byte, error) {
targetPublicKeyBytes, err := hex.DecodeString("02" + publicKey)
if err != nil {
return nil, nil, err
}
privateKeyBytes, err := hex.DecodeString(privateKey)
if err != nil {
return nil, nil, err
}
return privateKeyBytes, targetPublicKeyBytes, nil
}