cert

package
v0.0.0-...-4a5278f Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issuer

type Issuer struct {
	// contains filtered or unexported fields
}

Issuer represents the CA root with its key and certificate

func GetIssuer

func GetIssuer() *Issuer

GetIssuer returns the data for the CA root

func (*Issuer) CRT

func (iss *Issuer) CRT() *x509.Certificate

CRT return the certificate of the CA root

func (*Issuer) Key

func (iss *Issuer) Key() crypto.Signer

Key returns the CA key for signing

type LeafCert

type LeafCert struct {
	Key, CRT *pem.Block
}

LeafCert is a PEM encoded X509 certificate with its private key

func LeafCertificate

func LeafCertificate(caRoot *x509.Certificate,
	caKey crypto.PrivateKey, hostnames []string, addressIP []net.IP) (*LeafCert, error)

LeafCertificate returns a leaf certificate for the given hostnames and IP addresses. The issuer is the CA ROOT given in parameter. The leaf certificate is signed by the CA key. The subject is set arbitrarily.

func LeafCertificateFromCSR

func LeafCertificateFromCSR(caRoot *x509.Certificate,
	caKey crypto.PrivateKey, csr *x509.CertificateRequest) (*LeafCert, error)

LeafCertificateFromCSR returns a leaf certificate from the given CSR. The issuer is the CA ROOT given in parameter. The leaf certificate is signed by the CA key. The subject is given by the CSR.

func (*LeafCert) String

func (crt *LeafCert) String() string

Jump to

Keyboard shortcuts

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