cert

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CertificateExpirationYear = 10 // year
)

Variables

This section is empty.

Functions

func CreateCertificateAuthority

func CreateCertificateAuthority(commonName, org, orgUnit, country string) (*x509.Certificate, crypto.PrivateKey, error)

func CreateCertificateAuthorityForConfig

func CreateCertificateAuthorityForConfig(conf *config.Config) (*x509.Certificate, crypto.PrivateKey, error)

func CreateCertificateRequest

func CreateCertificateRequest(subject pkix.Name, dnsName []string) ([]byte, *ecdsa.PrivateKey, error)

func CreateNewCertificateForClient

func CreateNewCertificateForClient(name pkix.Name, serial *big.Int, keyType string, keyBits int, password string, ca *config.CertificateAuthority) ([]byte, *x509.Certificate, error)

func GenerateMutualTLSCertificate added in v0.5.0

func GenerateMutualTLSCertificate(ca *x509.Certificate, caPrivateKey crypto.PrivateKey, dnsNames []string, ips []string) (*x509.Certificate, crypto.PrivateKey, error)

GenerateMutualTLSCertificate will generate a certificate and a private key for server and client auth.

func GenerateServerCertificate

func GenerateServerCertificate(ca *x509.Certificate, caPrivateKey crypto.PrivateKey, dnsNames []string) (*x509.Certificate, crypto.PrivateKey, error)

GenerateServerCertificate will generate a certificate and a private key for server auth. Generated private key is ecdsa 256-bit. The expiration of the certificate is 1 year.

func NewSerialNumber

func NewSerialNumber() (*big.Int, error)

func PemEncode

func PemEncode(path, typ string, b []byte, headers map[string]string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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