certificateauthority

package
v0.0.1-really Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package certificateauthority implements an x509 certificate authority.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateAuthority

type CertificateAuthority struct {
	// The amount of allowable clock drift between the systems between
	// which certificates are exchanged.
	DriftMargin time.Duration
	// The keycrypt secret that contains the PEM-encoded signing
	// certificate and public key.
	Signer keycrypt.Secret
	// The x509 certificate. Populated by Init().
	Cert *x509.Certificate
	// contains filtered or unexported fields
}

CertificateAuthority is a x509 certificate authority.

func (*CertificateAuthority) Init

func (ca *CertificateAuthority) Init() error

Init initializes the certificate authority. Init extracts the the authority certificate and private key from ca.Signer.

func (CertificateAuthority) Issue

func (ca CertificateAuthority) Issue(commonName string, ttl time.Duration, ips []net.IP, dnss []string) ([]byte, *rsa.PrivateKey, error)

Issue a new certificate with both client and server authentication key usage extensions.

func (CertificateAuthority) IssueWithKeyUsage

func (ca CertificateAuthority) IssueWithKeyUsage(commonName string, ttl time.Duration, ips []net.IP, dnss []string, keyUsage []x509.ExtKeyUsage) ([]byte, *rsa.PrivateKey, error)

IssueWithKeyUsage a new certificate with the indicated key usage extensions.

Jump to

Keyboard shortcuts

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