Enum Class VoidSpec

java.lang.Object
java.lang.Enum<VoidSpec>
zeroecho.core.spec.VoidSpec
All Implemented Interfaces:
Serializable, Comparable<VoidSpec>, Constable, ContextSpec

public enum VoidSpec extends Enum<VoidSpec> implements ContextSpec
Context specification for algorithms that require no additional parameters.

Many algorithms do not define per-operation configuration beyond the key itself. In such cases, the VoidSpec singleton is used as a placeholder to satisfy generic APIs that expect a ContextSpec.

Usage

CryptoContext ctx = algo.createContext(KeyUsage.SIGN, privateKey, VoidSpec.INSTANCE);

Since this type has no state, all equality checks resolve to the same single instance INSTANCE.

Since:
1.0
  • Enum Constant Details

    • INSTANCE

      public static final VoidSpec INSTANCE
      Singleton instance representing the absence of per-operation parameters.
  • Method Details

    • values

      public static VoidSpec[] 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 VoidSpec 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