use of io.github.novacrypto.bip39.Validation.UnexpectedWhiteSpaceException in project popstellar by dedis.
the class Wallet method importSeed.
/**
* Method that allow import mnemonic seed.
*
* @param words a String.
*/
public void importSeed(@NonNull String words) throws SeedValidationException, GeneralSecurityException {
try {
MnemonicValidator.ofWordList(English.INSTANCE).validate(words);
} catch (InvalidChecksumException | InvalidWordCountException | WordNotFoundException | UnexpectedWhiteSpaceException e) {
throw new SeedValidationException(e);
}
seed = aead.encrypt(new SeedCalculator().calculateSeed(words, ""), new byte[0]);
Log.d(TAG, "ImportSeed: new seed: " + Utils.bytesToHex(seed));
}
Aggregations