Package convex.core.crypto
Class BIP39
java.lang.Object
convex.core.crypto.BIP39
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMinimum number of words accepted in a mnemonicstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturn true if the string is a valid mnemonic phrasestatic Stringstatic StringcreateSecureMnemonic(int numWords) createWords(SecureRandom r, int n) Create a list of random mnemonic words given a random number generatorstatic BlobGets a BIP39 seed given a mnemonic and passphrasestatic BlobGets a BIP39 seed given a mnemonic and passphraseGets the individual words from a mnemonic String.static StringCreate a mnemonic String from a list of words, separated by spacesstatic Stringstatic BlobseedToEd25519Seed(Blob seed) Converts a BIP39 seed to an Ed25519 seed.static AKeyPairseedToKeyPair(Blob seed)
-
Field Details
-
NUM_WORDS
public static final int NUM_WORDS -
SEED_LENGTH
public static final int SEED_LENGTH- See Also:
-
MIN_WORDS
public static final int MIN_WORDSMinimum number of words accepted in a mnemonic- See Also:
-
-
Constructor Details
-
BIP39
public BIP39()
-
-
Method Details
-
getSeed
public static Blob getSeed(List<String> words, String passphrase) throws NoSuchAlgorithmException, InvalidKeySpecException Gets a BIP39 seed given a mnemonic and passphrase- Parameters:
words- Mnemonic wordspassphrase- Optional BIP39 passphrase- Returns:
- Blob containing BIP39 seed (64 bytes)
- Throws:
NoSuchAlgorithmExceptionInvalidKeySpecException
-
seedToKeyPair
-
seedToEd25519Seed
-
checkMnemonic
-
getSeed
-
createSecureMnemonic
-
createSecureMnemonic
-
createWords
Create a list of random mnemonic words given a random number generator- Parameters:
r- Random number generator instancen- Number of words to generate- Returns:
- List of words
-
getWords
-
normalise
-
mnemonic
-