Help us shape the future of Go! Take the 2026 Go Developer Survey

crypto

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

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