Documentation ¶
Index ¶
- func CreateFolderStructure()
- func GetCertPath() string
- func SanitizedDomain(domain string) string
- type Account
- type AccountsStorage
- func (s *AccountsStorage) ExistsAccountFilePath() bool
- func (s *AccountsStorage) GetPrivateKey(keyType certcrypto.KeyType) crypto.PrivateKey
- func (s *AccountsStorage) GetUserID() string
- func (s *AccountsStorage) LoadAccount(privateKey crypto.PrivateKey) *Account
- func (s *AccountsStorage) Save(account *Account) error
- type CertificatesStorage
- func (s *CertificatesStorage) GetFileName(domain, extension string) string
- func (s *CertificatesStorage) MoveToArchive(domain string) error
- func (s *CertificatesStorage) ReadCertificate(domain, extension string) ([]*x509.Certificate, error)
- func (s *CertificatesStorage) ReadFile(domain, extension string) ([]byte, error)
- func (s *CertificatesStorage) ReadResource(domain string) certificate.Resource
- func (s *CertificatesStorage) SaveResource(certRes *certificate.Resource)
- func (s *CertificatesStorage) WriteFile(domain, extension string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFolderStructure ¶
func CreateFolderStructure()
func GetCertPath ¶
func GetCertPath() string
GetCertPath():
/knary/certs/ └── root certificates directory
archive file path:
/knary/certs/archives/ └── archived certificates directory
func SanitizedDomain ¶
sanitizedDomain Make sure no funny chars are in the cert names (like wildcards ;)).
Types ¶
type Account ¶
type Account struct { Email string `json:"email"` Registration *registration.Resource `json:"registration"` Key crypto.PrivateKey `json:"-"` }
Account represents a users local saved credentials.
func (*Account) GetPrivateKey ¶
func (a *Account) GetPrivateKey() crypto.PrivateKey
GetPrivateKey returns the private RSA account key.
func (*Account) GetRegistration ¶
func (a *Account) GetRegistration() *registration.Resource
GetRegistration returns the server registration.
type AccountsStorage ¶
type AccountsStorage struct {
// contains filtered or unexported fields
}
func NewAccountsStorage ¶
func NewAccountsStorage() *AccountsStorage
NewAccountsStorage Creates a new AccountsStorage.
func (*AccountsStorage) ExistsAccountFilePath ¶
func (s *AccountsStorage) ExistsAccountFilePath() bool
func (*AccountsStorage) GetPrivateKey ¶
func (s *AccountsStorage) GetPrivateKey(keyType certcrypto.KeyType) crypto.PrivateKey
func (*AccountsStorage) GetUserID ¶
func (s *AccountsStorage) GetUserID() string
func (*AccountsStorage) LoadAccount ¶
func (s *AccountsStorage) LoadAccount(privateKey crypto.PrivateKey) *Account
func (*AccountsStorage) Save ¶
func (s *AccountsStorage) Save(account *Account) error
type CertificatesStorage ¶
type CertificatesStorage struct {
// contains filtered or unexported fields
}
func NewCertificatesStorage ¶
func NewCertificatesStorage() *CertificatesStorage
NewCertificatesStorage create a new certificates storage.
func (*CertificatesStorage) GetFileName ¶
func (s *CertificatesStorage) GetFileName(domain, extension string) string
func (*CertificatesStorage) MoveToArchive ¶
func (s *CertificatesStorage) MoveToArchive(domain string) error
func (*CertificatesStorage) ReadCertificate ¶
func (s *CertificatesStorage) ReadCertificate(domain, extension string) ([]*x509.Certificate, error)
func (*CertificatesStorage) ReadFile ¶
func (s *CertificatesStorage) ReadFile(domain, extension string) ([]byte, error)
func (*CertificatesStorage) ReadResource ¶
func (s *CertificatesStorage) ReadResource(domain string) certificate.Resource
func (*CertificatesStorage) SaveResource ¶
func (s *CertificatesStorage) SaveResource(certRes *certificate.Resource)
Click to show internal directories.
Click to hide internal directories.