pki

package
v6.2.12 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

README

Contents

This folder contains some basic certificates that can be used to test the Nuts node

  • a truststore with a single CA: truststore.pem
  • a valid certificate with a key: certificate-and-key.pem
  • an invalid certificate: invalid-cert.pem

Expired certificate(s)?

Regenerate using

sh generate.sh

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CertificateData []byte

CertificateData contains the PEM-encoded test certificate and its key.

View Source
var InvalidCertificateData []byte

InvalidCertificateData contains the PEM-encoded invalid test certificate and its key.

View Source
var TruststoreData []byte

TruststoreData contains the PEM-encoded test truststore.

Functions

func BuildCertChain

func BuildCertChain(identifiers []string, subjectSerialNumber string, signCertKeyUsage *x509.KeyUsage) ([]*x509.Certificate, []*rsa.PrivateKey, error)

BuildCertChain generates a certificate chain, including root, intermediate, and signing certificates.

func BuildRootCert

func BuildRootCert() (*rsa.PrivateKey, *x509.Certificate, error)

func BuildSigningCert

func BuildSigningCert(identifiers []string, intermediateL2Cert *x509.Certificate, intermediateL2Key *rsa.PrivateKey, serialNumber string, keyUsage *x509.KeyUsage) (*rsa.PrivateKey, *x509.Certificate, error)

func Certificate

func Certificate() tls.Certificate

Certificate returns a valid test certificate.

func CertificateFile

func CertificateFile(t *testing.T) string

CertificateFile returns the path to a file containing a valid test certificate and its key.

func CertsToChain

func CertsToChain(certs []*x509.Certificate) *cert.Chain

func InvalidCertificate

func InvalidCertificate() tls.Certificate

InvalidCertificate returns an invalid test certificate.

func Truststore

func Truststore() *x509.CertPool

Truststore returns a test truststore.

func TruststoreFile

func TruststoreFile(t *testing.T) string

TruststoreFile returns the path to a file containing a test truststore.

Types

This section is empty.

Jump to

Keyboard shortcuts

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