Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Certificate ¶
type Certificate struct { Domains []string `json:"domains"` CertUrl *string `json:"certUrl"` CertStableUrl *string `json:"certStableUrl"` CreatedAt time.Time `json:"createdAt"` NotAfter time.Time `json:"notAfter"` Pem []byte `json:"pem"` KeyCreatedAt time.Time `json:"privateKeyCreatedAt"` Key *privatekey.PrivateKey `json:"privateKey"` }
func New ¶
func New(domains []string) *Certificate
func (*Certificate) Add ¶
func (c *Certificate) Add(data [][]byte) error
func (*Certificate) Request ¶
func (c *Certificate) Request() ([]byte, error)
certRequest generates a CSR for the given common name cn and optional SANs. see: https://github.com/golang/crypto/blob/5c72a883971a4325f8c62bf07b6d38c20ea47a6a/acme/autocert/autocert.go#L1137
func (*Certificate) ValidCert ¶
func (c *Certificate) ValidCert(der [][]byte, now time.Time) (leaf *x509.Certificate, err error)
validCert parses a cert chain provided as der argument and verifies the leaf and der[0] correspond to the private key, the domain and key type match, and expiration dates are valid. It doesn't do any revocation checking.
The returned value is the verified leaf cert. see: https://github.com/golang/crypto/blob/5c72a883971a4325f8c62bf07b6d38c20ea47a6a/acme/autocert/autocert.go#L1177
Click to show internal directories.
Click to hide internal directories.