CreateRootCA generates a CA returning its keys
(commonName string, organizationalUnit string)
| 375 | |
| 376 | // CreateRootCA generates a CA returning its keys |
| 377 | func 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 |
| 385 | func ParseCASecret(secret *corev1.Secret) (*KeyPair, error) { |