juju: github.com/juju/juju/cert Index | Files

package cert

import "github.com/juju/juju/cert"


Package Files



var NewCA = newCA

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

var NewLeafKeyBits = 3072

NewLeafKeyBits is the number of bits used for the cert.NewLeaf call.

func Fingerprint Uses

func Fingerprint(certPEM string) (string, error)

Fingerprint returns a human-readable SHA-256 fingerprint for a certificate stored in the PEM format. The returned fingerprint matches the output of: openssl x509 -noout -fingerprint -sha256 -inform pem -in cert.pem

func NewDefaultServer Uses

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

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

func NewServer Uses

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 Verify Uses

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.

Package cert imports 7 packages (graph) and is imported by 388 packages. Updated 2020-01-09. Refresh now. Tools for package owners.