web3-0.8.4.0: Ethereum API for Haskell

CopyrightAlexander Krupenkin 2018
LicenseBSD3
Maintainermail@akru.me
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Crypto.Ethereum.Keyfile

Contents

Description

Synopsis

Encrypted Ethereum private key

data EncryptedKey Source #

Secret Storage representation on memory.

Constructors

EncryptedKey 

Fields

data Cipher Source #

Cipher parameters.

Constructors

Aes128Ctr 

data Kdf Source #

Key derivation function parameters and salt.

Secret storage packers

decrypt :: (ByteArrayAccess password, ByteArray privateKey) => EncryptedKey -> password -> Maybe privateKey Source #

Decrypt Ethereum private key.

Typically Web3 Secret Storage is JSON-encoded. EncryptedKey data type has FromJSON instance to helps decode it from JSON-encoded string or file.

  let decryptJSON pass = flip decrypt pass <=< decode

encrypt :: (ByteArray privateKey, ByteArrayAccess password, MonadRandom m) => privateKey -> password -> m EncryptedKey Source #

Encrypt Ethereum private key.

  let encryptJSON pass key = encode $ encrypt key pass