public class SM9KEMExtractor extends java.lang.Object implements EncapsulatedSecretExtractor
Usage warning: an identity's encryption key should be used for this mechanism
or for public-key encryption (SM9Engine), but
not for both. Where a deployment needs both functions for one identity, the KGC
publishes a separate hid for each - as it already does for the key exchange - so that
the two user keys are distinct. That is the arrangement the exchange-versus-KEM
separation the constructor requires below already follows. The constructor also refuses a
key declared for decryption, and one that has been used for it - see
SM9EncPrivateKeyParameters.recordUsage(int).
| Constructor and Description |
|---|
SM9KEMExtractor(SM9EncPrivateKeyParameters key,
int keyLenBits) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
extractSecret(byte[] encapsulation)
Extract the secret based on the recipient private key.
|
int |
getEncapsulationLength()
Return the length in bytes of the encapsulation.
|
public SM9KEMExtractor(SM9EncPrivateKeyParameters key, int keyLenBits)
public byte[] extractSecret(byte[] encapsulation)
EncapsulatedSecretExtractorextractSecret in interface EncapsulatedSecretExtractorencapsulation - the encapsulated secret.public int getEncapsulationLength()
EncapsulatedSecretExtractorgetEncapsulationLength in interface EncapsulatedSecretExtractor