nfpem

package
v2.0.48 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 14

Documentation

Overview

Package nfpem provides convenience functions for dealing with PEM encoded x509 data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeAll

func DecodeAll(pemBytes []byte) []*pem.Block

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

func FingerprintFromPem(pem string) string

FingerprintFromPem returns the fingerprint of the first certificate encountered in a pem string Deprecated: Use FingerprintFromPemString or FingerprintFromPemBytes

func FingerprintFromPemBytes

func FingerprintFromPemBytes(pem []byte) string

FingerprintFromPemBytes returns the sha1 fingerprint of the first parsable certificate in a pem string

func FingerprintFromPemString

func FingerprintFromPemString(pem string) string

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.

Jump to

Keyboard shortcuts

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