Documentation ¶
Overview ¶
Package entity provides a lightweight method for generating certificates.
Index ¶
- func Template(cn string) *x509.Certificate
- func TemplateCA(cn string) *x509.Certificate
- type Entity
- func CreateSelfSigned(cn string, priv crypto.PrivateKey) (*Entity, error)
- func CreateSigned(cn string, priv crypto.PrivateKey, parent *Entity) (*Entity, error)
- func CreateSignedCA(cn string, priv crypto.PrivateKey, parent *Entity) (*Entity, error)
- func FromFile(certFile, privKeyFile string) (*Entity, error)
- func FromSigningRequest(csr *x509.CertificateRequest) (*Entity, error)
- func NewEntity(template *x509.Certificate, privateKey crypto.PrivateKey) (*Entity, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Template ¶
func Template(cn string) *x509.Certificate
Template returns a leaf x509 template with cn as common name.
func TemplateCA ¶
func TemplateCA(cn string) *x509.Certificate
TemplateCA returns a CA x509 template with cn as common name.
Types ¶
type Entity ¶
type Entity struct { Template *x509.Certificate PrivateKey crypto.PrivateKey PublicKey crypto.PublicKey Certificate *tls.Certificate }
Entity contains a certificate, associated template, public and private keys.
func CreateSelfSigned ¶
func CreateSelfSigned(cn string, priv crypto.PrivateKey) (*Entity, error)
CreateSelfSigned creates an Entity with a self signed certificate.
func CreateSigned ¶
CreateSigned creates an Entity with a certificate signed by parent.
func CreateSignedCA ¶
CreateSignedCA creates an Entity with a CA certificate signed by parent.
func FromSigningRequest ¶
func FromSigningRequest(csr *x509.CertificateRequest) (*Entity, error)
FromSigningRequest creates the boilerplate for a new certificate out of a Signing Request.
func NewEntity ¶
func NewEntity(template *x509.Certificate, privateKey crypto.PrivateKey) (*Entity, error)
NewEntity creates the boilerplate for a new certificate out of a template.
func (*Entity) SigningRequest ¶
SigningRequest generates a Certificate Signing Request out of the Entity.