Documentation ¶
Index ¶
- Variables
- func RegisterPlugin(plugin string, newFunc NewPlugin)
- type CertInfo
- type CertModule
- type CertStorage
- type Handler
- func (handler *Handler) ApplyCertificate(certType string, cert []byte) (certURL, serial string, err error)
- func (handler *Handler) Clear(certType string) (err error)
- func (handler *Handler) Close()
- func (handler *Handler) CreateKey(certType, subject, password string) (csr []byte, err error)
- func (handler *Handler) CreateSelfSignedCert(certType, password string) (err error)
- func (handler *Handler) GetCertTypes() (certTypes []string)
- func (handler *Handler) GetCertificate(certType string, issuer []byte, serial string) (certURL, keyURL string, err error)
- func (handler *Handler) SetOwner(certType, password string) (err error)
- type NewPlugin
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotExist = errors.New("certificate not exist")
Functions ¶
func RegisterPlugin ¶
RegisterPlugin registers module plugin.
Types ¶
type CertInfo ¶
type CertInfo struct { Issuer string Serial string CertURL string KeyURL string NotAfter time.Time }
CertInfo certificate info.
type CertModule ¶
type CertModule interface { ValidateCertificates() (validInfos []CertInfo, invalidCerts, invalidKeys []string, err error) SetOwner(password string) (err error) Clear() (err error) CreateKey(password, algorithm string) (key crypto.PrivateKey, err error) ApplyCertificate(certs []*x509.Certificate) (certInfo CertInfo, password string, err error) RemoveCertificate(certURL, password string) (err error) RemoveKey(certURL, password string) (err error) Close() (err error) }
CertModule provides API to manage module certificates.
type CertStorage ¶
type CertStorage interface { AddCertificate(certType string, cert CertInfo) (err error) GetCertificate(issuer, serial string) (cert CertInfo, err error) GetCertificates(certType string) (certs []CertInfo, err error) RemoveCertificate(certType, certURL string) (err error) RemoveAllCertificates(certType string) (err error) }
CertStorage provides API to store/retrieve certificates info.
type Handler ¶
Handler update handler.
func New ¶
func New(cfg *config.Config, storage CertStorage) (handler *Handler, err error)
New returns pointer to new Handler.
func (*Handler) ApplyCertificate ¶
func (handler *Handler) ApplyCertificate(certType string, cert []byte) (certURL, serial string, err error)
ApplyCertificate applies certificate.
func (*Handler) CreateSelfSignedCert ¶
func (*Handler) GetCertTypes ¶
GetCertTypes returns IAM cert types.
type NewPlugin ¶
type NewPlugin func(certType string, configJSON json.RawMessage) (module CertModule, err error)
NewPlugin plugin new function.
Click to show internal directories.
Click to hide internal directories.