Documentation ¶
Index ¶
- func Generate(cn, hosts string) ([]byte, *rsa.PrivateKey, error)
- func GenerateAndWrite(cn, hosts, certPath, keyPath string, force bool) error
- func GenerateCertAndKey(cn, hosts string) (*x509.Certificate, *rsa.PrivateKey, error)
- func ParseCert(b []byte) (*x509.Certificate, error)
- func ParseCertFromBlock(b []byte) ([]*x509.Certificate, error)
- func PemEncodeCert(cert []byte) []byte
- func PemEncodeKey(key *rsa.PrivateKey) []byte
- func ReadCert(p string) (*x509.Certificate, error)
- func WriteCert(cert []byte, certPath string, force bool) error
- func WriteKey(key *rsa.PrivateKey, keyPath string, force bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
func Generate(cn, hosts string) ([]byte, *rsa.PrivateKey, error)
Generate a key and cert
func GenerateAndWrite ¶
GenerateAndWrite generate a certificate and key and save to the given paths. Do not overwrite unless force is true.
func GenerateCertAndKey ¶
func GenerateCertAndKey(cn, hosts string) (*x509.Certificate, *rsa.PrivateKey, error)
GenerateCertAndKey generate a certificate and a key, and return as x509.Certificate and rsa.PrivateKey
func ParseCert ¶
func ParseCert(b []byte) (*x509.Certificate, error)
ParseCert parse a cert from a PEM-encoded byte slice
func ParseCertFromBlock ¶
func ParseCertFromBlock(b []byte) ([]*x509.Certificate, error)
ParseCertFromBlock process pem certificates
func PemEncodeCert ¶
PemEncodeCert take certificate DER bytes and PEM encode them
func PemEncodeKey ¶
func PemEncodeKey(key *rsa.PrivateKey) []byte
PemEncodeKey take an RSA private key and PEM encode it
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.