Documentation ¶
Index ¶
Constants ¶
const ( // CertificateBlockType is a possible value for pem.Block.Type. CertificateBlockType = "CERTIFICATE" // RSAPrivateKeyBlockType is a possible value for pem.Block.Type. RSAPrivateKeyBlockType = "RSA PRIVATE KEY" )
Variables ¶
var CertDuration = 2 * 365 * 24 * time.Hour
CertDuration controls how long we issue certificates for. We set it to a longer time period, primarily because we don't have a nice means of rotation. This was historically one year, but we now set it to two years, with kubernetes LTS proposing one year's support.
var CertMinTimeLeft = 20 * 365 * 24 * time.Hour
CertMinTimeLeft is the minimum amount of validity required on a certificate to reuse it. Because we set this (much) higher than CertDuration, we will now always reissue certificates.
Functions ¶
func ParseHumanDuration ¶
ParseHumanDuration parses a go-style duration string, but recognizes additional suffixes: d means "day" and is interpreted as 24 hours; y means "year" and is interpreted as 365 days.
func ParseOneCertificate ¶
func ParseOneCertificate(b []byte) (*x509.Certificate, error)
Types ¶
type FSStore ¶
type FSStore struct {
// contains filtered or unexported fields
}
func NewFSStore ¶
func (*FSStore) Keypair ¶
func (s *FSStore) Keypair(name string) MutableKeypair
func (*FSStore) WriteCABundle ¶
type InMemoryMutableKeypair ¶
type InMemoryMutableKeypair struct {
Keypair *Keypair
}
func (*InMemoryMutableKeypair) MutateKeypair ¶
func (s *InMemoryMutableKeypair) MutateKeypair(mutator func(keypair *Keypair) error) (*Keypair, error)
type InMemoryStore ¶
type InMemoryStore struct {
// contains filtered or unexported fields
}
func NewInMemoryStore ¶
func NewInMemoryStore() *InMemoryStore
func (*InMemoryStore) Keypair ¶
func (s *InMemoryStore) Keypair(name string) MutableKeypair
type Keypair ¶
type Keypair struct { Certificate *x509.Certificate PrivateKey *rsa.PrivateKey }
type Keypairs ¶
type Keypairs struct {
// contains filtered or unexported fields
}
Keypairs manages a set of keypairs, providing utilities for fetching / creating them
func NewKeypairs ¶
type MutableKeypair ¶
type MutableKeypairFromFile ¶
func (*MutableKeypairFromFile) MutateKeypair ¶
func (s *MutableKeypairFromFile) MutateKeypair(mutator func(keypair *Keypair) error) (*Keypair, error)
type Store ¶
type Store interface {
Keypair(name string) MutableKeypair
}