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.