Documentation
¶
Index ¶
- Variables
- func CreateCertificateRequest(certPrivkey *rsa.PrivateKey, commonName string, domain ...string) (string, error)
- func Debug(v ...interface{})
- func DirectoryURL() string
- func NewLegoClient(ri *RegistrationInfo) (*lego.Client, error)
- type Filer
- type OSFiler
- type RegistrationInfo
- type S3Filer
- type Store
- func (s *Store) ListDomains() ([]string, error)
- func (s *Store) LoadCert(domain string) (*x509.Certificate, error)
- func (s *Store) LoadCertKey(domain string) (crypto.PrivateKey, error)
- func (s *Store) LoadRegistration() (*RegistrationInfo, error)
- func (s *Store) SaveCert(domain string, cert []byte) error
- func (s *Store) SaveCertKey(domain string, privKey crypto.PrivateKey) error
- func (s *Store) SaveRegistration(ri *RegistrationInfo) error
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultDirectoryURL = "https://acme-staging-v02.api.letsencrypt.org/directory"
View Source
var ( // ErrFileNotFound is the error returned by Filer interface when file is not found. ErrFileNotFound = errors.New("aaa: file not found") )
View Source
var StorePrefix = "aaa-data/v2"
Functions ¶
func CreateCertificateRequest ¶
func CreateCertificateRequest(certPrivkey *rsa.PrivateKey, commonName string, domain ...string) (string, error)
CreateCertificateRequest creates CSR in DER encoded in base64.
func DirectoryURL ¶
func DirectoryURL() string
func NewLegoClient ¶
func NewLegoClient(ri *RegistrationInfo) (*lego.Client, error)
NewClient2 initializes the lego ACME client and returns the client. If it fails to initialize the client, it will return an error.
Types ¶
type Filer ¶
type Filer interface { WriteFile(string, []byte) error ReadFile(string) ([]byte, error) Join(elem ...string) string Split(elem string) []string ListDir(string) ([]string, error) }
Filer interface represents a file storage layer for AAA.
type OSFiler ¶
type OSFiler struct { // BaseDir is prepended into given filename. BaseDir string }
OSFiler implements Filer interface backed by *os.File.
func (*OSFiler) ListDir ¶
ListDir returns directories that has the given prefix. See https://golang.org/pkg/os/#File.Readdirnames (n <= 0)
type RegistrationInfo ¶
type RegistrationInfo struct { Email string `json:"email"` Registration *registration.Resource `json:"registration"` Key *jose.JSONWebKey `json:"key"` }
RegistrationInfo is a data persisted on the storage. A private key for this will be persisted in JWK.
func (*RegistrationInfo) GetEmail ¶
func (ri *RegistrationInfo) GetEmail() string
func (*RegistrationInfo) GetPrivateKey ¶
func (ri *RegistrationInfo) GetPrivateKey() crypto.PrivateKey
func (*RegistrationInfo) GetRegistration ¶
func (ri *RegistrationInfo) GetRegistration() *registration.Resource
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) ListDomains ¶
func (*Store) LoadCertKey ¶
func (s *Store) LoadCertKey(domain string) (crypto.PrivateKey, error)
func (*Store) LoadRegistration ¶
func (s *Store) LoadRegistration() (*RegistrationInfo, error)
LoadRegistration returns the existing registration.
func (*Store) SaveCertKey ¶
func (s *Store) SaveCertKey(domain string, privKey crypto.PrivateKey) error
func (*Store) SaveRegistration ¶
func (s *Store) SaveRegistration(ri *RegistrationInfo) error
Click to show internal directories.
Click to hide internal directories.