crypto

package
v1.16.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustCreateCert

func MustCreateCert(t *testing.T, pkData []byte, spec *cmapi.Certificate) []byte

MustCreateCert returns a self-signed x509 certificate

func MustCreateCertWithNotBeforeAfter

func MustCreateCertWithNotBeforeAfter(t *testing.T, pkData []byte, spec *cmapi.Certificate, notBefore, notAfter time.Time) []byte

MustCreateCertWithNotBeforeAfter returns a self-signed x509 cert for Certificate with the provided NotBefore, NotAfter values

func MustCreatePEMPrivateKey

func MustCreatePEMPrivateKey(t *testing.T) []byte

MustCreatePEMPrivateKey returns a PEM encoded 2048 bit RSA private key

func MustGenerateCSRImpl

func MustGenerateCSRImpl(t *testing.T, pkData []byte, cert *cmapi.Certificate) []byte

MustGenerateCSRImpl returns PEM encoded certificate signing request

Types

type CryptoBundle

type CryptoBundle struct {
	// certificate is the Certificate resource used to create this bundle
	Certificate *cmapi.Certificate
	// expectedRequestName is the name of the CertificateRequest that is
	// expected to be created to issue this certificate
	ExpectedRequestName string

	// privateKey is the private key used as the complement to the certificates
	// in this bundle
	PrivateKey      crypto.Signer
	PrivateKeyBytes []byte

	// csr is the CSR used to obtain the certificate in this bundle
	CSR      *x509.CertificateRequest
	CSRBytes []byte

	// certificateRequest is the request that is expected to be created to
	// obtain a certificate when using this bundle
	CertificateRequest                     *cmapi.CertificateRequest
	CertificateRequestPending              *cmapi.CertificateRequest
	CertificateRequestReady                *cmapi.CertificateRequest
	CertificateRequestFailed               *cmapi.CertificateRequest
	CertificateRequestFailedInvalidRequest *cmapi.CertificateRequest

	// cert is a signed certificate
	Cert      *x509.Certificate
	CertBytes []byte

	LocalTemporaryCertificateBytes []byte

	Clock clock.Clock
}

func CreateCryptoBundle added in v1.10.0

func CreateCryptoBundle(originalCert *cmapi.Certificate, clock clock.Clock) (*CryptoBundle, error)

func MustCreateCryptoBundle

func MustCreateCryptoBundle(t *testing.T, crt *cmapi.Certificate, clock clock.Clock) CryptoBundle

MustCreateCryptoBundle creates a CryptoBundle to be used with tests or fails.

Jump to

Keyboard shortcuts

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