Documentation ¶
Overview ¶
Package certmgr provides functions to load, save and download mGuard device certificates from the device database.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertificateManager ¶
type CertificateManager struct {
// contains filtered or unexported fields
}
CertificateManager represents the mGuard device certificate manager.
func NewCertificateManager ¶
func NewCertificateManager(certificateCacheDirectory, deviceDatabaseUser, deviceDatabasePassword string) (*CertificateManager, error)
NewCertificateManager returns a new device certificate manager. The cache path may be empty to disable caching. Username and password may be empty to let the certificate manager look into the mguard-device-database.yaml for credentials.
func (*CertificateManager) GetCertificate ¶
func (mgr *CertificateManager) GetCertificate(serial string) (*x509.Certificate, error)
GetCertificate tries to get the device certificate for the mGuard with the specified serial number. It serves the certificate from its cache, if possible, and downloads the the certificate from the device database, if necessary.