Package zeroecho.core.spec
package zeroecho.core.spec
Specifications for keys and per-operation parameters.
This package defines lightweight, strongly typed specifications used when creating cryptographic contexts. Key specifications describe how a key should be generated or imported for a particular family, while context specifications supply optional, per-operation parameters (for example, padding or nonce strategy). Algorithms that need no extra parameters use a singleton placeholder.
Key elements
AlgorithmKeySpec- marker interface for algorithm-specific key specs used by key builders.ContextSpec- marker interface for per-operation parameters supplied to context creation.VoidSpec- singleton context spec used when an algorithm requires no additional parameters.
Typical usage
// Algorithm requires no per-operation parameters.
zeroecho.core.context.CryptoContext ctx =
algo.createContext(zeroecho.core.KeyUsage.SIGN, privateKey, zeroecho.core.spec.VoidSpec.INSTANCE);
// Algorithm with parameters: pass an algorithm-specific ContextSpec implementation.
// Example: RSA with OAEP/PSS, AEAD tag length, etc.
// zeroecho.core.context.CryptoContext ctx =
// algo.createContext(zeroecho.core.KeyUsage.ENCRYPT, key, someAlgorithmSpecificSpec);
Design notes
- Specification types should be immutable and safe to share across operations.
- Key specifications and context specifications keep configuration separate from runtime state, improving clarity and reuse.
- Callers should prefer library-provided spec classes and avoid implementing the marker interfaces directly unless extending the library with new families.
- Since:
- 1.0
-
ClassDescriptionProvider-independent identity of one exact cryptographic operation or key type.Digest-qualified signature parameters.Stable namespaced algorithm family name.Semantic role represented by an identity.Exact named parameter set, such as an elliptic-curve name.Parameters for an unparameterized family.Typed, immutable family parameters.Exact RSA-PSS parameters.Deeply immutable snapshot of installed algorithm identities.Trusted-code canonical codec for one typed algorithm-parameter schema.Marker interface for algorithm-specific key specifications.Immutable composition of a signature scheme and a compatible public-key identity.Marker interface for per-operation parameters.Context specification for algorithms that require no additional parameters.