Documentation
¶
Index ¶
- func MustGenerateSelfSignedCert(options ...selfSignedCertificateOption) tls.Certificate
- func MustGenerateSelfSignedCertPEMFormat(options ...selfSignedCertificateOption) (cert []byte, key []byte)
- func WithAlreadyExpired() selfSignedCertificateOption
- func WithCATrue() selfSignedCertificateOption
- func WithCommonName(commonName string) selfSignedCertificateOption
- func WithDNSNames(dnsNames ...string) selfSignedCertificateOption
- func WithIPAdresses(ipAddresses ...string) selfSignedCertificateOption
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.