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: 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:
-
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
-