tlstest

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Overview

Package tlstest contains utility methods to create test certificates. It is not meant to be used in production.

Index

Constants

View Source
const (
	// CA is the name of the CA toplevel cert.
	CA = "ca"
)

Variables

This section is empty.

Functions

func CreateCA

func CreateCA(root string)

CreateCA creates the toplevel 'ca' certificate and key, and places it in the provided directory. Temporary files are also created in that directory.

func CreateCRL added in v0.13.0

func CreateCRL(root, parent string)

CreateCRL creates a new empty certificate revocation list for the provided parent

func CreateIntermediateCA added in v0.14.0

func CreateIntermediateCA(root, parent, serial, name, commonName string)

func CreateSignedCert

func CreateSignedCert(root, parent, serial, name, commonName string)

CreateSignedCert creates a new certificate signed by the provided parent, with the provided serial number, name and common name. name is the file name to use. Common Name is the certificate common name.

func RevokeCertAndRegenerateCRL added in v0.13.0

func RevokeCertAndRegenerateCRL(root, parent, name string)

RevokeCertAndRegenerateCRL revokes a provided certificate under the provided parent CA and regenerates the CRL file for that parent

Types

type ClientServerKeyPairs

type ClientServerKeyPairs struct {
	ServerCert        string
	ServerKey         string
	ServerCA          string
	ServerName        string
	ServerCRL         string
	RevokedServerCert string
	RevokedServerKey  string
	RevokedServerName string
	ClientCert        string
	ClientKey         string
	ClientCA          string
	ClientCRL         string
	RevokedClientCert string
	RevokedClientKey  string
	RevokedClientName string
	CombinedCRL       string
}

ClientServerKeyPairs is used in tests

func CreateClientServerCertPairs

func CreateClientServerCertPairs(root string) ClientServerKeyPairs

CreateClientServerCertPairs creates certificate pairs for use in test

Jump to

Keyboard shortcuts

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