Documentation ¶
Index ¶
- func FromEncryptedJSON[E Encrypted, K any](identifier string, keyJSON []byte, password string, ...) (K, error)
- func RunKeyExportImportTestcase(t *testing.T, createKey CreateKeyFunc, decrypt DecryptFunc)
- func ToEncryptedJSON[E Encrypted, K any](identifier string, raw []byte, key K, password string, ...) (export []byte, err error)
- type CreateKeyFunc
- type DecryptFunc
- type Encrypted
- type EncryptedKeyExport
- type KeyType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromEncryptedJSON ¶
func FromEncryptedJSON[E Encrypted, K any]( identifier string, keyJSON []byte, password string, passwordFunc func(string) string, privKeyToKey func(export E, rawPrivKey []byte) (K, error), ) (K, error)
FromEncryptedJSON gets key [K] from keyJSON [E] and password
func RunKeyExportImportTestcase ¶
func RunKeyExportImportTestcase(t *testing.T, createKey CreateKeyFunc, decrypt DecryptFunc)
RunKeyExportImportTestcase executes a testcase to validate keys import/export functionality
func ToEncryptedJSON ¶
func ToEncryptedJSON[E Encrypted, K any]( identifier string, raw []byte, key K, password string, scryptParams utils.ScryptParams, passwordFunc func(string) string, buildExport func(id string, key K, cryptoJSON keystore.CryptoJSON) (E, error), ) (export []byte, err error)
ToEncryptedJSON returns encrypted JSON [E] representing key [K]
Types ¶
type CreateKeyFunc ¶
CreateKeyFunc represents a function to create a key
type DecryptFunc ¶
DecryptFunc represents a function to decrypt a key
type Encrypted ¶
type Encrypted interface {
GetCrypto() keystore.CryptoJSON
}
type EncryptedKeyExport ¶
type EncryptedKeyExport struct { KeyType string `json:"keyType"` PublicKey string `json:"publicKey"` Crypto keystore.CryptoJSON `json:"crypto"` }
EncryptedKeyExport represents a chain specific encrypted key
func (EncryptedKeyExport) GetCrypto ¶
func (x EncryptedKeyExport) GetCrypto() keystore.CryptoJSON
Click to show internal directories.
Click to hide internal directories.