(privateKey *rsa.PrivateKey)
| 84 | } |
| 85 | |
| 86 | func rsaEncodePrivateKey(privateKey *rsa.PrivateKey) []byte { |
| 87 | privateKeyBytes := x509.MarshalPKCS1PrivateKey(privateKey) |
| 88 | privateBlock := &pem.Block{ |
| 89 | Type: "RSA PRIVATE KEY", |
| 90 | Headers: nil, |
| 91 | Bytes: privateKeyBytes, |
| 92 | } |
| 93 | return pem.EncodeToMemory(privateBlock) |
| 94 | } |
| 95 | |
| 96 | func rsaDecodePrivateKey(bytes []byte) (*rsa.PrivateKey, error) { |
| 97 | block, _ := pem.Decode(bytes) |
no outgoing calls
no test coverage detected