Documentation ¶
Index ¶
- func DecodeX509CertificateChainBytes(certBytes []byte) ([]*x509.Certificate, error)
- func ValidateAndSanitizePEMBundle(data []byte) ([]byte, error)
- func ValidateAndSanitizePEMBundleWithOptions(data []byte, opts ValidateAndSanitizeOptions) ([]byte, error)
- func ValidateAndSplitPEMBundle(data []byte) ([][]byte, error)
- func ValidateAndSplitPEMBundleWithOptions(data []byte, opts ValidateAndSanitizeOptions) ([][]byte, error)
- type ValidateAndSanitizeOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeX509CertificateChainBytes ¶ added in v0.7.0
func DecodeX509CertificateChainBytes(certBytes []byte) ([]*x509.Certificate, error)
DecodeX509CertificateChainBytes will decode a PEM encoded x509 Certificate chain.
func ValidateAndSanitizePEMBundle ¶
ValidateAndSanitizePEMBundle keeps the original function signature for backward compatibility
func ValidateAndSanitizePEMBundleWithOptions ¶ added in v0.8.0
func ValidateAndSanitizePEMBundleWithOptions(data []byte, opts ValidateAndSanitizeOptions) ([]byte, error)
See also https://github.com/golang/go/blob/5d5ed57b134b7a02259ff070864f753c9e601a18/src/crypto/x509/cert_pool.go#L201-L239 An option to enable filtering of expired certificates is available.
func ValidateAndSplitPEMBundle ¶ added in v0.5.0
ValidateAndSplitPEMBundle keeps the original function signature for backward compatibility
func ValidateAndSplitPEMBundleWithOptions ¶ added in v0.8.0
func ValidateAndSplitPEMBundleWithOptions(data []byte, opts ValidateAndSanitizeOptions) ([][]byte, error)
ValidateAndSplitPEMBundleWithOptions takes a PEM bundle as input, validates it and returns the list of certificates as a slice, allowing them to be iterated over. This process involves performs deduplication of certificates to ensure no duplicated certificates in the bundle. For details of the validation performed, see the comment for ValidateAndSanitizePEMBundle An option to enable filtering of expired certificates is available.
Types ¶
type ValidateAndSanitizeOptions ¶ added in v0.8.0
type ValidateAndSanitizeOptions struct {
FilterExpired bool // If true, expired certificates will be filtered out
}