keyManager

package
v0.0.0-...-32f009b Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: MIT Imports: 21 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyManager

type KeyManager struct {
	Api *api.API
	// contains filtered or unexported fields
}

func CreateFromKeyStore

func CreateFromKeyStore(ks ks.Store) *KeyManager

Create new key manager from key store

func OpenWithMnemonic

func OpenWithMnemonic(encryptedAccount Store, mnemonic string) (*KeyManager, error)

Open account with mnemonic. This should only be used as a backup

func OpenWithPassword

func OpenWithPassword(store Store, pw string) (*KeyManager, error)

Open encrypted keystore with password

func (KeyManager) AESDecrypt

func (km KeyManager) AESDecrypt(cipherText aes.CipherText) (aes.PlainText, error)

decrypt a value with AES

func (KeyManager) AESEncrypt

func (km KeyManager) AESEncrypt(plainText aes.PlainText) (aes.CipherText, error)

encrypt a value with aes

func (KeyManager) ChatIdKeyPair

func (km KeyManager) ChatIdKeyPair() (x3dh.KeyPair, error)

func (KeyManager) EthereumSign

func (km KeyManager) EthereumSign(data [32]byte) ([]byte, error)

Sign data with ethereum private key

func (KeyManager) Export

func (km KeyManager) Export(pw, pwConfirm string) (Store, error)

Export the account

func (KeyManager) GetEthereumAddress

func (km KeyManager) GetEthereumAddress() (string, error)

Get ethereum address

func (KeyManager) GetEthereumPrivateKey

func (km KeyManager) GetEthereumPrivateKey() (string, error)

Get ethereum private key

func (KeyManager) GetEthereumPublicKey

func (km KeyManager) GetEthereumPublicKey() (string, error)

func (KeyManager) GetMnemonic

func (km KeyManager) GetMnemonic() mnemonic.Mnemonic

func (KeyManager) IdentityPrivateKey

func (km KeyManager) IdentityPrivateKey() (string, error)

func (KeyManager) IdentityPublicKey

func (km KeyManager) IdentityPublicKey() (string, error)

func (KeyManager) IdentitySign

func (km KeyManager) IdentitySign(data []byte) ([]byte, error)

Sign data with identity key

func (KeyManager) MeshPrivateKey

func (km KeyManager) MeshPrivateKey() (lp2pCrypto.PrivKey, error)

Get the Mesh network private key (which is the identity ed25519 private key)

func (KeyManager) SignEthTx

func (km KeyManager) SignEthTx(signer types.Signer, addresses common.Address, tx *types.Transaction) (*types.Transaction, error)

func (KeyManager) WasMigrated

func (km KeyManager) WasMigrated() bool

Did the keystore change (happen after migration)

type Store

type Store struct {
	// the password is encrypted with the mnemonic
	Password          scrypt.CipherText `json:"password"`
	EncryptedKeyStore scrypt.CipherText `json:"encrypted_key_store"`
	Version           uint8             `json:"version"`
}

func UnmarshalStore

func UnmarshalStore(data []byte) (Store, error)

func (Store) Marshal

func (s Store) Marshal() ([]byte, error)

marshal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL