Enum Class CompositeMode

java.lang.Object
java.lang.Enum<CompositeMode>
co.ankatech.ankasecure.sdk.model.CompositeMode
All Implemented Interfaces:
Serializable, Comparable<CompositeMode>, Constable

public enum CompositeMode extends Enum<CompositeMode>
How the components of a composite (hybrid) key are combined.

A composite key pairs a classical component with a post-quantum one. The platform publishes the single coarse key type COMPOSITE for every such pairing: the pairing itself is named by alg (for example X25519+ML-KEM-768) and the construction — how the two components work together — is this value, on its own axis.

This enumeration is the SDK's view of the compositeMode member published by AlgorithmInfo (catalogue entries) and KeyMetadata (keys). It is absent — the getter answers null — for every simple key and every simple algorithm; absence is the statement "this is not composite", not a missing value.

Usage Example:


 for (AlgorithmInfo info : sdk.getSupportedAlgorithms()) {
     if (info.getCompositeMode() == CompositeMode.COMPOSITE_KEM_COMBINE) {
         System.out.println(info.getAlg() + " derives one secret via " + info.getKty());
     }
 }
 
Since:
3.0.0
See Also:
  • Enum Constant Details

    • COMPOSITE_KEM_COMBINE

      public static final CompositeMode COMPOSITE_KEM_COMBINE
      The component secrets are combined into a single shared secret through the key derivation function named by KeyMetadata.getKdf().
    • COMPOSITE_SIGNATURE

      public static final CompositeMode COMPOSITE_SIGNATURE
      The components sign independently, and the results are adjudicated by the key's verification policy.
  • Field Details

    • KEY_TYPE

      public static final String KEY_TYPE
      The single coarse key type every composite key and every hybrid catalogue entry publishes.

      It is deliberately one token for every pairing and every construction: the pairing is named by alg, the construction by a member of this enumeration. Comparing a key type against a member's name is the defect this constant exists to prevent — the two are different axes and a member name is never a key type.

      See Also:
  • Method Details

    • values

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