Documentation ¶
Index ¶
- func GenerateCSR(privateKey *rsa.PrivateKey, subject *pkix.Name, extension []pkix.Extension) (csr *x509.CertificateRequest, err error)
- func GenerateFakeUserOrDeviceCertificate(ca *x509.Certificate, caPrivKey *rsa.PrivateKey, isDeviceCertificate bool) (*x509.Certificate, *rsa.PrivateKey, error)
- func GenerateSelfSignedCertificate(serialNUmber *big.Int, subject *pkix.Name, keyUsage x509.KeyUsage, ...) (cert *x509.Certificate, key *rsa.PrivateKey, err error)
- func SignCSR(caCert *x509.Certificate, caPrivKey *rsa.PrivateKey, ...) (cert *x509.Certificate, err error)
- type CertKeyBundle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCSR ¶ added in v0.0.5
func GenerateCSR( privateKey *rsa.PrivateKey, subject *pkix.Name, extension []pkix.Extension) (csr *x509.CertificateRequest, err error)
GenerateCSR generates a certificate signing request
func GenerateFakeUserOrDeviceCertificate ¶ added in v0.1.0
func GenerateFakeUserOrDeviceCertificate(ca *x509.Certificate, caPrivKey *rsa.PrivateKey, isDeviceCertificate bool) ( *x509.Certificate, *rsa.PrivateKey, error)
GenerateFakeUserOrDeviceCertificate generates a fake user certificate signed by the CA
func GenerateSelfSignedCertificate ¶ added in v0.0.5
func GenerateSelfSignedCertificate( serialNUmber *big.Int, subject *pkix.Name, keyUsage x509.KeyUsage, extKeyUsage []x509.ExtKeyUsage, extensions []pkix.Extension, ) (cert *x509.Certificate, key *rsa.PrivateKey, err error)
GenerateSelfSignedCertificate generates a self-signed certificate, with CA flag set to true
func SignCSR ¶ added in v0.0.5
func SignCSR( caCert *x509.Certificate, caPrivKey *rsa.PrivateKey, userPublicKey rsa.PublicKey, csr *x509.CertificateRequest, serialNumber *big.Int, isIntermediateCA bool) (cert *x509.Certificate, err error)
SignCSR signs a certificate signing request
Types ¶
type CertKeyBundle ¶
type CertKeyBundle struct { Certificate *x509.Certificate PrivateKey *rsa.PrivateKey }
CertKeyBundle is a struct containing a certificate and its private key
func GenerateFakeCAAndCertificates ¶
func GenerateFakeCAAndCertificates(nCerts uint) ( caCert *x509.Certificate, caPrivKey *rsa.PrivateKey, certKeyBundle []CertKeyBundle, err error)
GenerateFakeCAAndCertificates generates a fake CA certificate and nCerts certificates signed by the CA
Click to show internal directories.
Click to hide internal directories.