certificate

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package certificate provides facilities for working with certificates.

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