Documentation ¶
Index ¶
- func EncodeCertPEM(cert *x509.Certificate) []byte
- func EncodePrivateKeyPEM(key crypto.PrivateKey) ([]byte, error)
- func EncodePublicKeyPEM(key crypto.PublicKey) ([]byte, 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 NewSelfSignedCACert(cfg CertConfig, key crypto.Signer) (*x509.Certificate, error)
- func NewSignedCert(cfg *CertConfig, key crypto.Signer, caCert *x509.Certificate, ...) (*x509.Certificate, error)
- func RemoveDuplicateAltNames(altNames *certutil.AltNames)
- type CertConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeCertPEM ¶
func EncodeCertPEM(cert *x509.Certificate) []byte
EncodeCertPEM returns PEM-endcoded certificate data
func EncodePrivateKeyPEM ¶
func EncodePrivateKeyPEM(key crypto.PrivateKey) ([]byte, error)
EncodePrivateKeyPEM returns PEM-encoded private data
func EncodePublicKeyPEM ¶
EncodePublicKeyPEM returns PEM-encoded public data
func NewCertAndKey ¶
func NewCertAndKey(caCert *x509.Certificate, caKey crypto.Signer, config *CertConfig) (*x509.Certificate, crypto.Signer, error)
NewCertAndKey creates new certificate and key by passing the certificate authority certificate and key
func NewCertificateAuthority ¶
func NewCertificateAuthority(config *CertConfig) (*x509.Certificate, crypto.Signer, error)
NewCertificateAuthority creates new certificate and private key for the certificate authority
func NewSelfSignedCACert ¶
func NewSelfSignedCACert(cfg CertConfig, key crypto.Signer) (*x509.Certificate, error)
NewSelfSignedCACert creates a CA certificate
func NewSignedCert ¶
func NewSignedCert(cfg *CertConfig, key crypto.Signer, caCert *x509.Certificate, caKey crypto.Signer) (*x509.Certificate, error)
NewSignedCert creates a signed certificate using the given CA certificate and key
func RemoveDuplicateAltNames ¶
RemoveDuplicateAltNames removes duplicate items in altNames.
Types ¶
type CertConfig ¶
type CertConfig struct { certutil.Config NotAfterTime time.Duration PublicKeyAlgorithm x509.PublicKeyAlgorithm }
CertConfig is a wrapper around certutil.Config extending it with PublicKeyAlgorithm.
Click to show internal directories.
Click to hide internal directories.