certificate

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostNames

type HostNames []string

HostNames contains the list of hosts the cert will be generated for

func (*HostNames) Set

func (h *HostNames) Set(value string) error

Set will add the hostname to the hostname array

func (*HostNames) String

func (h *HostNames) String() string

type KeyPair

type KeyPair struct {
	Certificate []byte
	PrivateKey  []byte
}

KeyPair stores a PEM encoded certificate and a PEM encoded RSA private key

func GenerateCA

func GenerateCA() (*KeyPair, error)

GenerateCA will generate a new CA key/cert pair

func GenerateSignedCert

func GenerateSignedCert(ca *KeyPair, hostnames HostNames, commonName string) (*KeyPair, error)

GenerateSignedCert will generate a new signed certificate signed by the input CA key/cert pair with one of multiple hostnames and with the given CN.

Jump to

Keyboard shortcuts

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