certtest

package
v0.83.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package certtest builds throwaway CAs and leaf certificates for certificate posture tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertPEM

func CertPEM(cert *x509.Certificate) string

func ECDSAKey

func ECDSAKey(t *testing.T) crypto.Signer

func Ed25519Key

func Ed25519Key(t *testing.T) crypto.Signer

func KeyPEM

func KeyPEM(t *testing.T, key crypto.Signer) string

func RSAKey

func RSAKey(t *testing.T) crypto.Signer

Types

type CA

type CA struct {
	Cert *x509.Certificate
	Key  crypto.Signer
	PEM  string
}

func NewCA

func NewCA(t *testing.T, name string) *CA

func NewIntermediate

func NewIntermediate(t *testing.T, parent *CA, name string) *CA

NewIntermediate creates a CA signed by parent.

func (*CA) Issue

func (ca *CA) Issue(t *testing.T, key crypto.Signer, cn string) *x509.Certificate

Issue signs a leaf certificate for key with the CA.

Jump to

Keyboard shortcuts

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