certstorage

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VaultAccountKeyUri     = "uri"
	VaultAccountKeyEmail   = "email"
	VaultAccountKeyAccount = "account"
	VaultAccountKeyKey     = "key"
)

Variables

This section is empty.

Functions

func CertToMap

func CertToMap(res *AcmeCertificate) map[string]interface{}

func ConvertToPem

func ConvertToPem(privateKey crypto.PrivateKey) (string, error)

func FromPem

func FromPem(keyData []byte) (crypto.PrivateKey, error)

Types

type AccountStorage

type AccountStorage interface {
	// Authenticate authenticates against the storage subsystem and returns an error about the success of the operation.
	Authenticate() error

	// WriteAccount writes an ACME account to the storage.
	WriteAccount(AcmeAccount) error

	// ReadAccount reads the ACME account data for a given email address from the storage.
	ReadAccount(email string) (*AcmeAccount, error)

	// Logout cleans up and logs out of the storage subsystem.
	Logout()
}

type AcmeAccount

type AcmeAccount struct {
	Email        string
	Key          crypto.PrivateKey
	Registration *registration.Resource
}

func (AcmeAccount) GetEmail

func (account AcmeAccount) GetEmail() string

func (AcmeAccount) GetPrivateKey

func (account AcmeAccount) GetPrivateKey() crypto.PrivateKey

func (AcmeAccount) GetRegistration

func (account AcmeAccount) GetRegistration() *registration.Resource

func (AcmeAccount) IsInitialized

func (account AcmeAccount) IsInitialized() bool

func (AcmeAccount) Validate

func (account AcmeAccount) Validate()

type AcmeCertificate

type AcmeCertificate struct {
	Domain            string `json:"domain"`
	CertURL           string `json:"certUrl"`
	CertStableURL     string `json:"certStableUrl"`
	PrivateKey        []byte `json:"-"`
	Certificate       []byte `json:"-"`
	IssuerCertificate []byte `json:"-"`
	CSR               []byte `json:"-"`
}

func MapToCert

func MapToCert(data map[string]interface{}) (*AcmeCertificate, error)

func (*AcmeCertificate) AsPem added in v1.4.0

func (cert *AcmeCertificate) AsPem() (pem string)

func (*AcmeCertificate) GetDurationUntilExpiry

func (cert *AcmeCertificate) GetDurationUntilExpiry() (time.Duration, error)

func (*AcmeCertificate) GetExpiryTimestamp

func (cert *AcmeCertificate) GetExpiryTimestamp() (time.Time, error)

type CertMetadata added in v1.3.0

type CertMetadata struct {
	Expiry time.Time
	Domain string
}

func (*CertMetadata) GetDurationUntilExpiry added in v1.3.0

func (cert *CertMetadata) GetDurationUntilExpiry() time.Duration

type CertStorage

type CertStorage interface {
	// Authenticate authenticates against the storage subsystem and returns an error about the success of the operation.
	Authenticate() error

	// WriteCertificate writes the full certificate to the underlying storage.
	WriteCertificate(resource *AcmeCertificate) error

	// ReadPublicCertificateData reads the public portion of the certificate data (without the private key) from the
	// storage subsystem. This is intended to be used by the server component that does not need to have permission
	// to read the full certificate data.
	ReadPublicCertificateData(domain string) (*AcmeCertificate, error)

	// ReadFullCertificateData reads all data for a given certificate and is intended to be used by the client component.
	ReadFullCertificateData(domain string) (*AcmeCertificate, error)

	// Logout cleans up and logs out of the storage subsystem.
	Logout()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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