Documentation
¶
Index ¶
- func NewCertificateAuthority(config *CertConfig) (*x509.Certificate, crypto.Signer, error)
- func NewPrivateKey() (crypto.Signer, error)
- func NewSelfSignedCACert(key crypto.Signer, config *CertConfig) (*x509.Certificate, error)
- func WriteCert(path string, cert *x509.Certificate) error
- func WriteKey(path string, key crypto.Signer) error
- type CertConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCertificateAuthority ¶
func NewCertificateAuthority(config *CertConfig) (*x509.Certificate, crypto.Signer, error)
NewCertificateAuthority creates new certificate and private key for the certificate authority
func NewPrivateKey ¶
NewPrivateKey creates an RSA private key
func NewSelfSignedCACert ¶
func NewSelfSignedCACert(key crypto.Signer, config *CertConfig) (*x509.Certificate, error)
NewSelfSignedCACert creates a CA certificate
Types ¶
type CertConfig ¶
type CertConfig struct { // CommonName is the subject name of the certificate CommonName string // ExpireDuration is the duration the certificate can be valid ExpireDuration time.Duration }
CertConfig contains the basic fields required for creating a certificate
Click to show internal directories.
Click to hide internal directories.