certs

package
v0.0.0-...-06fe44a Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package certs provides functions to create certificates suitable for mTLS communication. In production only the agent should create those certificates, but placing this in the common module facilities other components's tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRootCA

func CreateRootCA(commonName string, serialNo *big.Int, destDir string) (rootCert *x509.Certificate, rootKey *ecdsa.PrivateKey, err error)

CreateRootCA creates a new root certificate authority (CA) certificate and private key pair with the serial number and common name provided. Only the cert is written into destDir in the PEM format. Being a CA, the certificate and private key returned can be used to sign other certificates.

func CreateTLSCertificateSignedBy

func CreateTLSCertificateSignedBy(name, certCN string, serial *big.Int, rootCACert *x509.Certificate, rootCAKey *ecdsa.PrivateKey, destDir string) (tlsCert *tls.Certificate, err error)

CreateTLSCertificateSignedBy creates a certificate and key pair usable for authentication signed by the root certificate authority (root CA) certificate and key provided and write them into destDir in the PEM format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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