Package com.h2tcoin.takamakachain.wallet
Class WalletHelper
- java.lang.Object
-
- com.h2tcoin.takamakachain.wallet.WalletHelper
-
public class WalletHelper extends Object
- Author:
- francesco.pasetto@takamaka.io
-
-
Constructor Summary
Constructors Constructor Description WalletHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getRecoveryWords(String filename, String password)
static Path
importKeyFromWords(List<String> words, Path path, String filename, KeyContexts.WalletCypher cypher, String newPassword)
Spawns a refurbished walletstatic Map<String,PublicKeyBean>
listPublicKeys()
static KeyBean
readKeyFile(Path filename, String password)
wallet cypher - it returns the words list needed for wallet recovery procedurestatic PublicKeyBean
readPublicKey(String publicKeyName)
static InstanceWalletKeystoreInterface
readWallet(String filename, String password)
static InstanceWalletKeystoreInterface
readWalletRecoveryGui(String filename, String password)
static boolean
verifyWordsIntegrity(List<String> words)
static Path
writeKeyFile(Path path, String filename, KeyBean key, String password)
static void
writePublicKey(String walletname, String password, int keyIndex, KeyContexts.WalletCypher cypher)
-
-
-
Method Detail
-
readWallet
public static InstanceWalletKeystoreInterface readWallet(String filename, String password) throws InvalidCypherException, FileNotFoundException, NoSuchProviderException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, UnlockWalletException
-
readWalletRecoveryGui
public static InstanceWalletKeystoreInterface readWalletRecoveryGui(String filename, String password) throws InvalidCypherException, FileNotFoundException, NoSuchProviderException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, UnlockWalletException
-
getRecoveryWords
public static String getRecoveryWords(String filename, String password) throws InvalidCypherException, FileNotFoundException, NoSuchProviderException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, UnlockWalletException
-
writeKeyFile
public static Path writeKeyFile(Path path, String filename, KeyBean key, String password) throws NoSuchAlgorithmException, NoSuchProviderException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, IOException
-
readKeyFile
public static KeyBean readKeyFile(Path filename, String password) throws FileNotFoundException, NoSuchProviderException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, UnlockWalletException
wallet cypher - it returns the words list needed for wallet recovery procedure- Parameters:
filename
-password
-- Returns:
- Throws:
FileNotFoundException
NoSuchProviderException
NoSuchPaddingException
InvalidKeyException
InvalidAlgorithmParameterException
UnlockWalletException
-
importKeyFromWords
public static Path importKeyFromWords(List<String> words, Path path, String filename, KeyContexts.WalletCypher cypher, String newPassword) throws NoSuchAlgorithmException, InvalidKeyException, NoSuchPaddingException
Spawns a refurbished wallet- Parameters:
words
- an ordered list of words used for wallet restore procedurepath
- is the path on device where the wallet will be restored and savedfilename
- the wallet internal namecypher
- the wallet cyphernewPassword
- the new chosen password- Returns:
- Path where the wallet has been created
- Throws:
NoSuchAlgorithmException
InvalidKeyException
NoSuchPaddingException
-
writePublicKey
public static void writePublicKey(String walletname, String password, int keyIndex, KeyContexts.WalletCypher cypher) throws InvalidCypherException, InvalidWalletIndexException, PublicKeySerializzationException, UnlockWalletException, IOException
-
readPublicKey
public static PublicKeyBean readPublicKey(String publicKeyName)
-
listPublicKeys
public static Map<String,PublicKeyBean> listPublicKeys()
-
-