Class AlgorithmFilter

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

public final class AlgorithmFilter extends Object
Filter criteria for querying supported algorithms from the AnkaSecure platform.

Use the fluent AlgorithmFilter.Builder API to construct filter instances. All fields are optional; omitted fields mean "no filter" for that criterion. Multiple criteria are combined with AND logic.

Filter Logic

  • category, status: exact match
  • minSecurityLevel, maxSecurityLevel: range (inclusive)
  • keyOps, standards: AND logic (must have ALL specified values)
  • kty, compositeMode, alg: OR logic (matches ANY specified value)

compositeMode is the criterion that separates a hybrid KEM from a hybrid signature: every hybrid algorithm publishes the same coarse key type COMPOSITE, so kty cannot tell them apart.

Usage Examples

Example 1: Find Production-Ready PQC Encryption Algorithms


 AlgorithmFilter filter = AlgorithmFilter.builder()
     .withCategory(AlgorithmInfo.Category.POST_QUANTUM)
     .withStatus(AlgorithmInfo.Status.RECOMMENDED)
     .withKeyOps("encrypt", "decrypt")
     .withMinSecurityLevel(3)
     .build();

 List<AlgorithmInfo> algorithms = sdk.getSupportedAlgorithms(filter);
 // Returns: ML-KEM-768, ML-KEM-1024
 

Example 2: Find FIPS-Approved Signature Algorithms


 AlgorithmFilter filter = AlgorithmFilter.builder()
     .withStatus(AlgorithmInfo.Status.RECOMMENDED)
     .withKeyOps("sign", "verify")
     .withStandards("FIPS")
     .build();

 List<AlgorithmInfo> algorithms = sdk.getSupportedAlgorithms(filter);
 // Returns: RSA-PSS, ECDSA, ML-DSA variants
 

Example 3: Find High-Security Algorithms (Level 5)


 AlgorithmFilter filter = AlgorithmFilter.builder()
     .withMinSecurityLevel(5)
     .withStatus(AlgorithmInfo.Status.RECOMMENDED)
     .build();

 List<AlgorithmInfo> algorithms = sdk.getSupportedAlgorithms(filter);
 // Returns: ML-KEM-1024, ML-DSA-87, SLH-DSA-256, RSA-4096, etc.
 

Example 4: Find EU Telecom Compliant Algorithms


 AlgorithmFilter filter = AlgorithmFilter.builder()
     .withStandards("ETSI")
     .withMinSecurityLevel(3)
     .build();

 List<AlgorithmInfo> algorithms = sdk.getSupportedAlgorithms(filter);
 // Returns algorithms compliant with ETSI TS 103 744
 

Example 5: Filter by Multiple Key Types


 AlgorithmFilter filter = AlgorithmFilter.builder()
     .withKty("ML-KEM", "ML-DSA")  // OR logic
     .withStatus(AlgorithmInfo.Status.RECOMMENDED)
     .build();

 List<AlgorithmInfo> algorithms = sdk.getSupportedAlgorithms(filter);
 // Returns all RECOMMENDED ML-KEM and ML-DSA variants
 
Since:
3.0.0
See Also:
  • Method Details

    • builder

      public static AlgorithmFilter.Builder builder()
      Creates a new builder for constructing an AlgorithmFilter.
      Returns:
      a new Builder instance
    • getCategory

      public AlgorithmInfo.Category getCategory()
      Returns:
      the category filter (POST_QUANTUM or CLASSICAL), or null if not set
    • getStatus

      public AlgorithmInfo.Status getStatus()
      Returns:
      the status filter (RECOMMENDED, LEGACY, or EXPERIMENTAL), or null if not set
    • getMinSecurityLevel

      public Integer getMinSecurityLevel()
      Returns:
      minimum NIST security level (inclusive), or null if not set
    • getMaxSecurityLevel

      public Integer getMaxSecurityLevel()
      Returns:
      maximum NIST security level (inclusive), or null if not set
    • getKeyOps

      public Set<String> getKeyOps()
      Returns:
      required key operations (AND logic), or null if not set
    • getStandards

      public Set<String> getStandards()
      Returns:
      required standards (AND logic), or null if not set
    • getKty

      public Set<String> getKty()
      Returns:
      key types to match (OR logic), or null if not set
    • getCompositeMode

      public Set<String> getCompositeMode()
      Returns the composite constructions to match (OR logic), as wire tokens.

      Every hybrid algorithm publishes the same coarse key type COMPOSITE, so getKty() cannot separate a hybrid KEM from a hybrid signature — this criterion is what does. A simple algorithm never matches it.

      Returns:
      composite constructions to match (OR logic), or null if not set
    • getAlg

      public Set<String> getAlg()
      Returns:
      algorithm names to match (OR logic), or null if not set
    • hasFilters

      public boolean hasFilters()
      Checks if any filter criteria are set.
      Returns:
      true if at least one filter is active
    • toString

      public String toString()
      Overrides:
      toString in class Object