fakeca

package
v0.0.0-...-56f983d Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package fakeca implements a fake root CA for signing fake TLS certificates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeCA

type FakeCA struct {
	PrivKey *rsa.PrivateKey
	Cert    *x509.Certificate

	PrivKeyPEM []byte
	CertPEM    []byte
}

FakeCA is a fake root CA for signing fake TLS certificates.

func FromKeyPair

func FromKeyPair(keyPEM, certPEM []byte) (*FakeCA, error)

FromKeyPair converts a key pair in PEM bytes into a FakeCA.

func NewCA

func NewCA() (*FakeCA, error)

NewCA returns a new fake root CA.

func (*FakeCA) NewCert

func (ca *FakeCA) NewCert(dnsNames []string) (certPEM, privKeyPEM []byte, err2 error)

NewCert creates a fake certificate for the given domain names.

Jump to

Keyboard shortcuts

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