util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: GPL-3.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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