Documentation ¶
Index ¶
- func MustGenerateSelfSignedCert(decorators ...SelfSignedCertificateOption) tls.Certificate
- func MustGenerateSelfSignedCertPEMFormat(decorators ...SelfSignedCertificateOption) (cert []byte, key []byte)
- type SelfSignedCertificateOption
- 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(decorators ...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(decorators ...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.
Types ¶
type SelfSignedCertificateOption ¶
type SelfSignedCertificateOption func(selfSignedCertificateOptions) selfSignedCertificateOptions
func WithAlreadyExpired ¶
func WithAlreadyExpired() SelfSignedCertificateOption
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
func WithDNSNames ¶
func WithDNSNames(dnsNames ...string) SelfSignedCertificateOption
func WithIPAdresses ¶
func WithIPAdresses(ipAddresses ...string) SelfSignedCertificateOption
Click to show internal directories.
Click to hide internal directories.