Documentation ¶
Index ¶
- Variables
- func CertificateVerifier(logCxt *log.Entry, roots *x509.CertPool, requiredCN, requiredURISAN string) func([][]byte, [][]*x509.Certificate) error
- func MakeCACert(name string) (*x509.Certificate, *rsa.PrivateKey)
- func MakePeerCert(cn, uriSAN string, extKeyUsage x509.ExtKeyUsage, caCert *x509.Certificate, ...) ([]byte, *rsa.PrivateKey)
- func PanicIfErr(err error)
- func WriteCert(data []byte, fileName string)
- func WriteKey(key *rsa.PrivateKey, fileName string)
Constants ¶
This section is empty.
Variables ¶
View Source
var RSAKeySize int = 2048
Functions ¶
func CertificateVerifier ¶
func CertificateVerifier(logCxt *log.Entry, roots *x509.CertPool, requiredCN, requiredURISAN string) func([][]byte, [][]*x509.Certificate) error
Common code for verifying whether a peer certificate has a required Common Name and/or a required URI SAN.
func MakeCACert ¶
func MakeCACert(name string) (*x509.Certificate, *rsa.PrivateKey)
func MakePeerCert ¶
func MakePeerCert(cn, uriSAN string, extKeyUsage x509.ExtKeyUsage, caCert *x509.Certificate, caKey *rsa.PrivateKey) ([]byte, *rsa.PrivateKey)
func PanicIfErr ¶
func PanicIfErr(err error)
The following certificate generators panic if they hit any error. This is a bit poor, but OK in practice because they are only used by test code.
func WriteKey ¶
func WriteKey(key *rsa.PrivateKey, fileName string)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.