Documentation ¶
Index ¶
- func GenerateCACertificate() (caConfig *x509.Certificate, ca []byte, caPrivateKey *rsa.PrivateKey, err error)
- func GenerateCertificate(caConfig *x509.Certificate, caPrivateKey *rsa.PrivateKey, altNames ...string) (certificate string, privateKey string, err error)
- func GetCertificatePEMEncoding(cert []byte) string
- func GetPEMEncoding(cert []byte, encodingType string) (pemEncodingString string)
- func GetPrivateKeyPEMEncoding(privateKey *rsa.PrivateKey) string
- type AuthConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCACertificate ¶
func GenerateCACertificate() (caConfig *x509.Certificate, ca []byte, caPrivateKey *rsa.PrivateKey, err error)
GenerateCACertificate generates a certificate authority and private key for the Threeport API.
func GenerateCertificate ¶
func GenerateCertificate( caConfig *x509.Certificate, caPrivateKey *rsa.PrivateKey, altNames ...string, ) (certificate string, privateKey string, err error)
GenerateCertificate generates a certificate and private key for the current Threeport instance.
func GetCertificatePEMEncoding ¶
GetCertificatePEMEncoding returns a PEM encoded string for a given certificate.
func GetPEMEncoding ¶
GetPEMEncoding returns a PEM encoded string for a given certificate or private key.
func GetPrivateKeyPEMEncoding ¶
func GetPrivateKeyPEMEncoding(privateKey *rsa.PrivateKey) string
GetPrivateKeyPEMEncoding returns a PEM encoded string for a given private key.
Types ¶
type AuthConfig ¶
type AuthConfig struct { CAConfig *x509.Certificate CAPrivateKey rsa.PrivateKey CA []byte CAPemEncoded string CABase64Encoded string CAPrivateKeyPemEncoded string CAPrivateKeyBase64Encoded string }
AuthConfig contains root CA and private key for generating client certificates.
func GetAuthConfig ¶
func GetAuthConfig() (*AuthConfig, error)
GetAuthConfig populates an AuthConfig object and returns a pointer to it.
Click to show internal directories.
Click to hide internal directories.