Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultCertificate ¶
NewDefaultCertificate creates a self-signed certificate and key and saves them to temporary files whose names are returned, using default values.
Key for certificate: "cert" Key for private key: "key"
Types ¶
type SelfSignedCert ¶
SelfSignedCert is a key/cert pair created by an instance of SelfSignedCertGenerator
func (*SelfSignedCert) SaveTempFiles ¶
func (s *SelfSignedCert) SaveTempFiles() (string, string, error)
SaveTempFiles writes the key and certificate to temporary files Left to caller to clear away the files after use
func (*SelfSignedCert) String ¶
func (s *SelfSignedCert) String() string
String returns the cert only
type SelfSignedCertGenerator ¶
type SelfSignedCertGenerator struct { Bits int // The length of the private key - defaults to 4096 CertEncoder Encoder // The encoder for Certificate - defaults to PEM KeyEncoder Encoder // The encoder for Key - defaults to PEM }
SelfSignedCertGenerator provides flexibility in certificate generation
func (*SelfSignedCertGenerator) Create ¶
func (s *SelfSignedCertGenerator) Create(commonName string, ttl time.Duration) (*SelfSignedCert, error)
Create generates a SelfSignedCert for the common name and lifetime
Click to show internal directories.
Click to hide internal directories.