Enum Class WfEncryptionMethod

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

public enum WfEncryptionMethod extends Enum<WfEncryptionMethod>
Whiteflag encryption parameters enum class

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

The names of cryptographic algorithms, modes, schemes used by this class are in accordance with the Java Security Standard Algorithm Names.

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

    • NO_ENCRYPTION

      public static final WfEncryptionMethod NO_ENCRYPTION
      Encryption Method 0: no encryption
    • AES_256_CTR_ECDH

      public static final WfEncryptionMethod AES_256_CTR_ECDH
      Encryption Method 1: AES-256-CTR with negotiated key
    • AES_256_CTR_PSK

      public static final WfEncryptionMethod AES_256_CTR_PSK
      Encryption Method : AES-256-CTR with pre-shared key
  • Field Details

    • fieldValue

      public final String fieldValue
      The value used in a Whiteflag message to indicate the encryption method
    • algorithmName

      protected final String algorithmName
      The name of the algorithm for this encryption method, i.a.w. Java Security Standard Algorithm Names
    • operationMode

      protected final String operationMode
      The mode of operation for this encryption method, i.a.w. Java Security Standard Algorithm Names
    • paddingScheme

      protected final String paddingScheme
      The padding scheme for this encryption method, i.a.w. Java Security Standard Algorithm Names
    • cipherName

      public final String cipherName
      The cipher name for this encryption method i.a.w. Java Security Standard Algorithm Names
    • keyLength

      protected final int keyLength
      The byte length of the encryption key for this encryption method
    • hkdfSalt

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

    • values

      public static WfEncryptionMethod[] 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 WfEncryptionMethod 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 WfEncryptionMethod fromFieldValue(String fieldValue) throws WfCryptoException
      Returns the encryption method from the indicator value
      Parameters:
      fieldValue - the value used in the EncryptionIndicator message field to indicate the encryption method
      Returns:
      the requested encryption method
      Throws:
      WfCryptoException - if the encryption indicator is invalid
      Since:
      1.1