Documentation ¶
Index ¶
- Variables
- func CreateSelfSignedCertificate(key interface{}, organizations []string, commonName string) (cert *x509.Certificate, err error)
- func CreateSelfSignedTLSCertificate(key interface{}, organizations []string, commonName string) (*tls.Certificate, error)
- func LoadCertificate(certString, keyString string, certPath, keyPath string) ([]tls.Certificate, error)
- func PEMBlockForKey(key interface{}) (*pem.Block, error)
- func PublicKey(key interface{}) interface{}
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidCertificateConfiguration = errors.New("tls configuration is invalid")
ErrInvalidCertificateConfiguration is returned when an invaloid TLS configuration was found.
var ErrNoCertificatesConfigured = errors.New("no tls configuration was found")
ErrNoCertificatesConfigured is returned when no TLS configuration was found.
Functions ¶
func CreateSelfSignedCertificate ¶
func CreateSelfSignedCertificate(key interface{}, 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 interface{}, organizations []string, commonName string) (*tls.Certificate, error)
CreateSelfSignedTLSCertificate creates a self-signed TLS certificate. key is parsed by PublicKey()
func LoadCertificate ¶
func LoadCertificate( certString, keyString string, certPath, keyPath string, ) ([]tls.Certificate, error)
LoadCertificate returns loads a TLS LoadCertificate by looking at environment variables. 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
func PEMBlockForKey ¶
PEMBlockForKey returns a PEM-encoded block for key. key is parsed by PublicKey()
Types ¶
This section is empty.