Documentation ¶
Overview ¶
Package pki provides PKI all the PKI functions necessary to run micro over an untrusted network including a CA
Index ¶
- func CA(opts ...CertOption) ([]byte, []byte, error)
- func CSR(opts ...CertOption) ([]byte, error)
- func GenerateKey() (ed25519.PublicKey, ed25519.PrivateKey, error)
- func Sign(CACrt, CAKey, CSR []byte, opts ...CertOption) ([]byte, error)
- type CertOption
- func DNSNames(names ...string) CertOption
- func IPAddresses(ips ...net.IP) CertOption
- func IsCA() CertOption
- func KeyPair(pub ed25519.PublicKey, priv ed25519.PrivateKey) CertOption
- func NotAfter(time time.Time) CertOption
- func NotBefore(time time.Time) CertOption
- func SerialNumber(serial *big.Int) CertOption
- func Subject(subject pkix.Name) CertOption
- type CertOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CA ¶
func CA(opts ...CertOption) ([]byte, []byte, error)
CA generates a self signed CA and returns cert, key in PEM format
func CSR ¶
func CSR(opts ...CertOption) ([]byte, error)
CSR generates a certificate request in PEM format
func GenerateKey ¶
func GenerateKey() (ed25519.PublicKey, ed25519.PrivateKey, error)
GenerateKey returns an ed25519 key
Types ¶
type CertOption ¶
type CertOption func(c *CertOptions)
CertOption sets CertOptions
func DNSNames ¶
func DNSNames(names ...string) CertOption
DNSNames is a list of hosts to sign in to the certificate
func IPAddresses ¶
func IPAddresses(ips ...net.IP) CertOption
IPAddresses is a list of IPs to sign in to the certificate
func KeyPair ¶
func KeyPair(pub ed25519.PublicKey, priv ed25519.PrivateKey) CertOption
KeyPair is the key pair to sign the certificate with
func NotAfter ¶
func NotAfter(time time.Time) CertOption
NotAfter is the time the certificate is not valid after
func NotBefore ¶
func NotBefore(time time.Time) CertOption
NotBefore is the time the certificate is not valid before
func SerialNumber ¶
func SerialNumber(serial *big.Int) CertOption
SerialNumber is the Certificate Serial number
Click to show internal directories.
Click to hide internal directories.