MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / ParseECPrivateKey

Method ParseECPrivateKey

pkg/certs/certs.go:89–96  ·  view source on GitHub ↗

ParseECPrivateKey parse the ECDSA private key stored in the pair

()

Source from the content-addressed store, hash-verified

87
88// ParseECPrivateKey parse the ECDSA private key stored in the pair
89func (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
99func (pair KeyPair) ParseCertificate() (*x509.Certificate, error) {

Callers 7

RenewCertificateMethod · 0.95
CreateDerivedCAMethod · 0.95
RenewLeafCertificateFunction · 0.80
renewCACertificateFunction · 0.80
certs_test.goFile · 0.80
renewCASecretMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected