com.google.bitcoin.crypto
Class MnemonicCode

java.lang.Object
  extended by com.google.bitcoin.crypto.MnemonicCode

public class MnemonicCode
extends Object

A MnemonicCode object may be used to convert between binary seed values and lists of words per the BIP 39 specification


Nested Class Summary
static class MnemonicCode.Version
           
 
Field Summary
static String BIP39_ENGLISH_SHA256
           
 
Constructor Summary
MnemonicCode()
           
MnemonicCode(InputStream wordstream, String wordListDigest)
          Creates an MnemonicCode object, initializing with words read from the supplied input stream.
 
Method Summary
 void check(List<String> words)
          Check to see if a mnemonic word list is valid.
 byte[] toEntropy(List<String> words)
          Convert mnemonic word list to original entropy value.
 List<String> toMnemonic(byte[] entropy)
          Convert entropy data to mnemonic word list.
static byte[] toSeed(List<String> words, String passphrase)
          Convert mnemonic word list to seed.
static byte[] toSeed(List<String> words, String passphrase, MnemonicCode.Version version)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BIP39_ENGLISH_SHA256

public static String BIP39_ENGLISH_SHA256
Constructor Detail

MnemonicCode

public MnemonicCode()
             throws IOException
Throws:
IOException

MnemonicCode

public MnemonicCode(InputStream wordstream,
                    String wordListDigest)
             throws IOException,
                    IllegalArgumentException
Creates an MnemonicCode object, initializing with words read from the supplied input stream. If a wordListDigest is supplied the digest of the words will be checked.

Throws:
IOException
IllegalArgumentException
Method Detail

toSeed

public static byte[] toSeed(List<String> words,
                            String passphrase)
Convert mnemonic word list to seed.


toSeed

public static byte[] toSeed(List<String> words,
                            String passphrase,
                            MnemonicCode.Version version)

toEntropy

public byte[] toEntropy(List<String> words)
                 throws MnemonicException.MnemonicLengthException,
                        MnemonicException.MnemonicWordException,
                        MnemonicException.MnemonicChecksumException
Convert mnemonic word list to original entropy value.

Throws:
MnemonicException.MnemonicLengthException
MnemonicException.MnemonicWordException
MnemonicException.MnemonicChecksumException

toMnemonic

public List<String> toMnemonic(byte[] entropy)
                        throws MnemonicException.MnemonicLengthException
Convert entropy data to mnemonic word list.

Throws:
MnemonicException.MnemonicLengthException

check

public void check(List<String> words)
           throws MnemonicException
Check to see if a mnemonic word list is valid.

Throws:
MnemonicException


Copyright © 2014. All rights reserved.