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

Function CreateRootCA

pkg/certs/certs.go:377–382  ·  view source on GitHub ↗

CreateRootCA generates a CA returning its keys

(commonName string, organizationalUnit string)

Source from the content-addressed store, hash-verified

375
376// CreateRootCA generates a CA returning its keys
377func CreateRootCA(commonName string, organizationalUnit string) (*KeyPair, error) {
378 certificateDuration := getCertificateDuration()
379 notBefore := time.Now().Add(time.Minute * -5)
380 notAfter := notBefore.Add(certificateDuration)
381 return createCAWithValidity(notBefore, notAfter, nil, nil, commonName, organizationalUnit)
382}
383
384// ParseCASecret parse a CA secret to a key pair
385func ParseCASecret(secret *corev1.Secret) (*KeyPair, error) {

Callers 11

reconciler_test.goFile · 0.92
generateFakeCASecretFunction · 0.92
ensureCASecretMethod · 0.92
CreateSecretCAFunction · 0.92
DeployFunction · 0.92
certs_test.goFile · 0.85
k8s_test.goFile · 0.85

Calls 2

getCertificateDurationFunction · 0.85
createCAWithValidityFunction · 0.85

Tested by 1

generateFakeCASecretFunction · 0.74