encryptomatic: lukegb.com/encryptomatic/encryptoutil Index | Files

package encryptoutil

import "lukegb.com/encryptomatic/encryptoutil"

Package encryptoutil provides some useful X.509 utilities.

Index

Package Files

encryptoutil.go

func CertificateChainToPEM Uses

func CertificateChainToPEM(bundle []*x509.Certificate) []byte

CertificateChainToPEM converts a certificate and its chain into a PEM-encoded slice of bytes.

func CertificateRequestToPEM Uses

func CertificateRequestToPEM(req *x509.CertificateRequest) []byte

CertificateRequestToPEM converts an x509.CertificateRequest into a PEM-encoded slice of bytes.

func CertificateToPEM Uses

func CertificateToPEM(cert *x509.Certificate) []byte

CertificateToPEM converts a x509.Certificate into a PEM-encoded slice of bytes.

func NamesFromCertificateRequest Uses

func NamesFromCertificateRequest(req *x509.CertificateRequest) []string

NamesFromCertificateRequest retrieves the list of domain names a certificate request is for.

func PEMToCertificate Uses

func PEMToCertificate(pemBytes []byte) (*x509.Certificate, []byte, error)

PEMToCertificate parses a PEM-encoded slice of bytes into an x509.Certificate.

func PEMToPrivateKey Uses

func PEMToPrivateKey(pemBytes []byte) (crypto.Signer, error)

PEMToPrivateKey parses a slice of bytes containing a PEM-encoded private key into a crypto.Signer.

func PrivateKeyToPEM Uses

func PrivateKeyToPEM(key crypto.PrivateKey) ([]byte, error)

PrivateKeyToPEM converts a provided crypto.PrivateKey into a PEM-encoded slice of bytes.

func RetrieveCertificate Uses

func RetrieveCertificate(ctx context.Context, network, addr string) (*x509.Certificate, error)

RetrieveCertificate retrieves a certificate from the remote host by dialing it.

func RetrieveCertificateFromURL Uses

func RetrieveCertificateFromURL(ctx context.Context, urlStr string) (*x509.Certificate, error)

RetrieveCertificateFromURL retrieves a certificate from a remote host given a URL.

Package encryptoutil imports 12 packages (graph) and is imported by 1 packages. Updated 2017-11-07. Refresh now. Tools for package owners.