github.com/status-im/status-go@v1.1.0/eth-node/types/keystore.go (about)

     1  package types
     2  
     3  import (
     4  	"crypto/ecdsa"
     5  
     6  	"github.com/status-im/status-go/extkeys"
     7  )
     8  
     9  type KeyStore interface {
    10  	// ImportAccount imports the account specified with privateKey.
    11  	ImportECDSA(priv *ecdsa.PrivateKey, passphrase string) (Account, error)
    12  	// ImportSingleExtendedKey imports an extended key setting it in both the PrivateKey and ExtendedKey fields
    13  	// of the Key struct.
    14  	// ImportExtendedKey is used in older version of Status where PrivateKey is set to be the BIP44 key at index 0,
    15  	// and ExtendedKey is the extended key of the BIP44 key at index 1.
    16  	ImportSingleExtendedKey(extKey *extkeys.ExtendedKey, passphrase string) (Account, error)
    17  	// ImportExtendedKeyForPurpose stores ECDSA key (obtained from extended key) along with CKD#2 (root for sub-accounts)
    18  	// If key file is not found, it is created. Key is encrypted with the given passphrase.
    19  	// Deprecated: status-go is now using ImportSingleExtendedKey
    20  	ImportExtendedKeyForPurpose(keyPurpose extkeys.KeyPurpose, extKey *extkeys.ExtendedKey, passphrase string) (Account, error)
    21  	// AccountDecryptedKey returns decrypted key for account (provided that password is correct).
    22  	AccountDecryptedKey(a Account, auth string) (Account, *Key, error)
    23  	// Delete deletes the key matched by account if the passphrase is correct.
    24  	// If the account contains no filename, the address must match a unique key.
    25  	Delete(a Account) error
    26  }