ParseECPrivateKey parse the ECDSA private key stored in the pair
()
| 87 | |
| 88 | // ParseECPrivateKey parse the ECDSA private key stored in the pair |
| 89 | func (pair KeyPair) ParseECPrivateKey() (*ecdsa.PrivateKey, error) { |
| 90 | block, _ := pem.Decode(pair.Private) |
| 91 | if block == nil || block.Type != ecPrivateKeyPEMBlockType { |
| 92 | return nil, fmt.Errorf("invalid private key PEM block type") |
| 93 | } |
| 94 | |
| 95 | return x509.ParseECPrivateKey(block.Bytes) |
| 96 | } |
| 97 | |
| 98 | // ParseCertificate parse certificate stored in the pair |
| 99 | func (pair KeyPair) ParseCertificate() (*x509.Certificate, error) { |
no outgoing calls
no test coverage detected