Fix styles.

This commit is contained in:
Naoki Kosaka
2018-12-09 20:40:17 +09:00
parent edafcf140f
commit 6ce65295bb
15 changed files with 233 additions and 220 deletions

View File

@ -34,13 +34,13 @@ func ReadPublicKeyRSAfromString(pemString string) (*rsa.PublicKey, error) {
return pub, nil
}
func GeneratePublicKeyPEMString(pub *rsa.PublicKey) string {
pubkeyBytes := x509.MarshalPKCS1PublicKey(pub)
pubkeyPem := pem.EncodeToMemory(
func GeneratePublicKeyPEMString(publicKey *rsa.PublicKey) string {
publicKeyByte := x509.MarshalPKCS1PublicKey(publicKey)
publicKeyPem := pem.EncodeToMemory(
&pem.Block{
Type: "RSA PUBLIC KEY",
Bytes: pubkeyBytes,
Bytes: publicKeyByte,
},
)
return string(pubkeyPem)
return string(publicKeyPem)
}