Package co.ankatech.ankasecure.sdk.model
Class AlgorithmInfo
java.lang.Object
co.ankatech.ankasecure.sdk.model.AlgorithmInfo
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; signaturesML-DSA,SLH-DSA,FALCON, and the stateful hash-basedXMSS(with XMSS^MT) andLMS(with HSS). A stateful key is listed under one entry per parameter set, whose name begins with its kty token, for exampleXMSS-SHA2_10_256,XMSSMT-SHA2_20/2_256andLMS-HSS-L2-SHA256-M32-H10-W4. Their standards attribution differs per algorithm; read it fromgetStandards(). - 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"
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumCategory of the algorithm: classical vs. post-quantum vs. hybrid.static enumLifecycle status as defined by the platform. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetAlg()Returns the algorithm category.Returns how this entry's components are combined, for a hybrid algorithm.Returns an unmodifiable copy to protect internal state.getKty()Returns an unmodifiable copy to protect internal state.inthashCode()voidsetAdvisory(String advisory) voidvoidsetCategory(AlgorithmInfo.Category category) voidsetCompositeMode(CompositeMode compositeMode) voidvoidvoidsetSecurityLevel(Integer securityLevel) voidsetStandards(List<String> standards) voidsetStatus(AlgorithmInfo.Status status) voidsetSunsetDate(LocalDate sunsetDate) toString()
-
Constructor Details
-
AlgorithmInfo
public AlgorithmInfo()Zero-arg constructor for deserialization frameworks.
-
-
Method Details
-
getKty
-
setKty
-
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 — notgetKty()— is what distinguishes a hybrid KEM from a hybrid signature. It isnullfor a simple algorithm, and that absence means "not composite".- Returns:
- the composite construction, or
nullfor a simple algorithm
-
setCompositeMode
-
getAlg
-
setAlg
-
getKeyOps
Returns an unmodifiable copy to protect internal state. -
setKeyOps
-
getStatus
-
setStatus
-
getSunsetDate
-
setSunsetDate
-
getAdvisory
-
setAdvisory
-
getSecurityLevel
-
setSecurityLevel
-
getStandards
Returns an unmodifiable copy to protect internal state. -
setStandards
-
getCategory
Returns the algorithm category. -
setCategory
-
toString
-
equals
-
hashCode
public int hashCode()
-