public static class SigContext.SigContextSpec extends Object implements AlgorithmParameterSpec
AlgorithmParameterSpec to provide context-specific
data for cryptographic signature operations using personalized hash functions.
The context data is used as domain separation to prevent signature replay attacks
across different I2P protocols and data types.
Purpose and Security:
Format and Validation:
IllegalArgumentExceptionUsage:
// Get context specification for datagram signatures SigContextSpec spec = SigContext.SC_DATAGRAM.getSpec(); // Apply to signature engine signatureEngine.setParameter(spec);
Supported Contexts:
Thread Safety: This class is immutable and thread-safe. The returned byte array should not be modified by callers.
AlgorithmParameterSpec,
SigContext| Constructor and Description |
|---|
SigContextSpec(String context)
Creates a signature context specification from the given context string.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getData()
Returns the raw context data for cryptographic operations.
|
public SigContextSpec(String context)
context - the ASCII context string, must be exactly 16 characters,
or null for no context (SC_NONE)IllegalArgumentException - if the context string is not exactly 16 characters