fix(crypto): marshal the keys in the right format
This commit is contained in:
parent
9db64e53e1
commit
582fc381ca
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue