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 ¶
func EncodeToBytes(cert *x509.Certificate) []byte
EncodeToBytes returns PEM encoded data in the form of a string generated from the supplied certificate.
func EncodeToString ¶
func EncodeToString(cert *x509.Certificate) string
EncodeToString returns PEM encoded data in the form of a string generated from the supplied certificate.
func FingerprintFromCertificate ¶
func FingerprintFromCertificate(cert *x509.Certificate) string
FingerprintFromCertificate returns the sha1 fingerprint of the supplied certificate
func FingerprintFromPem ¶
FingerprintFromPem returns the fingerprint of the first certificate encountered in a pem string Deprecated: Use FingerprintFromPemString or FingerprintFromPemBytes
func FingerprintFromPemBytes ¶
FingerprintFromPemBytes returns the sha1 fingerprint of the first parsable certificate in a pem string
func FingerprintFromPemString ¶
FingerprintFromPemString returns the sha1 fingerprint of the first parsable certificate in a pem string
func FingerprintFromX509 ¶
func FingerprintFromX509(cert *x509.Certificate) string
FingerprintFromX509 returns the sha1 fingerprint of the supplied certificate Deprecated: Use FingerprintFromCertificate
func PemBytesToCertificates ¶
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 ¶
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.