certificates

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeCertificate

func EncodeCertificate(certificate []byte) (string, error)

EncodeCertificate PEM encodes a DER certificate.

func EncodeKey

func EncodeKey(key *rsa.PrivateKey) (string, error)

EncodeKey PEM encodes an RSA key.

Types

type Authority

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

Authority represetns a certificate authority.

func Root

func Root(commonName string) (*Authority, error)

Root generates a root certificate authority.

func (*Authority) Branch

func (a *Authority) Branch(commonName string) (*Authority, error)

Branch creates a branch (i.e., intermediate certificate authority).

func (*Authority) EncodeCertificate

func (a *Authority) EncodeCertificate() (string, error)

EncodeCertificate returns the PEM encoded certificate for the authority.

func (*Authority) Leaf

func (a *Authority) Leaf(commonName string, alternativeNames []string, expires time.Duration) (*Leaf, error)

Leaf creates a leaf certificate.

type Leaf

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

Leaf represents a leaf node in a certificate chain.

func (*Leaf) EncodeCertificate

func (l *Leaf) EncodeCertificate() (string, error)

EncodeCertificate returns the PEM encoded certificate for the leaf.

func (*Leaf) EncodeKey

func (l *Leaf) EncodeKey() (string, error)

EncodeKey returns the PEM encoded key for the leaf.

Jump to

Keyboard shortcuts

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