Versions in this module Expand all Collapse all v1 v1.24.10 Oct 24, 2017 v1.24.9 Oct 24, 2017 Changes in this version + const CertificateBlockType + const CertificateRequestBlockType + const ECPrivateKeyBlockType + const PrivateKeyBlockType + const PublicKeyBlockType + const RSAPrivateKeyBlockType + 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 FormatBytesCert(cert []byte) (string, error) + func FormatCert(c *x509.Certificate) string + func GenerateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS []string) ([]byte, []byte, error) + func LoadOrGenerateKeyFile(keyPath string) (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 NewPool(filename string) (*x509.CertPool, error) + func NewPrivateKey() (*rsa.PrivateKey, error) + func NewSelfSignedCACert(cfg Config, key *rsa.PrivateKey) (*x509.Certificate, error) + func NewSignedCert(cfg Config, key *rsa.PrivateKey, caCert *x509.Certificate, ...) (*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 + Organization []string + Usages []x509.ExtKeyUsage