cert

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CACSRInput added in v0.37.0

type CACSRInput struct {
	CommonName       string
	Country          string
	Locality         string
	Organization     string
	OrganizationUnit string
	Expiry           string
}

CACSRInput struct.

type CaPaths added in v0.37.0

type CaPaths interface {
	NodeCertAbsFilename(identifier string) string
	NodeCertKeyAbsFilename(identifier string) string
	NodeCertCSRAbsFilename(identifier string) string
	NodeTLSDir(string) string
	CaDir() string
}

type Certificate added in v0.37.0

type Certificate struct {
	Cert []byte
	Key  []byte
	Csr  []byte
}

Certificate stores the combination of Cert and Key along with the CSR if available.

func NewCertificateFromFile added in v0.37.0

func NewCertificateFromFile(certFilePath, keyFilePath, csrFilePath string) (*Certificate, error)

NewCertificateFromFile creates a new Certificate by loading cert, key and csr (if exists) from respecting files.

func (*Certificate) Write added in v0.37.0

func (c *Certificate) Write(certPath, keyPath, csrPath string) error

Write writes the cert, key and csr to disk.

type LocalDirCertStorage added in v0.37.0

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

LocalDirCertStorage is a certificate storage, that stores certificates in a local directory.

func NewLocalDirCertStorage added in v0.37.0

func NewLocalDirCertStorage(paths CaPaths) *LocalDirCertStorage

NewLocalDirCertStorage inits a new LocalDirCertStorage.

func (*LocalDirCertStorage) LoadCaCert added in v0.37.0

func (c *LocalDirCertStorage) LoadCaCert() (*Certificate, error)

LoadCaCert loads the CA certificate from disk.

func (*LocalDirCertStorage) LoadNodeCert added in v0.37.0

func (c *LocalDirCertStorage) LoadNodeCert(nodeName string) (*Certificate, error)

LoadNodeCert loads the node certificate from disk. Used to load CA certificate as well, as CA certificate can be seen as node named "ca".

func (*LocalDirCertStorage) StoreCaCert added in v0.37.0

func (c *LocalDirCertStorage) StoreCaCert(cert *Certificate) error

StoreCaCert stores the given CA certificate in a file in the baseFolder.

func (*LocalDirCertStorage) StoreNodeCert added in v0.37.0

func (c *LocalDirCertStorage) StoreNodeCert(nodeName string, cert *Certificate) error

StoreNodeCert stores the given certificate in a file in the baseFolder.

type NodeCSRInput added in v0.37.0

type NodeCSRInput struct {
	Hosts            []string
	CommonName       string
	Country          string
	Locality         string
	Organization     string
	OrganizationUnit string
	Expiry           string
}

NodeCSRInput struct.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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