certstorage

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VaultAccountKeyUri     = "uri"
	VaultAccountKeyEmail   = "email"
	VaultAccountKeyAccount = "account"
	VaultAccountKeyKey     = "key"
)
View Source
const (
	// MinCertLifetime defines a certs minimum validity. If a certificate's lifetime is less than this threshold, it's
	// being renewed.
	MinCertLifetime = time.Duration(24) * time.Hour * 30
	Skew            = time.Duration(24) * time.Hour * 45
)

Variables

View Source
var ErrAccountNotFound = errors.New("account not found")
View Source
var ErrNotFound = errors.New("not found")
View Source
var ErrPermissionDenied = errors.New("permission denied")

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 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) GetDurationUntilExpiry

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

func (*AcmeCertificate) GetExpiryTimestamp

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

func (*AcmeCertificate) NeedsRenewal added in v1.10.0

func (cert *AcmeCertificate) NeedsRenewal() (bool, error)

type CertMetadata added in v1.3.0

type CertMetadata struct {
	Expiry time.Time
	Domain string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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