nfpem

package
v0.17.18 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

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 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

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 added in v0.17.5

func FingerprintFromPemBytes(pem []byte) string

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

func FingerprintFromPemString added in v0.17.5

func FingerprintFromPemString(pem string) string

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.

Jump to

Keyboard shortcuts

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