Documentation ¶
Index ¶
- Variables
- func GetKeyKindFromBytes(publicKey, privateKey []byte) (crypto.PrivateKey, error)
- func KeyKindFromSignature(pubKey, message, sig []byte, keyKinds []string) (crypto.PublicKey, error)
- func PrivateKeyFromBytes(keyType string, data []byte) (crypto.PrivateKey, error)
- func PublicKeyFromBytes(keyType string, data []byte) (crypto.PublicKey, error)
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
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.