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 (*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
Click to show internal directories.
Click to hide internal directories.