cert

package
v0.0.0-...-be26699 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2015 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KeyBits = 1024

Functions

func NewCA

func NewCA(envName string, expiry time.Time) (certPEM, keyPEM string, err error)

NewCA generates a CA certificate/key pair suitable for signing server keys for an environment with the given name.

func NewClient

func NewClient(caCertPEM, caKeyPEM string, expiry time.Time) (certPEM, keyPEM string, err error)

NewClient generates a certificate/key pair suitable for client authentication.

func NewDefaultServer

func NewDefaultServer(caCertPEM, caKeyPEM string, hostnames []string) (certPEM, keyPEM string, err error)

NewServer generates a certificate/key pair suitable for use by a server, with an expiry time of 10 years.

func NewServer

func NewServer(caCertPEM, caKeyPEM string, expiry time.Time, hostnames []string) (certPEM, keyPEM string, err error)

NewServer generates a certificate/key pair suitable for use by a server.

func ParseCert

func ParseCert(certPEM string) (*x509.Certificate, error)

ParseCert parses the given PEM-formatted X509 certificate.

func ParseCertAndKey

func ParseCertAndKey(certPEM, keyPEM string) (*x509.Certificate, *rsa.PrivateKey, error)

ParseCertAndKey parses the given PEM-formatted X509 certificate and RSA private key.

func Verify

func Verify(srvCertPEM, caCertPEM string, when time.Time) error

Verify verifies that the given server certificate is valid with respect to the given CA certificate at the given time.

Types

This section is empty.

Jump to

Keyboard shortcuts

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