Documentation ¶
Overview ¶
Package nfpem provides convenience functions for dealing with PEM encoded x509 data.
Index ¶
- func DecodeAll(pemBytes []byte) []*pem.Block
- func EncodeToBytes(cert *x509.Certificate) []byte
- func EncodeToString(cert *x509.Certificate) string
- func FingerprintFromCertificate(cert *x509.Certificate) string
- func FingerprintFromPem(pem string) string
- func FingerprintFromPemBytes(pem []byte) string
- func FingerprintFromPemString(pem string) string
- func FingerprintFromX509(cert *x509.Certificate) string
- func PemBytesToCertificates(pem []byte) []*x509.Certificate
- func PemStringToCertificates(pem string) []*x509.Certificate
- func PemToX509(pem string) []*x509.Certificatedeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeAll ¶
DecodeAll accepts a byte array of PEM encoded data returns PEM blocks of data. The blocks will be in the order that they are provided in the original bytes.
func EncodeToBytes ¶ added in v0.17.5
func EncodeToBytes(cert *x509.Certificate) []byte
EncodeToBytes returns PEM encoded data in the form of a string generated from the supplied certificate.
func EncodeToString ¶ added in v0.11.11
func EncodeToString(cert *x509.Certificate) string
EncodeToString returns PEM encoded data in the form of a string generated from the supplied certificate.
func FingerprintFromCertificate ¶ added in v0.17.5
func FingerprintFromCertificate(cert *x509.Certificate) string
FingerprintFromCertificate returns the sha1 fingerprint of the supplied certificate
func FingerprintFromPem ¶ added in v0.11.11
FingerprintFromPem returns the fingerprint of the first certificate encountered in a pem string Deprecated: Use FingerprintFromPemString or FingerprintFromPemBytes
func FingerprintFromPemBytes ¶ added in v0.17.5
FingerprintFromPemBytes returns the sha1 fingerprint of the first parsable certificate in a pem string
func FingerprintFromPemString ¶ added in v0.17.5
FingerprintFromPemString returns the sha1 fingerprint of the first parsable certificate in a pem string
func FingerprintFromX509 ¶ added in v0.11.11
func FingerprintFromX509(cert *x509.Certificate) string
FingerprintFromX509 returns the sha1 fingerprint of the supplied certificate Deprecated: Use FingerprintFromCertificate
func PemBytesToCertificates ¶ added in v0.17.5
func PemBytesToCertificates(pem []byte) []*x509.Certificate
PemBytesToCertificates accepts PEM bytes and returns an array of x509.Certificate. Any blocks that cannot be parsed as a x509.Certificate is discard. Certificate are returned to the order they are encountered in the PEM string.
func PemStringToCertificates ¶ added in v0.17.5
func PemStringToCertificates(pem string) []*x509.Certificate
PemStringToCertificates accepts a PEM string and returns an array of x509.Certificate. Any blocks that cannot be parsed as certificates are discard. Certificate are returned to the order they are encountered in the PEM string.
func PemToX509
deprecated
func PemToX509(pem string) []*x509.Certificate
PemToX509 accepts a PEM string and returns an array of x509.Certificate. Any blocks that cannot be parsed as certificates are discard. Certificate are returned to the order they are encountered in the PEM string.
Deprecated: Use PemStringToCertificates
Types ¶
This section is empty.