Documentation ¶
Index ¶
- type CertManager
- func (cm *CertManager) GetAnnouncementsChannel() <-chan interface{}
- func (cm *CertManager) GetCertificate(cn certificate.CommonName) (certificate.Certificater, error)
- func (cm *CertManager) GetRootCertificate() (certificate.Certificater, error)
- func (cm *CertManager) IssueCertificate(cn certificate.CommonName, validityPeriod *time.Duration) (certificate.Certificater, error)
- func (cm *CertManager) ListCertificates() ([]certificate.Certificater, error)
- func (cm *CertManager) ListIssuedCertificates() []certificate.Certificater
- func (cm *CertManager) RotateCertificate(cn certificate.CommonName) (certificate.Certificater, error)
- type Certificate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertManager ¶
type CertManager struct {
// contains filtered or unexported fields
}
CertManager implements certificate.Manager and contains a Hashi Vault client instance.
func NewCertManager ¶
func NewCertManager(vaultAddr, token string, validityPeriod time.Duration, vaultRole string) (*CertManager, error)
NewCertManager implements certificate.Manager and wraps a Hashi Vault with methods to allow easy certificate issuance.
func (*CertManager) GetAnnouncementsChannel ¶
func (cm *CertManager) GetAnnouncementsChannel() <-chan interface{}
GetAnnouncementsChannel returns a channel used by the Hashi Vault instance to signal when a certificate has been changed.
func (*CertManager) GetCertificate ¶
func (cm *CertManager) GetCertificate(cn certificate.CommonName) (certificate.Certificater, error)
GetCertificate returns a certificate given its Common Name (CN)
func (*CertManager) GetRootCertificate ¶
func (cm *CertManager) GetRootCertificate() (certificate.Certificater, error)
GetRootCertificate returns the root certificate.
func (*CertManager) IssueCertificate ¶
func (cm *CertManager) IssueCertificate(cn certificate.CommonName, validityPeriod *time.Duration) (certificate.Certificater, error)
IssueCertificate issues a certificate by leveraging the Hashi Vault CertManager.
func (*CertManager) ListCertificates ¶ added in v0.1.0
func (cm *CertManager) ListCertificates() ([]certificate.Certificater, error)
ListCertificates lists all certificates issued
func (*CertManager) ListIssuedCertificates ¶
func (cm *CertManager) ListIssuedCertificates() []certificate.Certificater
ListIssuedCertificates implements CertificateDebugger interface and returns the list of issued certificates.
func (*CertManager) RotateCertificate ¶
func (cm *CertManager) RotateCertificate(cn certificate.CommonName) (certificate.Certificater, error)
RotateCertificate implements certificate.Manager and rotates an existing certificate.
type Certificate ¶
type Certificate struct {
// contains filtered or unexported fields
}
Certificate implements certificate.Certificater
func (Certificate) GetCertificateChain ¶
func (c Certificate) GetCertificateChain() []byte
GetCertificateChain returns the PEM encoded certificate.
func (Certificate) GetCommonName ¶
func (c Certificate) GetCommonName() certificate.CommonName
GetCommonName returns the common name of the given certificate.
func (Certificate) GetExpiration ¶
func (c Certificate) GetExpiration() time.Time
GetExpiration implements certificate.Certificater and returns the time the given certificate expires.
func (Certificate) GetIssuingCA ¶
func (c Certificate) GetIssuingCA() []byte
GetIssuingCA returns the root certificate signing the given cert.
func (Certificate) GetPrivateKey ¶
func (c Certificate) GetPrivateKey() []byte
GetPrivateKey returns the PEM encoded private key of the given certificate.