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

Method CreateAndSignPair

pkg/certs/certs.go:148–153  ·  view source on GitHub ↗

CreateAndSignPair given a CA keypair, generate and sign a leaf keypair

(host string, usage CertType, altDNSNames []string)

Source from the content-addressed store, hash-verified

146
147// CreateAndSignPair given a CA keypair, generate and sign a leaf keypair
148func (pair KeyPair) CreateAndSignPair(host string, usage CertType, altDNSNames []string) (*KeyPair, error) {
149 certificateDuration := getCertificateDuration()
150 notBefore := time.Now().Add(time.Minute * -5)
151 notAfter := notBefore.Add(certificateDuration)
152 return pair.createAndSignPairWithValidity(host, notBefore, notAfter, usage, altDNSNames)
153}
154
155func (pair KeyPair) createAndSignPairWithValidity(
156 host string,

Callers 14

reconciler_test.goFile · 0.80
ensureCertificateMethod · 0.80
certs_test.goFile · 0.80
k8s_test.goFile · 0.80
GenerateFunction · 0.80
DeployFunction · 0.80

Calls 2

getCertificateDurationFunction · 0.85