fix(crypto): marshal the keys in the right format

This commit is contained in:
Thomas Maurice 2024-02-12 17:30:13 +01:00
parent 9db64e53e1
commit 582fc381ca
Signed by: thomas
GPG key ID: 1D577F50583032A6

View file

@ -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
}