Enum Class BadMnemonicReason

java.lang.Object
java.lang.Enum<BadMnemonicReason>
com.hedera.hashgraph.sdk.BadMnemonicReason
All Implemented Interfaces:
Serializable, Comparable<BadMnemonicReason>, Constable

public enum BadMnemonicReason extends Enum<BadMnemonicReason>
Possible reason why a Mnemonic failed validation.
  • Enum Constant Details

    • BadLength

      public static final BadMnemonicReason BadLength
      The mnemonic did not contain exactly 24 words.
    • UnknownWords

      public static final BadMnemonicReason UnknownWords
      The mnemonic contained words which were not found in the BIP-39 standard English word list.

      BadMnemonicException.unknownWordIndices will be set with the list of word indices in Mnemonic.words which were not found in the standard word list.

      See Also:
    • ChecksumMismatch

      public static final BadMnemonicReason ChecksumMismatch
      The checksum encoded in the mnemonic did not match the checksum we just calculated for that mnemonic.

      24-word mnemonics have an 8-bit checksum that is appended to the 32 bytes of source entropy after being calculated from it, before being encoded into words. This status is returned if Mnemonic.validate() calculated a different checksum for the mnemonic than that which was encoded into it.

      This could happen if two or more of the words were entered out of the original order or replaced with another from the standard word list (as this is only returned if all the words exist in the word list).

    • NotLegacy

      public static final BadMnemonicReason NotLegacy
      The given mnemonic doesn't contain 22 words required to be a legacy mnemonic, or the words are not in the legacy list.
  • Method Details

    • values

      public static BadMnemonicReason[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static BadMnemonicReason valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null