Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRootAndChildCerts ¶
NewRootAndChildCerts returns a root CA and a child certificate and their keys for "localhost" and "127.0.0.1".
Types ¶
type Pair ¶
Pair is a certificate and its private key in PEM format.
func GenerateChildCert ¶
func GenerateChildCert(name string, ips []net.IP, caPrivKey crypto.PrivateKey, caCert *x509.Certificate) (*tls.Certificate, Pair, error)
GenerateChildCert generates a x509 Certificate as a child of caCert and returns the following: - the certificate in PEM format as a byte slice - the private key in PEM format as a byte slice - the certificate and private key as a tls.Certificate
If any error occurs during the generation process, a non-nil error is returned.
func NewRootCA ¶
func NewRootCA() (*ecdsa.PrivateKey, *x509.Certificate, Pair, error)
NewRootCA generates a new x509 Certificate and returns: - the private key - the certificate - the certificate in PEM format as a byte slice.
If any error occurs during the generation process, a non-nil error is returned.