cert

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2018 License: MIT Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInsecureKeyBitSize = errors.New("too few bits when generating key")

ErrInsecureKeyBitSize is returned if a generate method is called with too few bits.

Functions

func AddToCRL

func AddToCRL(crlPath, certPath, justification string) error

AddToCRL inserts an entry into the CRL at crlPath. The private key is read from the PEM-encoded cert at certPath.

func CheckCRL

func CheckCRL(cert *x509.Certificate) error

CheckCRL returns an error if cert is on the CRL.

func GenerateRSA

func GenerateRSA(bitSize int) (*rsa.PrivateKey, error)

GenerateRSA returns a RSA private key with the given key length.

func InitCRL

func InitCRL(path string) error

InitCRL reads the CRL from disk and starts the routine to periodically refresh it.

func IssueClientCert

func IssueClientCert(CACertPath, CAKeyPath, clientCertPath, clientKeyPath string) error

IssueClientCert mints and saves a client cert signed by the CA cert files provided.

func LoadPrivateCertFromFilePEM

func LoadPrivateCertFromFilePEM(certPath, keyPath string) (*x509.Certificate, *rsa.PrivateKey, error)

LoadPrivateCertFromFilePEM returns a cert & PK after loading both those components from the files at the specified paths. certPath should point to a PEM encoded certificate, and keyPath should point to a PEM encoded private key.

func LoadPrivateCertPEM

func LoadPrivateCertPEM(bytesCert []byte, keyBytes []byte) (*x509.Certificate, *rsa.PrivateKey, error)

LoadPrivateCertPEM returns a certificate and private key, decoded from bytesCert (PEM) and keyBytes (PEM).

func MakeServerCert

func MakeServerCert(serverCertPath, serverKeyPath, CACertPath, CAKeyPath string) error

MakeServerCert generates a CA+Server certificate and writes it into the specified paths.

Types

This section is empty.

Jump to

Keyboard shortcuts

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