multikey

package
v0.0.0-...-72bc2f9 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 9 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 DescriptiveBytesFromPrivateKey

func DescriptiveBytesFromPrivateKey(in crypto.PrivateKey) ([]byte, error)

func DescriptiveBytesFromPublicKey

func DescriptiveBytesFromPublicKey(in crypto.PublicKey) ([]byte, error)

func DescriptivePublicKeyFromBytes

func DescriptivePublicKeyFromBytes(in []byte) (crypto.PublicKey, error)

func DescriptivePublicKeyFromEncodedString

func DescriptivePublicKeyFromEncodedString(in string, encodedWith string) (crypto.PublicKey, error)

func GetKeyKindFromBytes

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 IDFromPrivateKey

func IDFromPrivateKey(key crypto.PrivateKey) (byte, error)

func IDFromPublicKey

func IDFromPublicKey(key crypto.PublicKey) (byte, error)

func KindFromPrivateKey

func KindFromPrivateKey(key crypto.PrivateKey) (string, error)

func KindFromPublicKey

func KindFromPublicKey(key crypto.PublicKey) (string, error)

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

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