certmgr

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 15 Imported by: 0

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.

Jump to

Keyboard shortcuts

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