Package encryptoutil provides some useful X.509 utilities.
CertificateChainToPEM converts a certificate and its chain into a PEM-encoded slice of bytes.
CertificateRequestToPEM converts an x509.CertificateRequest into a PEM-encoded slice of bytes.
CertificateToPEM converts a x509.Certificate into a PEM-encoded slice of bytes.
NamesFromCertificateRequest retrieves the list of domain names a certificate request is for.
PEMToCertificate parses a PEM-encoded slice of bytes into an x509.Certificate.
PEMToPrivateKey parses a slice of bytes containing a PEM-encoded private key into a crypto.Signer.
PrivateKeyToPEM converts a provided crypto.PrivateKey into a PEM-encoded slice of bytes.
RetrieveCertificate retrieves a certificate from the remote host by dialing it.
RetrieveCertificateFromURL retrieves a certificate from a remote host given a URL.