Versions in this module Expand all Collapse all v2 v2.3.2 Dec 21, 2022 Changes in this version + const CertificateBlockType + const CertificateValidity + var NewPrivateKey = GeneratePrivateKey + func CertOrKeyExist(pkiPath, name string) bool + func CheckCertificatePeriodValidity(baseName string, cert *x509.Certificate) + func CreateCACertAndKeyFiles(certSpec *KubekeyCert, pkiPath string, kubeConf *common.KubeConf) error + func CreateCertAndKeyFilesWithCA(caCertSpec *KubekeyCert, certSpec *KubekeyCert, pkiPath string, ...) error + func EncodeCertPEM(cert *x509.Certificate) []byte + func GenerateCA(ca *KubekeyCert, pkiPath string, kubeConf *common.KubeConf) error + func GenerateCerts(cert *KubekeyCert, caCert *KubekeyCert, pkiPath string, ...) error + func GeneratePrivateKey(keyType x509.PublicKeyAlgorithm) (crypto.Signer, error) + func HasServerAuth(cert *x509.Certificate) bool + func LoadCertificateAuthority(pkiDir string, baseName string) (*x509.Certificate, crypto.Signer, error) + func NewCertAndKey(caCert *x509.Certificate, caKey crypto.Signer, config *CertConfig) (*x509.Certificate, crypto.Signer, error) + func NewCertificateAuthority(config *CertConfig) (*x509.Certificate, crypto.Signer, error) + func NewSignedCert(cfg *CertConfig, key crypto.Signer, caCert *x509.Certificate, ...) (*x509.Certificate, error) + func PathsForCertAndKey(pkiPath, name string) (string, string) + func RemoveDuplicateAltNames(altNames *certutil.AltNames) + func TryLoadCertAndKeyFromDisk(pkiPath, name string) (*x509.Certificate, crypto.Signer, error) + func TryLoadCertChainFromDisk(pkiPath, name string) (*x509.Certificate, []*x509.Certificate, error) + func TryLoadCertFromDisk(pkiPath, name string) (*x509.Certificate, error) + func TryLoadKeyFromDisk(pkiPath, name string) (crypto.Signer, error) + func ValidateCertPeriod(cert *x509.Certificate, offset time.Duration) error + func VerifyCertChain(cert *x509.Certificate, intermediates []*x509.Certificate, ...) error + func WriteCert(pkiPath, name string, cert *x509.Certificate) error + func WriteCertAndKey(pkiPath string, name string, cert *x509.Certificate, key crypto.Signer) error + func WriteKey(pkiPath, name string, key crypto.Signer) error + type CertConfig struct + NotAfter *time.Time + PublicKeyAlgorithm x509.PublicKeyAlgorithm + type KubekeyCert struct + BaseName string + CAName string + Config CertConfig + LongName string + Name string + func (k *KubekeyCert) CreateFromCA(kubeConf *common.KubeConf, pkiPath string, caCert *x509.Certificate, ...) error + func (k *KubekeyCert) GetConfig(_ *common.KubeConf) (*CertConfig, error)