Package co.ankatech.ankasecure.sdk.model
Class AlgorithmFilter
java.lang.Object
co.ankatech.ankasecure.sdk.model.AlgorithmFilter
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 8 entries: ML-KEM-768 (Level 3), ML-KEM-1024 (Level 5), 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 NIST-Attributed Signature Algorithms
AlgorithmFilter filter = AlgorithmFilter.builder()
.withStatus(AlgorithmInfo.Status.RECOMMENDED)
.withKeyOps("sign", "verify")
.withStandards("NIST")
.build();
List<AlgorithmInfo> algorithms = sdk.getSupportedAlgorithms(filter);
// Returns 46 entries, by family:
// ML-DSA (3): ML-DSA-44, ML-DSA-65, ML-DSA-87
// SLH-DSA (6): SLH-DSA-SHA2-128S/128F/192S/192F/256S/256F
// stateful hash-based (5): XMSS-SHA2_10_256, XMSSMT-SHA2_20/2_256,
// LMS-SHA256-M32-H10-W4, LMS-SHA256-M24-H10-W4,
// LMS-HSS-L2-SHA256-M32-H10-W4
// EC (3): P-256, P-384, P-521 RSA (5): RSA-2048 ... RSA-8192
// EdDSA (2): Ed25519, Ed448
// MAC (11): CMAC-AES-128/192/256, HMAC-SHA256/384/512, HMAC-SHA3-256/384/512,
// KMAC128, KMAC256 (MAC entries publish the sign/verify key operations)
// composite signatures (11): Ed25519+ML-DSA-44 ... P-521+ML-DSA-87
// Not returned: entries without a NIST attribution, e.g. FALCON-512, FALCON-1024,
// brainpoolP256r1/384r1/512r1, SM2, GOST-R34.10-2012-256, brainpool+ML-DSA composites
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 35 entries, all at Level 5:
// post-quantum (8): ML-KEM-1024, HQC-256, FRODO-1344, CMCE-6688128, ML-DSA-87,
// SLH-DSA-SHA2-256S, SLH-DSA-SHA2-256F, FALCON-1024
// classical asymmetric (6): P-521, brainpoolP512r1, RSA-8192, Ed448, SM2,
// GOST-R34.10-2012-256
// classical symmetric (15): AES-GCM-256, AES-CCM-256, ChaCha20-Poly1305,
// Camellia-GCM-256, ARIA-GCM-256, ARIA-CCM-256, and 9 MACs
// hybrid (6): P-521+ML-KEM-1024, P-521+HQC-256, brainpoolP512r1+ML-KEM-1024,
// Ed448+ML-DSA-87, P-521+ML-DSA-87, brainpoolP512r1+ML-DSA-87
Example 4: Find ETSI-Attributed Algorithms
AlgorithmFilter filter = AlgorithmFilter.builder()
.withStandards("ETSI")
.withMinSecurityLevel(3)
.build();
List<AlgorithmInfo> algorithms = sdk.getSupportedAlgorithms(filter);
// Returns algorithms whose standards attribution includes ETSI
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for constructingAlgorithmFilterinstances. -
Method Summary
Modifier and TypeMethodDescriptionstatic AlgorithmFilter.Builderbuilder()Creates a new builder for constructing an AlgorithmFilter.getAlg()Returns the composite constructions to match (OR logic), as wire tokens.getKty()booleanChecks if any filter criteria are set.toString()
-
Method Details
-
builder
Creates a new builder for constructing an AlgorithmFilter.- Returns:
- a new Builder instance
-
getCategory
- Returns:
- the category filter (POST_QUANTUM or CLASSICAL), or null if not set
-
getStatus
- Returns:
- the status filter (RECOMMENDED, LEGACY, or EXPERIMENTAL), or null if not set
-
getMinSecurityLevel
- Returns:
- minimum NIST security level (inclusive), or null if not set
-
getMaxSecurityLevel
- Returns:
- maximum NIST security level (inclusive), or null if not set
-
getKeyOps
- Returns:
- required key operations (AND logic), or null if not set
-
getStandards
- Returns:
- required standards (AND logic), or null if not set
-
getKty
- Returns:
- key types to match (OR logic), or null if not set
-
getCompositeMode
Returns the composite constructions to match (OR logic), as wire tokens.Every hybrid algorithm publishes the same coarse key type
COMPOSITE, sogetKty()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
- 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
-