Documentation ¶
Overview ¶
Package selfsignedcert helps to create self-signed certificates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cert ¶
type Cert struct { // CertPEM is the certificate encoded using PEM. CertPEM []byte // KeyPEM is the secret key encoded using PEM. KeyPEM []byte }
Cert is the self-signed certificate.
func New ¶
New generates a self-signed certificate and key with SANs.
This function panics on failure.
func (*Cert) WriteFiles ¶
WriteFiles writes CertPEM to `cert.pem` and KeyPEM to `key.pem`.
This method panics on failure.
type Config ¶
type Config struct { // CommonName is the certificate common name. CommonName string // DNSNames contains the alternative DNS names to include in the certificate. DNSNames []string // IPAddrs contains the IP addrs for which the certificate is valid. IPAddrs []net.IP }
Config contains configuration for New.
func NewConfigExampleCom ¶
func NewConfigExampleCom() *Config
NewConfigExampleCom creates a *Config for example.com using the www.example.com, 127.0.0.1, and ::1 sans.
Click to show internal directories.
Click to hide internal directories.