ca

package
v0.0.0-...-eff5e3f Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateAuthority

type CertificateAuthority struct {
	// The internal certificate chains used in this CA, mostly used for client-side verification.
	Chains []*Chain
	// contains filtered or unexported fields
}

A Gravel certificate authority.

func (*CertificateAuthority) CompleteOrder

func (ca *CertificateAuthority) CompleteOrder(order *core.Order)

func (*CertificateAuthority) GetIntermediateCert

func (ca *CertificateAuthority) GetIntermediateCert(no int) *core.Certificate

func (*CertificateAuthority) GetIntermediateKey

func (ca *CertificateAuthority) GetIntermediateKey(no int) *rsa.PrivateKey

func (*CertificateAuthority) GetNumberOfRootCerts

func (ca *CertificateAuthority) GetNumberOfRootCerts() int

func (*CertificateAuthority) GetRootCert

func (ca *CertificateAuthority) GetRootCert(no int) *core.Certificate

func (*CertificateAuthority) GetRootKey

func (ca *CertificateAuthority) GetRootKey(no int) *rsa.PrivateKey

type CertificateAuthorityOpts

type CertificateAuthorityOpts struct {
	OcspResponderUrl string
	AlternateRoots   int

	// Logger
	Logger *logrus.Logger
}

Options used to configure the certificate authority.

func NewDefaultCertificateAuthorityOpts

func NewDefaultCertificateAuthorityOpts() *CertificateAuthorityOpts

type Chain

type Chain struct {
	Root         *Issuer
	Intermediate *Issuer
}

type GravelCertificateChain

type GravelCertificateChain struct {
	RootCertificatePublicKey  []byte
	RootCertificatePrivateKey []byte
	// contains filtered or unexported fields
}

A root certificate that can be used for testing purposes.

func GenerateGravelRootCertificateChain

func GenerateGravelRootCertificateChain() (*GravelCertificateChain, error)

Generates an on-demand root certificate.

func (*GravelCertificateChain) GenerateCertificate

func (gcc *GravelCertificateChain) GenerateCertificate() ([]byte, []byte, error)

Generate a certificate from the root CA. Returns the public key, the private key, and an error.

type ICertificateAuthority

type ICertificateAuthority interface {
	CompleteOrder(order *core.Order)
	GetNumberOfRootCerts() int
	GetRootCert(no int) *core.Certificate
	GetRootKey(no int) *rsa.PrivateKey
	GetIntermediateCert(no int) *core.Certificate
	GetIntermediateKey(no int) *rsa.PrivateKey
}

type Issuer

type Issuer struct {
	Key  crypto.Signer
	Cert *core.Certificate
}

Jump to

Keyboard shortcuts

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