engine

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package engine provides a simplified interface to certificate generation provided by the standard package crypto/*

Currently this package supports generation of certificates suitable for use in securing a web application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateResponse

type CertificateResponse struct {
	CertificatePem          string `json:"crt_file" xml:",cdata"`
	CertificateKey          string `json:"key_file" xml:",cdata"`
	CertificateAuthorityPem string `json:"registry_ca" xml:",cdata"`
}

CertificateResponse is the result of a certificate generation request.

func (*CertificateResponse) WritePlain

func (c *CertificateResponse) WritePlain(w io.Writer) (err error)

WritePlain exports the cert, key, and CA as text to the writer.

type Context

type Context struct {
	CertificateAuthority           *x509.Certificate
	CertificateAuthorityPrivateKey *rsa.PrivateKey
	PrivateKeyBitLength            int
	Development                    bool
	ListenAddress                  string
	DebugListenAddress             string
	KeyServer                      *kserver.GoKeyServer
}

Context contains the attributes that are used to generate certificates.

func (*Context) GenerateCertificate

func (t *Context) GenerateCertificate(domain string, client bool) (response *CertificateResponse, err error)

GenerateCertificate uses the certificate authority and private key to generate a certificate for the provided domain. The wildcard and short domain name are also added as subject alternative names.

func (*Context) LoadCertificates

func (t *Context) LoadCertificates(pubfile string, privfile string) error

LoadCertificates reads the public and private keys for the certificate authority into the context.

Jump to

Keyboard shortcuts

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