Documentation
¶
Index ¶
- Variables
- func DescriptiveBytesFromPrivateKey(in crypto.PrivateKey) ([]byte, error)
- func DescriptiveBytesFromPublicKey(in crypto.PublicKey) ([]byte, error)
- func DescriptivePublicKeyFromBytes(in []byte) (crypto.PublicKey, error)
- func DescriptivePublicKeyFromEncodedString(in string, encodedWith string) (crypto.PublicKey, error)
- func GetKeyKindFromBytes(publicKey, privateKey []byte) (crypto.PrivateKey, error)
- func IDFromPrivateKey(key crypto.PrivateKey) (byte, error)
- func IDFromPublicKey(key crypto.PublicKey) (byte, error)
- func KindFromPrivateKey(key crypto.PrivateKey) (string, error)
- func KindFromPublicKey(key crypto.PublicKey) (string, 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 ¶
GetKeyKindFromBytes extracts the private key type from the publicKey and privateKey. Supported private key types are defined in PossibleKeyKinds variable.
func IDFromPrivateKey ¶
func IDFromPublicKey ¶
func KindFromPrivateKey ¶
func KindFromPublicKey ¶
func PrivateKeyFromBytes ¶
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 ¶
PublicKeyFromBytes use the correct function to get the private key from bytes
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.