certmanager

package
v0.10.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package certmanager implements the certificate.Manager interface for cert-manager.io as the certificate provider.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRootCertificateFromPEM

func NewRootCertificateFromPEM(pemCert pem.Certificate) (certificate.Certificater, error)

NewRootCertificateFromPEM is a helper returning a certificate.Certificater from the PEM components given.

Types

type CertManager

type CertManager struct {
	// contains filtered or unexported fields
}

CertManager implements certificate.Manager

func NewCertManager

func NewCertManager(
	ca certificate.Certificater,
	client cmversionedclient.Interface,
	namespace string,
	issuerRef cmmeta.ObjectReference,
	cfg configurator.Configurator,
	serviceCertValidityDuration time.Duration,
	keySize int,
) (*CertManager, error)

NewCertManager will construct a new certificate.Certificater implemented using Jetstack's cert-manager,

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 in PEM format and its expiration.

func (*CertManager) IssueCertificate

func (cm *CertManager) IssueCertificate(cn certificate.CommonName, validityPeriod time.Duration) (certificate.Certificater, error)

IssueCertificate implements certificate.Manager and returns a newly issued certificate.

func (*CertManager) ListCertificates

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) ReleaseCertificate added in v0.6.0

func (cm *CertManager) ReleaseCertificate(cn certificate.CommonName)

ReleaseCertificate is called when a cert will no longer be needed and should be removed from the system.

func (*CertManager) RotateCertificate

func (cm *CertManager) RotateCertificate(cn certificate.CommonName) (certificate.Certificater, error)

RotateCertificate implements certificate.Manager and rotates an existing certificate. When a certificate is successfully created, garbage collect old CertificateRequests.

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.

func (Certificate) GetSerialNumber added in v0.6.0

func (c Certificate) GetSerialNumber() certificate.SerialNumber

GetSerialNumber returns the serial number of the given certificate.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL