crypto

package
v1.1.0-beta2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2016 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertPoolFromFile

func CertPoolFromFile(filename string) (*x509.CertPool, error)

CertPoolFromFile returns an x509.CertPool containing the certificates in the given PEM-encoded file. Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates

func CertsFromPEM

func CertsFromPEM(pemCerts []byte) ([]*x509.Certificate, error)

CertsFromPEM returns the x509.Certificates contained in the given PEM-encoded byte array Returns an error if a certificate could not be parsed, or if the data does not contain any certificates

func GenerateSelfSignedCert

func GenerateSelfSignedCert(host, certPath, keyPath string, alternateIPs []net.IP, alternateDNS []string) error

GenerateSelfSignedCert creates a self-signed certificate and key for the given host. Host may be an IP or a DNS name You may also specify additional subject alt names (either ip or dns names) for the certificate The certificate will be created with file mode 0644. The key will be created with file mode 0600. If the certificate or key files already exist, they will be overwritten. Any parent directories of the certPath or keyPath will be created as needed with file mode 0755.

Types

This section is empty.

Jump to

Keyboard shortcuts

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