pem

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedPEM = errors.New("unsupported encrypted PEM")

Functions

func Decode

func Decode(filename, password string) (cert, privateKey []byte, err error)

func DecryptPKCS8PrivateKey

func DecryptPKCS8PrivateKey(data, password []byte) ([]byte, error)

DecryptPKCS8PrivateKey

func ValidateBlocks

func ValidateBlocks(filename string) (isEncrypted bool, err error)

Types

type BlockType

type BlockType string
const (
	CertificateBlock         BlockType = "CERTIFICATE"
	RSAPrivateKeyBlock       BlockType = "RSA PRIVATE KEY"
	EncryptedPrivateKeyBlock BlockType = "ENCRYPTED PRIVATE KEY"
)

type DecoderValidator

type DecoderValidator interface {
	Decode(filename, password string) (cert, privateKey []byte, err error)
	ValidateBlocks(filename string) (isEncrypted bool, err error)
}

func Default

func Default() DecoderValidator

Jump to

Keyboard shortcuts

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