encryptoutil

package
v0.0.0-...-1867f9a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2017 License: Apache-2.0 Imports: 12 Imported by: 7

Documentation

Overview

Package encryptoutil provides some useful X.509 utilities.

Index

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

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

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

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

func RetrieveCertificate

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

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

func RetrieveCertificateFromURL

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

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

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL