certificate

package
v1.4.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustGenerateSelfSignedCert

func MustGenerateSelfSignedCert(options ...selfSignedCertificateOption) tls.Certificate

MustGenerateSelfSignedCert generates a tls.Certificate struct to be used in TLS client/listener configurations. Certificate is self-signed thus returned cert can be used as CA for it.

func MustGenerateSelfSignedCertPEMFormat

func MustGenerateSelfSignedCertPEMFormat(options ...selfSignedCertificateOption) (cert []byte, key []byte)

MustGenerateSelfSignedCertPEMFormat generates self-signed certificate and returns certificate and key in PEM format. Certificate is self-signed thus returned cert can be used as CA for it.

func WithAlreadyExpired

func WithAlreadyExpired() selfSignedCertificateOption

WithAlreadyExpired sets the certificate to be already expired.

func WithCATrue

func WithCATrue() selfSignedCertificateOption

WithCATrue allows to use returned certificate to sign other certificates (uses BasicConstraints extension).

func WithCommonName

func WithCommonName(commonName string) selfSignedCertificateOption

WithCommonName sets the CommonName field of the certificate.

func WithDNSNames

func WithDNSNames(dnsNames ...string) selfSignedCertificateOption

WithDNSNames sets DNS names for the certificate.

func WithIPAdresses

func WithIPAdresses(ipAddresses ...string) selfSignedCertificateOption

WithIPAdresses sets IP addresses for the certificate.

Types

This section is empty.

Jump to

Keyboard shortcuts

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