Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PKCS1 certificate format PKCS1 = iota // PKCS8 certificate format PKCS8 )
View Source
const ( // CACert indicates that the certificate should be a certificate authority. CACert string = "ca" // ServerCert indicates that the certificate should have the ExtKeyUsageServerAuth usage. ServerCert string = "server" // ClientCert indicates that the certificate should have the ExtKeyUsageClientAuth usage. ClientCert string = "client" // ServerClientCert indicates that the certificate should have both the ExtKeyUsageServerAuth and ExtKeyUsageClientAuth usage. ServerClientCert string = "both" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertConfig ¶
type CertConfig struct { Name string CommonName string Organization []string DNSNames []string IPAddresses []net.IP CertType string Validity *time.Duration SigningCA *Certificate PKCS int }
CertConfig contains configurations depending on which a certificate can be generated.
func (*CertConfig) GenerateCertificate ¶
func (s *CertConfig) GenerateCertificate() (*Certificate, error)
GenerateCertificate generates a certificate depending on the provided certificate configuration.
type Certificate ¶
type Certificate struct { Name string CA *Certificate PrivateKey *rsa.PrivateKey PrivateKeyPEM []byte Certificate *x509.Certificate CertificatePEM []byte }
Certificate contains a x509.Certificate.
Click to show internal directories.
Click to hide internal directories.