Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct { UpgradeAttemptAfter time.Duration CertificateSubject pkix.Name CertificateValidity time.Duration LogDowngrade func(isDowngrade bool, hash string) // will be called on downgrade/upgrades // contains filtered or unexported fields }
func NewGenerator ¶
func NewGenerator(key *rsa.PrivateKey, organisationName string) *Generator
NewGenerator generates certificates valid for 2 years (starting January 1st). By default it serves the most recent certificate, but it can be temporarly "Downgraded" to provide the certificate from previous year (which is still valid thanks to the 2-year).
func (*Generator) Downgrade ¶
Downgrade will serve the previous certificate if not downgraded yet (and return true). Calling it again will cancel the downgrade and return false.
func (*Generator) IsDowngraded ¶
Click to show internal directories.
Click to hide internal directories.