ecdsautil

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyNotECDSA = errors.New("key is not ECDSA")

ErrKeyNotECDSA is the error returned when trying to decode a non ECDSA key

Functions

func DecodePrivateKey

func DecodePrivateKey(pemEncodedPrivate []byte) (*ecdsa.PrivateKey, error)

DecodePrivateKey decodes a PEM block of a DER encoded ecdsa private key

func DecodePublicKey

func DecodePublicKey(pemEncodedPublic []byte) (*ecdsa.PublicKey, error)

DecodePublicKey decodes a PEM block of a DER encoded ecdsa private key

func EncodeKey

func EncodeKey(privateKey *ecdsa.PrivateKey, publicKey *ecdsa.PublicKey) ([]byte, []byte, error)

EncodeKey encodes a given pair of ECDSA key to PEM blocks

func EncodePrivateKey

func EncodePrivateKey(privateKey *ecdsa.PrivateKey) ([]byte, error)

EncodePrivateKey encodes a given ECDSA private key to PEM block

func EncodePublicKey

func EncodePublicKey(publicKey *ecdsa.PublicKey) ([]byte, error)

EncodePublicKey encodes a given ECDSA public key to PEM block

func GenerateKeyPEM added in v0.0.3

func GenerateKeyPEM(c elliptic.Curve, seed io.Reader) ([]byte, []byte, error)

GenererateKeyBytes generates a key pair and returns the bytes for the private key and the public key. Private key and public key are returned as PEM encoded form.

Types

This section is empty.

Jump to

Keyboard shortcuts

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