util

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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

func ValidateAndSanitizePEMBundle(data []byte) ([]byte, error)

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

func ValidateAndSplitPEMBundle(data []byte) ([][]byte, error)

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL