cert

package
v2.0.35 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 18 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OIDASN1EmailAddress = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1} //unstructuredName https://oidref.com/1.2.840.113549.1.9.1
View Source
var OIDASN1UnstructuredName = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 2} //unstructuredName https://oidref.com/1.2.840.113549.1.9.2

Functions

func CreateCA added in v2.0.9

func CreateCA(subject pkix.Name, duration time.Duration) ([]byte, []byte, error)

func CreateClient added in v2.0.9

func CreateClient(caPEM, caPrivKeyPEM []byte, certName pkix.Name, duration time.Duration) ([]byte, []byte, error)

func CreateServer added in v2.0.9

func CreateServer(caPEM, caPrivKeyPEM []byte, certName pkix.Name, ips []net.IP, dnsNames []string, duration time.Duration) ([]byte, []byte, error)

func DefaultCertificate

func DefaultCertificate() (*tls.Certificate, error)

DefaultCertificate generates random TLS certificates.

func KeyPair

func KeyPair(domain string, expiration time.Time) ([]byte, []byte, error)

KeyPair generates cert and Key files.

func NewASN1EmailAddress added in v2.0.9

func NewASN1EmailAddress(val string) pkix.AttributeTypeAndValue

func NewASN1UnstructuredName added in v2.0.9

func NewASN1UnstructuredName(val string) pkix.AttributeTypeAndValue

func PemCert

func PemCert(privKey *rsa.PrivateKey, domain string, expiration time.Time) ([]byte, error)

PemCert generates PEM cert file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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