Interface ParameterSetDescriptor<S extends AlgorithmKeySpec>
- Type Parameters:
S- theAlgorithmKeySpectype produced by this descriptor
- All Known Implementing Classes:
ParameterSetDescriptor.Concrete, ParameterSetDescriptor.Template
public sealed interface ParameterSetDescriptor<S extends AlgorithmKeySpec>
permits ParameterSetDescriptor.Concrete<S>, ParameterSetDescriptor.Template<S>
Describes a named, discoverable parameter set (or parameterized template)
for a
CryptoAlgorithm.
This interface enables runtime discovery of all key-generation configurations an algorithm supports. Callers (e.g., UIs, provisioning tools, policy engines) can enumerate parameter sets without prior knowledge of the concrete algorithm.
Two variants exist:
ParameterSetDescriptor.Concrete— a fully pre-built, named configuration. The spec instance is already constructed and ready to pass to a key generator.ParameterSetDescriptor.Template— a family of related parameter sets driven by user-supplied arguments. The caller provides a map of named values and the template factory produces the concrete spec.
Guaranteed uniqueness
Within a singleCryptoAlgorithm, every ParameterSetDescriptor
must have a unique id() value. Algorithms are responsible for
enforcing this invariant.- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA fully pre-built, named parameter set carrying a ready-to-use spec.static final recordA parameterized family of parameter sets driven by user-supplied arguments. -
Method Summary
Modifier and TypeMethodDescriptionHuman-readable label for UIs and documentation (e.g.,"ML-KEM-768 (NIST Level 3)").id()Machine-readable identifier, unique within the algorithm (e.g.,"ML-KEM-768","RSA-3072","rsa-custom").Security level of this parameter set or template's default.static List<ParameterSetDescriptor<? extends AlgorithmKeySpec>> snapshot(List<ParameterSetDescriptor<? extends AlgorithmKeySpec>> descriptors) Snapshots a provider's descriptors, rejecting duplicate identifiers.
-
Method Details
-
id
String id()Machine-readable identifier, unique within the algorithm (e.g.,"ML-KEM-768","RSA-3072","rsa-custom").- Returns:
- non-null, non-empty identifier
-
displayName
String displayName()Human-readable label for UIs and documentation (e.g.,"ML-KEM-768 (NIST Level 3)").- Returns:
- non-null display name
-
securityLevel
SecurityLevel securityLevel()Security level of this parameter set or template's default.- Returns:
- non-null security level
-
snapshot
static List<ParameterSetDescriptor<? extends AlgorithmKeySpec>> snapshot(List<ParameterSetDescriptor<? extends AlgorithmKeySpec>> descriptors) Snapshots a provider's descriptors, rejecting duplicate identifiers.- Parameters:
descriptors- ordered descriptors- Returns:
- immutable ordered snapshot
- Throws:
IllegalArgumentException- if identifiers repeatNullPointerException- if the list or a descriptor is null
-