pki

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

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultExpiry = 365 * 24 * time.Hour

Variables

This section is empty.

Functions

func NewCertPoolFromCA

func NewCertPoolFromCA(ca *x509.Certificate) *x509.CertPool

Types

type CAConfig

type CAConfig struct {
	CommonName          string
	PermittedDNSDomains []string
	Expiry              time.Duration
}

type CertificateKeyPair

type CertificateKeyPair struct {
	PrivateKeyPem  []byte
	CertificatePem []byte
	Certificate    *x509.Certificate
	PrivateKey     ed25519.PrivateKey
}

func GenerateCA

func GenerateCA(config *CAConfig) (*CertificateKeyPair, error)

func (*CertificateKeyPair) CreateCertificate

func (c *CertificateKeyPair) CreateCertificate(hostName string, expiry time.Duration) (*CertificateKeyPair, error)

type PEMBlockType

type PEMBlockType string
const (
	CertificateBlock PEMBlockType = "CERTIFICATE"
	PrivateKeyBlock  PEMBlockType = "PRIVATE KEY"
)

Jump to

Keyboard shortcuts

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