certificates

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSelfSignedCA

func CreateSelfSignedCA(certInfo CertificateInfo) (*x509.Certificate, *rsa.PrivateKey, error)

func CreateServerCertificate

func CreateServerCertificate(caCert *x509.Certificate, caPrivateKey *rsa.PrivateKey, certInfo CertificateInfo) (*x509.Certificate, *rsa.PrivateKey, error)

func NewCertificateTemplate

func NewCertificateTemplate(caCert bool, certInfo CertificateInfo) *x509.Certificate

func ReadCertificate

func ReadCertificate(filepath string) (*x509.Certificate, error)

func ReadPrivateKey

func ReadPrivateKey(filepath string) (*rsa.PrivateKey, error)

func WriteCertificate

func WriteCertificate(filepath string, cert *x509.Certificate) error

func WriteKey

func WriteKey(filepath string, key *rsa.PrivateKey) error

Types

type CertificateInfo

type CertificateInfo struct {
	Organization  string `yaml:"organization"`
	Country       string `yaml:"country"`
	Province      string `yaml:"province"`
	Locality      string `yaml:"locality"`
	StreetAddress string `yaml:"street-address"`
	PostalCode    string `yaml:"postal-code"`
	Validity      int    `yaml:"ttl"`
	DNS           []string
}

Jump to

Keyboard shortcuts

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