ca

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateData

type CertificateData interface {
	// Returns a certificate.
	Certificate() *x509.Certificate
	// Returns PEM bytes.
	PEM() []byte
}

CertificateData contains a x509.Certificate and PEM bytes.

type CertificateWithKeyData

type CertificateWithKeyData interface {
	// Returns a certificate.
	Certificate() *x509.Certificate
	// Returns certificate PEM bytes.
	CertificatePEM() []byte
	// Returns a key.
	Key() *rsa.PrivateKey
	// Returns key PEM bytes.
	KeyPEM() []byte
}

CertificateWithKeyData contains a x509.Certificate and rsa.PrivateKey.

type EmbeddedCA

type EmbeddedCA interface {
	// CAPEMChain returns CA chain in the PEM format.
	CAPEMChain() []string
	// Creates a new client certificate and the certificate with a private key.
	NewClientCert() (CertificateWithKeyData, error)
	// Creates a new client certificate and constructs a tls.Config valid for this CA.
	NewClientCertTLSConfig(string) (*tls.Config, error)
	// Creates a new server certificate and constructs a tls.Config valid for this CA.
	NewServerCertTLSConfig() (*tls.Config, error)
}

EmbeddedCA represents an embedded bootstrap time only CA.

func NewDefaultEmbeddedCA

func NewDefaultEmbeddedCA(config *EmbeddedCAConfig) (EmbeddedCA, error)

NewDefaultEmbeddedCA creates and initializes a new instance of an embedded CA with a default logger.

func NewDefaultEmbeddedCAWithLogger

func NewDefaultEmbeddedCAWithLogger(config *EmbeddedCAConfig, logger hclog.Logger) (EmbeddedCA, error)

NewDefaultEmbeddedCAWithLogger creates and initializes a new instance of an embedded CA with a provided logger.

type EmbeddedCAConfig

type EmbeddedCAConfig struct {
	Addresses       []string
	CertsValidFor   time.Duration
	KeySize         int
	UseIntermediate bool
}

EmbeddedCAConfig is the embedded CA configuration.

func (*EmbeddedCAConfig) WithDefaultsApplied

func (c *EmbeddedCAConfig) WithDefaultsApplied() *EmbeddedCAConfig

WithDefaultsApplied applies defaults to any not set values.

Jump to

Keyboard shortcuts

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