Enum Class WfAuthMethod

java.lang.Object
java.lang.Enum<WfAuthMethod>
org.whiteflagprotocol.java.crypto.WfAuthMethod
All Implemented Interfaces:
Serializable, Comparable<WfAuthMethod>, Constable

public enum WfAuthMethod extends Enum<WfAuthMethod>
Whiteflag authentication parameters enum class

This is a non-instantiatable enum class that holds all authentication parameters in accordance with the Whiteflag specification. No implementation specific properties and methods are defined by this class.

Since:
1.1
Whiteflag version:
v1-draft.6
Whiteflag standard x-reference:
5.2.3 Key and Token Derivation
  • Enum Constant Details

    • TOKEN_PRESHARED

      public static final WfAuthMethod TOKEN_PRESHARED
      Authentication Method 2: shared token
  • Field Details

    • fieldValue

      public final String fieldValue
      The indicator used in the VerificationMethod message field for this authentication method
    • tokenLength

      protected final int tokenLength
      The byte length of the validation token for this authentication method
    • hkdfSalt

      protected final byte[] hkdfSalt
      The salt used by this authentication method in the HKDF function to derive the validation data
  • Method Details

    • values

      public static WfAuthMethod[] 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 WfAuthMethod 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
    • fromFieldValue

      public static final WfAuthMethod fromFieldValue(String fieldValue) throws WfCryptoException
      Returns the encryption method from the indicator value
      Parameters:
      fieldValue - the value used in the VerificationMethod message field to indicate the encryption method
      Returns:
      the requested authentication method
      Throws:
      WfCryptoException - if the encryption indicator is invalid
      Since:
      1.1