Versions in this module Expand all Collapse all v0 v0.3.4 Jul 13, 2022 Changes in this version + const CertificateBlockType + const CertificateRequestBlockType + const ECPrivateKeyBlockType + const PrivateKeyBlockType + const PublicKeyBlockType + const RSAPrivateKeyBlockType + var ErrStaticCert = errors.New("cannot renew static certificate") + func CanReadCertAndKey(certPath, keyPath string) (bool, error) + func CertsFromFile(file string) ([]*x509.Certificate, error) + func EncodeCertPEM(cert *x509.Certificate) []byte + func EncodePrivateKeyPEM(key *rsa.PrivateKey) []byte + func EncodePublicKeyPEM(key *rsa.PublicKey) ([]byte, error) + func GenerateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS []string) ([]byte, []byte, error) + func GenerateSelfSignedCertKeyWithFixtures(host string, alternateIPs []net.IP, alternateDNS []string, ...) ([]byte, []byte, error) + func IsCertExpired(cert *x509.Certificate, days int) bool + func IsValidTLSSecret(secret *v1.Secret) bool + func LoadOrGenerateKeyFile(keyPath string, force bool) (data []byte, wasGenerated bool, err error) + func MakeCSR(privateKey interface{}, subject *pkix.Name, dnsSANs []string, ipSANs []net.IP) (csr []byte, err error) + func MakeCSRFromTemplate(privateKey interface{}, template *x509.CertificateRequest) ([]byte, error) + func MakeEllipticPrivateKeyPEM() ([]byte, error) + func MarshalPrivateKeyToPEM(privateKey crypto.PrivateKey) ([]byte, error) + func NewPool(filename string) (*x509.CertPool, error) + func NewPrivateKey() (*rsa.PrivateKey, error) + func NewSelfSignedCACert(cfg Config, key crypto.Signer) (*x509.Certificate, error) + func NewSignedCert(cfg Config, key crypto.Signer, caCert *x509.Certificate, caKey crypto.Signer) (*x509.Certificate, error) + func ParseCertsPEM(pemCerts []byte) ([]*x509.Certificate, error) + func ParsePrivateKeyPEM(keyData []byte) (interface{}, error) + func ParsePublicKeysPEM(keyData []byte) ([]interface{}, error) + func PrivateKeyFromFile(file string) (interface{}, error) + func PublicKeysFromFile(file string) ([]interface{}, error) + func WriteCert(certPath string, data []byte) error + func WriteKey(keyPath string, data []byte) error + type AltNames struct + DNSNames []string + IPs []net.IP + type Config struct + AltNames AltNames + CommonName string + ExpiresAt time.Duration + Organization []string + Usages []x509.ExtKeyUsage