Class AlgorithmInfo

java.lang.Object
co.ankatech.ankasecure.sdk.model.AlgorithmInfo

public final class AlgorithmInfo extends Object
Immutable value object representing a supported algorithm profile.

Provides complete metadata about an algorithm including lifecycle status, security level, compliance standards, and composite key compatibility. Use AuthenticatedSdk.getSupportedAlgorithms() to discover all available algorithms, then filter by criteria using AlgorithmFilter.

Understanding Algorithm Properties

Status Values

  • RECOMMENDED: the platform's lifecycle status for an algorithm it recommends for new key generation and cryptographic operations. It is not a standards attribution and does not mean NIST-approved: which bodies attribute an algorithm is carried by getStandards(), and many RECOMMENDED entries carry no NIST attribution (for example FRODO-976, CMCE-460896, brainpoolP384r1, SM2, ARIA-GCM-256). Use for new keys.
  • LEGACY: Deprecated but still supported for backward compatibility. Plan migration to RECOMMENDED algorithms.
  • EXPERIMENTAL: Preview/beta, not for production. May change in future versions.

Category Values

  • CLASSICAL: Traditional algorithms (RSA, ECDSA, AES). Vulnerable to quantum computers.
  • POST_QUANTUM: Quantum-resistant algorithms, by kty token: KEMs ML-KEM, HQC, FRODO, CMCE, BIKE, SABER, NTRU, NTRUPRIME, SMAUG-T; signatures ML-DSA, SLH-DSA, FALCON, and the stateful hash-based XMSS (with XMSS^MT) and LMS (with HSS). A stateful key is listed under one entry per parameter set, whose name begins with its kty token, for example XMSS-SHA2_10_256, XMSSMT-SHA2_20/2_256 and LMS-HSS-L2-SHA256-M32-H10-W4. Their standards attribution differs per algorithm; read it from getStandards().
  • HYBRID: Composite algorithms pairing a classical and a post-quantum component (kty COMPOSITE).

Security Levels (NIST)

  • Level 1: Equivalent to AES-128 (~2^128 operations to break)
  • Level 2: Equivalent to SHA-256 collision resistance
  • Level 3: Equivalent to AES-192 (~2^192 operations)
  • Level 4: Equivalent to SHA-384 collision resistance
  • Level 5: Equivalent to AES-256 (~2^256 operations)

Usage Examples

Example 1: Find PQC Encryption Algorithms


 List<AlgorithmInfo> algorithms = sdk.getSupportedAlgorithms();

 List<AlgorithmInfo> pqcEncryption = algorithms.stream()
     .filter(a -> a.getCategory() == AlgorithmInfo.Category.POST_QUANTUM)
     .filter(a -> a.getKeyOps().contains("encrypt"))
     .filter(a -> a.getStatus() == AlgorithmInfo.Status.RECOMMENDED)
     .collect(Collectors.toList());

 pqcEncryption.forEach(alg -> {
     System.out.println("Algorithm: " + alg.getAlg());
     System.out.println("Security level: " + alg.getSecurityLevel());
     System.out.println("Standards: " + alg.getStandards());
 });
 // Output (10 entries): ML-KEM-512 (Level 1), ML-KEM-768 (Level 3), ML-KEM-1024 (Level 5),
 // HQC-128 (Level 1), HQC-192 (Level 3), HQC-256 (Level 5), FRODO-976 (Level 3),
 // FRODO-1344 (Level 5), CMCE-460896 (Level 3), CMCE-6688128 (Level 5)
 

Example 2: Find Hybrid Algorithms


 List<AlgorithmInfo> hybrids = algorithms.stream()
     .filter(a -> a.getCategory() == AlgorithmInfo.Category.HYBRID)
     .filter(a -> a.getStatus() == AlgorithmInfo.Status.RECOMMENDED)
     .collect(Collectors.toList());

 hybrids.forEach(alg -> {
     System.out.println("Hybrid: " + alg.getAlg());
     System.out.println("Key type: " + alg.getKty());
     System.out.println("Construction: " + alg.getCompositeMode());
     System.out.println("Security level: " + alg.getSecurityLevel());
 });
 // Output — every hybrid entry publishes the SAME coarse key type, so the
 // construction is what tells them apart and it rides on its own member.
 // 41 entries: 27 COMPOSITE_KEM_COMBINE and 14 COMPOSITE_SIGNATURE, for example:
 // Hybrid: X25519+ML-KEM-768 (kty: COMPOSITE; construction: COMPOSITE_KEM_COMBINE; Level 1)
 // Hybrid: Ed25519+ML-DSA-44 (kty: COMPOSITE; construction: COMPOSITE_SIGNATURE; Level 1)
 

Example 3: Filter by Standards Attribution


 // Find algorithms attributed to NIST
 List<AlgorithmInfo> nistAlgorithms = algorithms.stream()
     .filter(a -> a.getStandards().contains("NIST"))
     .filter(a -> a.getStatus() == AlgorithmInfo.Status.RECOMMENDED)
     .collect(Collectors.toList());

 // Find algorithms attributed to ETSI or BSI
 List<AlgorithmInfo> etsiOrBsi = algorithms.stream()
     .filter(a -> a.getStandards().contains("ETSI") ||
                  a.getStandards().contains("BSI"))
     .collect(Collectors.toList());
 

Example 4: Check Sunset Dates


 algorithms.stream()
     .filter(a -> a.getSunsetDate() != null)
     .filter(a -> a.getSunsetDate().isBefore(LocalDate.now().plusMonths(6)))
     .forEach(alg -> {
         System.out.println("URGENT: " + alg.getAlg() + " sunsets on " + alg.getSunsetDate());
         System.out.println("Advisory: " + alg.getAdvisory());
     });
 

JSON Example:


 {
   "kty"           : "ML-KEM",
   "alg"           : "ML-KEM-768",
   "keyOps"        : ["encrypt", "decrypt"],
   "status"        : "RECOMMENDED",
   "securityLevel" : 3,
   "standards"     : ["NIST", "BSI", "ANSSI", "ENISA", "IETF", "CRYPTREC", "ETSI"],
   "category"      : "POST_QUANTUM"
 }
 
See Also:
  • Constructor Details

    • AlgorithmInfo

      public AlgorithmInfo()
      Zero-arg constructor for deserialization frameworks.
  • Method Details

    • getKty

      public String getKty()
    • setKty

      public void setKty(String kty)
    • getCompositeMode

      public CompositeMode getCompositeMode()
      Returns how this entry's components are combined, for a hybrid algorithm.

      Every hybrid entry publishes the coarse key type COMPOSITE, so this value — not getKty() — is what distinguishes a hybrid KEM from a hybrid signature. It is null for a simple algorithm, and that absence means "not composite".

      Returns:
      the composite construction, or null for a simple algorithm
    • setCompositeMode

      public void setCompositeMode(CompositeMode compositeMode)
    • getAlg

      public String getAlg()
    • setAlg

      public void setAlg(String alg)
    • getKeyOps

      public List<String> getKeyOps()
      Returns an unmodifiable copy to protect internal state.
    • setKeyOps

      public void setKeyOps(List<String> keyOps)
    • getStatus

      public AlgorithmInfo.Status getStatus()
    • setStatus

      public void setStatus(AlgorithmInfo.Status status)
    • getSunsetDate

      public LocalDate getSunsetDate()
    • setSunsetDate

      public void setSunsetDate(LocalDate sunsetDate)
    • getAdvisory

      public String getAdvisory()
    • setAdvisory

      public void setAdvisory(String advisory)
    • getSecurityLevel

      public Integer getSecurityLevel()
    • setSecurityLevel

      public void setSecurityLevel(Integer securityLevel)
    • getStandards

      public List<String> getStandards()
      Returns an unmodifiable copy to protect internal state.
    • setStandards

      public void setStandards(List<String> standards)
    • getCategory

      public AlgorithmInfo.Category getCategory()
      Returns the algorithm category.
    • setCategory

      public void setCategory(AlgorithmInfo.Category category)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object