Versions in this module Expand all Collapse all v0 v0.9.0 May 1, 2021 Changes in this version + func NewCSR(key *PrivateKey, opts *CertOption) ([]byte, error) + func NewCert(pemcsr []byte, pemCA []byte, caKey *PrivateKey, opts *CertOption) ([]byte, error) + func NewRootCA(key *PrivateKey, opts *CertOption) ([]byte, error) + func ParseCSR(pemcsr []byte) (*x509.CertificateRequest, error) + func ParseCert(pemcert []byte) (*x509.Certificate, error) + type CertOption struct + func NewCertOptions() *CertOption + func (certopt *CertOption) CA(isCA bool) *CertOption + func (certopt *CertOption) CN(name string) *CertOption + func (certopt *CertOption) Country(name string) *CertOption + func (certopt *CertOption) Email(addrs ...string) *CertOption + func (certopt *CertOption) ExtKeyUsage(usage ...x509.ExtKeyUsage) *CertOption + func (certopt *CertOption) IPAddr(ipaddrs ...string) *CertOption + func (certopt *CertOption) KeyUsage(usage ...x509.KeyUsage) *CertOption + func (certopt *CertOption) Locality(name string) *CertOption + func (certopt *CertOption) NotAfter(timestamp time.Time) *CertOption + func (certopt *CertOption) NotBefore(timestamp time.Time) *CertOption + func (certopt *CertOption) Org(name string) *CertOption + func (certopt *CertOption) Orgunit(name string) *CertOption + func (certopt *CertOption) Postcode(name string) *CertOption + func (certopt *CertOption) SAN(domains ...string) *CertOption + func (certopt *CertOption) Street(name string) *CertOption + func (certopt *CertOption) URL(urls ...string) *CertOption + func (certopt *CertOption) ValidFor(period time.Duration) *CertOption + func (certopt *CertOption) Validate() (*CertOption, error) + type KeyAlgorithm int + const Ed25519 + const P224 + const Prime256v1 + const RSA2048 + const RSA4096 + const Secp384r1 + const Secp521r1 + func (algo KeyAlgorithm) IsEC() bool + func (algo KeyAlgorithm) IsEd25519() bool + func (algo KeyAlgorithm) IsRSA() bool + func (algo KeyAlgorithm) String() string + type PrivateKey struct + func NewPrivateKey(algo KeyAlgorithm) (*PrivateKey, error) + func ParsePrivateKey(pemkey []byte) (*PrivateKey, error) + func (privkey *PrivateKey) Algorithm() KeyAlgorithm + func (privkey *PrivateKey) EC() (*ecdsa.PrivateKey, error) + func (privkey *PrivateKey) Ed25519() (ed25519.PrivateKey, error) + func (privkey *PrivateKey) Encode() ([]byte, error) + func (privkey *PrivateKey) Public() (*PublicKey, error) + func (privkey *PrivateKey) RSA() (*rsa.PrivateKey, error) + type PublicKey struct + func (pubkey *PublicKey) Algorithm() KeyAlgorithm + func (pubkey *PublicKey) Encode() ([]byte, error)