util

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRsaPubKeyConversion = errors.New("Unable to convert public key to RSA public key")

ErrRsaPubKeyConversion indicates a public key could not be converted to an RSA public key

View Source
var ErrWrongPrivateKey = errors.New("failed to decode PEM block containing private key")

ErrWrongPrivateKey indicates a wrong private key format

View Source
var ErrWrongPublicKey = errors.New("failed to decode PEM block containing public key, key is of the wrong type")

ErrWrongPublicKey indicates a wrong public key format

Functions

func PemToPrivateKey

func PemToPrivateKey(bytes []byte) (signer crypto.Signer, err error)

PemToPrivateKey converts a PEM encoded private key to a Signer interface. It supports EC, RSA and PKIX PEM encoded strings

func PemToPublicKey

func PemToPublicKey(pub []byte) (crypto.PublicKey, error)

PemToPublicKey converts a PEM encoded public key to a crypto.PublicKey

func PrivateKeyToPem

func PrivateKeyToPem(pub crypto.PrivateKey) (string, error)

PrivateKeyToPem converts an public key to PEM encoding

func PublicKeyToPem

func PublicKeyToPem(pub crypto.PublicKey) (string, error)

PublicKeyToPem converts an public key to PEM encoding

Types

This section is empty.

Jump to

Keyboard shortcuts

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