Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServerCertPool ¶
ServerCertPool returns a pool containing all root CA certificates that are trusted for issuing server certificates.
func UpdateDefaultTransport ¶
func UpdateDefaultTransport() error
UpdateDefaultTransport updates the configuration for http.DefaultTransport to use the root CA certificates defined here when used as an HTTP client.
It will return an error if the DefaultTransport is not actually an *http.Transport.
Types ¶
type Cert ¶
type Cert struct { Label string Serial string Trust TrustLevel DER []byte }
A Cert defines a single unparsed certificate.
func Certs ¶
func Certs() []Cert
Certs returns all trusted certificates extracted from certdata.txt.
func CertsByTrust ¶
func CertsByTrust(t TrustLevel) (result []Cert)
CertsByTrust returns only those certificates that match all bits of the specified TrustLevel.
func (*Cert) X509Cert ¶
func (c *Cert) X509Cert() *x509.Certificate
X509Cert parses the certificate into a *x509.Certificate.
type TrustLevel ¶
type TrustLevel int
TrustLevel defines for which purposes the certificate is trusted to issue certificates (ie. to act as a CA)
const ( ServerTrustedDelegator TrustLevel = 1 << iota // Trusted for issuing server certificates EmailTrustedDelegator // Trusted for issuing email certificates CodeTrustedDelegator // Trusted for issuing code signing certificates )