cert

package
v0.0.0-...-a7271ac Latest Latest
Warning

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

Go to latest
Published: May 4, 2014 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KeyBits = 1024

Functions

func Createx509Certificate

func Createx509Certificate(password string) (thumbprint, subject string)

func NewCA

func NewCA(envName string, expiry time.Time) (certPEM, keyPEM []byte, 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 []byte, expiry time.Time) (certPEM, keyPEM []byte, err error)

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

func NewServer

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

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

func ParseCert

func ParseCert(certPEM []byte) (*x509.Certificate, error)

ParseCert parses the given PEM-formatted X509 certificate.

func ParseCertAndKey

func ParseCertAndKey(certPEM, keyPEM []byte) (*x509.Certificate, *rsa.PrivateKey, error)

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

func Verify

func Verify(srvCertPEM, caCertPEM []byte, 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