Documentation ¶
Index ¶
- Variables
- func CreateSelfSignedCertificate(key any, organizations []string, commonName string) (cert *x509.Certificate, err error)
- func CreateSelfSignedTLSCertificate(key any, organizations []string, commonName string) (*tls.Certificate, error)
- func LoadCertificateAndPool(certPool *x509.CertPool, certString, keyString string, ...) ([]tls.Certificate, *x509.CertPool, error)
- func LoadCertificates(certString, keyString string, certFile, keyFile string, certs ...any) ([]tls.Certificate, error)
- func LoadX509CertificatePool(certPool *x509.CertPool, certString string, certFile string, certs ...any) (*x509.CertPool, error)
- func LoadX509Certificates(certString, keyString string, certFile, keyFile string) ([]*x509.Certificate, error)
- func PEMBlockForKey(key any) (*pem.Block, error)
- func PublicKey(key any) any
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidCertificateConfiguration = errors.New("tls configuration is invalid")
ErrInvalidCertificateConfiguration is returned when an invalid TLS configuration was found.
var ErrNoCertificatesConfigured = errors.New("no tls configuration was found")
ErrNoCertificatesConfigured is returned when no TLS configuration was found.
var Versions = []int{ tls.VersionSSL30, tls.VersionTLS10, tls.VersionTLS11, tls.VersionTLS12, tls.VersionTLS13, }
Functions ¶
func CreateSelfSignedCertificate ¶
func CreateSelfSignedCertificate(key any, organizations []string, commonName string) (cert *x509.Certificate, err error)
CreateSelfSignedCertificate creates a self-signed x509 certificate. key is parsed by PublicKey()
func CreateSelfSignedTLSCertificate ¶
func CreateSelfSignedTLSCertificate(key any, organizations []string, commonName string) (*tls.Certificate, error)
CreateSelfSignedTLSCertificate creates a self-signed TLS certificate. key is parsed by PublicKey()
func LoadCertificateAndPool ¶
func LoadCertificates ¶
func LoadCertificates( certString, keyString string, certFile, keyFile string, certs ...any, ) ([]tls.Certificate, error)
LoadCertificates returns loads a TLS LoadCertificates. certString: Base64 encoded (without padding) string of the TLS certificate (PEM encoded) to be used for HTTP over TLS (HTTPS). Example: certString="-----BEGIN CERTIFICATE-----\nMIIDZTCCAk2gAwIBAgIEV5xOtDANBgkqhkiG9w0BAQ0FADA0MTIwMAYDVQQDDClP..." keyString: Base64 encoded (without padding) string of the private key (PEM encoded) to be used for HTTP over TLS (HTTPS). Example: keyString="-----BEGIN ENCRYPTED PRIVATE KEY-----\nMIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDg..." certPath: The path to the TLS certificate (pem encoded). Example: certPath=~/cert.pem keyPath: The path to the TLS private key (pem encoded). Example: keyPath=~/key.pem certs: certs of tls.Certificate, *tls.Certificate
func LoadX509CertificatePool ¶
func LoadX509CertificatePool( certPool *x509.CertPool, certString string, certFile string, certs ...any, ) (*x509.CertPool, error)
LoadX509CertificatePool returns loads a TLS x509.CertPool or update a TLS x509.CertPool if nil. certString: Base64 encoded (without padding) string of the TLS certificate (PEM encoded) to be used for HTTP over TLS (HTTPS). Example: certString="-----BEGIN CERTIFICATE-----\nMIIDZTCCAk2gAwIBAgIEV5xOtDANBgkqhkiG9w0BAQ0FADA0MTIwMAYDVQQDDClP..." certPath: The path to the TLS certificate (pem encoded). Example: certPath=~/cert.pem certs: certs of x509.Certificate, tls.Certificate, *x509.Certificate, *tls.Certificate
func LoadX509Certificates ¶
func LoadX509Certificates( certString, keyString string, certFile, keyFile string, ) ([]*x509.Certificate, error)
LoadX509Certificates returns loads a TLS LoadCertificates of x509.
func PEMBlockForKey ¶
PEMBlockForKey returns a PEM-encoded block for key. key is parsed by PublicKey()
Types ¶
This section is empty.