Documentation ¶
Overview ¶
Package encryptoutil provides some useful X.509 utilities.
Index ¶
- func CertificateChainToPEM(bundle []*x509.Certificate) []byte
- func CertificateRequestToPEM(req *x509.CertificateRequest) []byte
- func CertificateToPEM(cert *x509.Certificate) []byte
- func NamesFromCertificateRequest(req *x509.CertificateRequest) []string
- func PEMToCertificate(pemBytes []byte) (*x509.Certificate, []byte, error)
- func PEMToPrivateKey(pemBytes []byte) (crypto.Signer, error)
- func PrivateKeyToPEM(key crypto.PrivateKey) ([]byte, error)
- func RetrieveCertificate(ctx context.Context, network, addr string) (*x509.Certificate, error)
- func RetrieveCertificateFromURL(ctx context.Context, urlStr string) (*x509.Certificate, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CertificateChainToPEM ¶
func CertificateChainToPEM(bundle []*x509.Certificate) []byte
CertificateChainToPEM converts a certificate and its chain into a PEM-encoded slice of bytes.
func CertificateRequestToPEM ¶
func CertificateRequestToPEM(req *x509.CertificateRequest) []byte
CertificateRequestToPEM converts an x509.CertificateRequest into a PEM-encoded slice of bytes.
func CertificateToPEM ¶
func CertificateToPEM(cert *x509.Certificate) []byte
CertificateToPEM converts a x509.Certificate into a PEM-encoded slice of bytes.
func NamesFromCertificateRequest ¶
func NamesFromCertificateRequest(req *x509.CertificateRequest) []string
NamesFromCertificateRequest retrieves the list of domain names a certificate request is for.
func PEMToCertificate ¶
func PEMToCertificate(pemBytes []byte) (*x509.Certificate, []byte, error)
PEMToCertificate parses a PEM-encoded slice of bytes into an x509.Certificate.
func PEMToPrivateKey ¶
PEMToPrivateKey parses a slice of bytes containing a PEM-encoded private key into a crypto.Signer.
func PrivateKeyToPEM ¶
func PrivateKeyToPEM(key crypto.PrivateKey) ([]byte, error)
PrivateKeyToPEM converts a provided crypto.PrivateKey into a PEM-encoded slice of bytes.
func RetrieveCertificate ¶
RetrieveCertificate retrieves a certificate from the remote host by dialing it.
func RetrieveCertificateFromURL ¶
RetrieveCertificateFromURL retrieves a certificate from a remote host given a URL.
Types ¶
This section is empty.