use of com.toshi.crypto.keyStore.KeyStoreHandler in project toshi-android-client by toshiapp.
the class HDWallet method readMasterSeedFromStorage.
private String readMasterSeedFromStorage() {
try {
final KeyStoreHandler keyStoreHandler = new KeyStoreHandler(BaseApplication.get(), ALIAS);
final String encryptedMasterSeed = this.prefs.getString(MASTER_SEED, null);
if (encryptedMasterSeed == null)
return null;
return keyStoreHandler.decrypt(encryptedMasterSeed, this::saveMasterSeed);
} catch (KeyStoreException e) {
LogUtil.exception("Error while reading master seed from storage", e);
throw new IllegalStateException(e);
}
}
use of com.toshi.crypto.keyStore.KeyStoreHandler in project toshi-android-client by toshiapp.
the class HDWallet method saveMasterSeedToStorage.
private void saveMasterSeedToStorage(final String masterSeed) {
try {
final KeyStoreHandler keyStoreHandler = new KeyStoreHandler(BaseApplication.get(), ALIAS);
final String encryptedMasterSeed = keyStoreHandler.encrypt(masterSeed);
saveMasterSeed(encryptedMasterSeed);
this.masterSeed = masterSeed;
} catch (KeyStoreException e) {
LogUtil.exception("Error while saving master seed from storage", e);
throw new IllegalStateException(e);
}
}
Aggregations