certificates

package
v0.0.0-...-2921379 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCertificate

func GenerateCertificate(subject pkix.Name) (cert *x509.Certificate, certRaw []byte, key *rsa.PrivateKey, keyRaw []byte, err error)

GenerateCertificate takes care of generating a new CA certificate

func LoadOrGenerate

func LoadOrGenerate(ctx context.Context, q *db.Queries, id string, subject pkix.Name) (cert *x509.Certificate, key *rsa.PrivateKey, err error)

LoadOrGenerate retrieves a certificate by id and if it is not found generates a new one

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service handles certificate generation, retrieval and signing on behalf of the rest of the server.

func New

func New(q *db.Queries) (s *Service, err error)

New initialises a new certificate service

func (*Service) AuthenticationKey

func (s *Service) AuthenticationKey() *rsa.PrivateKey

AuthenticationKey returns the private key used for authentication

func (*Service) IdentitySignCSR

func (s *Service) IdentitySignCSR(csr *x509.CertificateRequest, subject pkix.Name) (*x509.Certificate, *x509.Certificate, []byte, error)

IdentitySignCSR will sign a csr with the Identity certificate

func (*Service) IsIssuerIdentity

func (s *Service) IsIssuerIdentity(cert *x509.Certificate) error

IsIssuerIdentity verifies if the certificate was issued by the Identity certificate

Jump to

Keyboard shortcuts

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