I am attempting to extract a public key from a private key using ED25519 with Go.
I pass my private key byte value into my method, create a new ed25519 private key struct from it, and then use the .Public()
method to retrieve the public key.
pk := ed25519.PrivateKey(privateKey).Public()
cpk, ok := pk.(ed25519.PublicKey)
if !ok {
return nil, errors.New("problem casting public key to ed25519 public key")
}
It's not erroring but the resulting public key byte is always empty, is there something I'm doing incorrectly when creating the private key struct?