rsagen

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

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