diff --git a/pkg/crypto/key.go b/pkg/crypto/key.go index 2d2f360..ce2a8f1 100644 --- a/pkg/crypto/key.go +++ b/pkg/crypto/key.go @@ -27,5 +27,10 @@ func GenerateKeyPair(bytes int) (string, string, error) { privateKeyPEM := pem.EncodeToMemory(&privBlock) - return string(privateKeyPEM), string(base64.StdEncoding.EncodeToString(x509.MarshalPKCS1PublicKey(&privateKey.PublicKey))), nil + pubBytes, err := x509.MarshalPKIXPublicKey(&privateKey.PublicKey) + if err != nil { + return "", "", err + } + + return string(privateKeyPEM), string(base64.StdEncoding.EncodeToString(pubBytes)), nil }