multikey

package
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInconclusive is returned when multiple public keys matches for the same input.
	ErrInconclusive = errors.New("multiple matches found")

	// ErrNoMatch is returned when no public key matches for the input.
	ErrNoMatch = errors.New("no match found")
)

Functions

func GetKeyKindFromBytes added in v0.0.43

func GetKeyKindFromBytes(publicKey, privateKey []byte) (crypto.PrivateKey, error)

GetKeyKindFromBytes extracts the private key type from the publicKey and privateKey. Supported private key types are defined in PossibleKeyKinds variable.

func KeyKindFromSignature added in v0.0.38

func KeyKindFromSignature(pubKey, message, sig []byte, keyKinds []string) (crypto.PublicKey, error)

KeyKindsFromSignature tries to determine the key type from the pubKey, message, sig bytes combination. The key kinds against which the function should match are specified in the keyKinds slice.

func PrivateKeyFromBytes

func PrivateKeyFromBytes(keyType string, data []byte) (crypto.PrivateKey, error)

PrivateKeyFromBytes returns a private key from `[]byte`.

The function used to create the private key is based on the key type. Supported key types are secp256k1, ed25519.

func PublicKeyFromBytes added in v0.0.38

func PublicKeyFromBytes(keyType string, data []byte) (crypto.PublicKey, error)

PublicKeyFromBytes use the correct function to get the private key from bytes

Types

This section is empty.

Jump to

Keyboard shortcuts

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