Documentation ¶
Index ¶
- Variables
- func AddToCRL(crlPath, certPath, justification string) error
- func CheckCRL(cert *x509.Certificate) error
- func GenerateRSA(bitSize int) (*rsa.PrivateKey, error)
- func InitCRL(path string) error
- func IssueClientCert(CACertPath, CAKeyPath, clientCertPath, clientKeyPath string) error
- func LoadPrivateCertFromFilePEM(certPath, keyPath string) (*x509.Certificate, *rsa.PrivateKey, error)
- func LoadPrivateCertPEM(bytesCert []byte, keyBytes []byte) (*x509.Certificate, *rsa.PrivateKey, error)
- func MakeServerCert(serverCertPath, serverKeyPath, CACertPath, CAKeyPath string) error
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 IssueClientCert ¶
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 ¶
MakeServerCert generates a CA+Server certificate and writes it into the specified paths.
Types ¶
This section is empty.