// Path: src/main/java/org/adridadou/ethereum/values/EthAccount.java
// public class EthAccount {
//     private final BigInteger privateKey;
// 
//     public EthAccount(BigInteger privateKey) {
//         this.privateKey = privateKey;
//     }
// 
//     public EthAddress getAddress() {
//         Credentials credentials = Credentials.create(ECKeyPair.create(privateKey));
//         return EthAddress.of(credentials.getAddress());
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         EthAccount that = (EthAccount) o;
// 
//         return privateKey != null ? privateKey.equals(that.privateKey) : that.privateKey == null;
//     }
// 
//     @Override
//     public int hashCode() {
//         return privateKey != null ? privateKey.hashCode() : 0;
//     }
// 
//     @Override
//     public String toString() {
//         return "account address:" + getAddress().withLeading0x();
//     }
// 
//     public BigInteger getPrivateKey() {
//         return privateKey;
//     }
// }


import org.adridadou.ethereum.values.EthAccount;
import java.io.File;
package org.adridadou.ethereum.keystore;


/**
 * Created by davidroon on 26.07.16.
 * This code is released under Apache 2 license
 */
public class FileSecureKey implements SecureKey {
    private final File keyfile;

    public FileSecureKey(File keyfile) {
        this.keyfile = keyfile;
    }

// Path: src/main/java/org/adridadou/ethereum/values/EthAccount.java
// public class EthAccount {
//     private final BigInteger privateKey;
// 
//     public EthAccount(BigInteger privateKey) {
//         this.privateKey = privateKey;
//     }
// 
//     public EthAddress getAddress() {
//         Credentials credentials = Credentials.create(ECKeyPair.create(privateKey));
//         return EthAddress.of(credentials.getAddress());
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         EthAccount that = (EthAccount) o;
// 
//         return privateKey != null ? privateKey.equals(that.privateKey) : that.privateKey == null;
//     }
// 
//     @Override
//     public int hashCode() {
//         return privateKey != null ? privateKey.hashCode() : 0;
//     }
// 
//     @Override
//     public String toString() {
//         return "account address:" + getAddress().withLeading0x();
//     }
// 
//     public BigInteger getPrivateKey() {
//         return privateKey;
//     }
// }


// Path: src/main/java/org/adridadou/ethereum/keystore/FileSecureKey.java
import org.adridadou.ethereum.values.EthAccount;
import java.io.File;

package org.adridadou.ethereum.keystore;


/**
 * Created by davidroon on 26.07.16.
 * This code is released under Apache 2 license
 */
public class FileSecureKey implements SecureKey {
    private final File keyfile;

    public FileSecureKey(File keyfile) {
        this.keyfile = keyfile;
    }

    public EthAccount decode(final String password) throws Exception {