pem

package
v0.0.0-...-f839e32 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEnclosed = fmt.Errorf("public key must be enclosed in %s %s", beginPublicKeyPrefix, endPublicKeySuffix)
)

Functions

func CheckPublicKeyPEMFormat

func CheckPublicKeyPEMFormat(certStringOrBytes interface{}) error

CheckPublicKeyPEMFormat checks whether PEM format has any errors (properly formatted)

func EnsurePublicKeyPEMFormat

func EnsurePublicKeyPEMFormat(certStringOrBytes interface{}) []byte

EnsurePublicKeyPEMFormat ensures PK is wrapped into -----BEGIN PK ----- and -----END PK-----

func IsPublicKeyPEMFormat

func IsPublicKeyPEMFormat(certStringOrBytes interface{}) bool

IsPublicKeyPEMFormat checks whether data has correct PEM format This function is a convenience wrapper for CheckPublicKeyPEMFormat

func ParseRSAPublicKeyFromPEM

func ParseRSAPublicKeyFromPEM(pem []byte) (*rsa.PublicKey, error)

ParseRSAPublicKeyFromPEM parses PEM public key into struct

func TrimPublicKey

func TrimPublicKey(cert string) string

TrimPublicKey trims PEM prefix/suffix from Public Key

Types

This section is empty.

Jump to

Keyboard shortcuts

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