Documentation ¶
Index ¶
- Constants
- func MergeCertificateChain(certBundlePath string, originalCerts []*x509.Certificate) ([]*x509.Certificate, error)
- func ParseCertificates(data []byte, contentType string) (certs []*x509.Certificate, err error)
- func ValidateCertificateChain(certs []*x509.Certificate) ([]*x509.Certificate, error)
Constants ¶
View Source
const ( // CertSecretKey defines the pluginConfig key name for triggering // GetSecret (Get secret permission is required) operation to // fetch the certificate chain instead of GetCertificate operation. // // To enable the feature, the value of the key should be "true". CertSecretKey = "as_secret" // CertBundleKey defines the pluginConfig key name for the path of // a certificate bundle file passing through pluginConfig CertBundleKey = "ca_certs" )
Variables ¶
This section is empty.
Functions ¶
func MergeCertificateChain ¶
func MergeCertificateChain(certBundlePath string, originalCerts []*x509.Certificate) ([]*x509.Certificate, error)
MergeCertificateChain is a function that takes in a plugin configuration map and a slice of x509 certificate instances, and attempts to merge the certificate chain of the original certificates with a certificate bundle specified in the plugin configuration.
func ParseCertificates ¶
func ParseCertificates(data []byte, contentType string) (certs []*x509.Certificate, err error)
ParseCertificates parses certificates from either PEM or PKCS12 data. It returns an empty list if no certificates are found. Parsing will skip private key.
func ValidateCertificateChain ¶
func ValidateCertificateChain(certs []*x509.Certificate) ([]*x509.Certificate, error)
ValidateCertificateChain verifies a certificate chain and returns the valid chain coupled with any error that may occur.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.