|
Bouncy Castle Cryptography Library 1.86 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.bouncycastle.crypto.engines.SM9Engine
The SM9 public key encryption algorithm (GM/T 0044.4-2016, clause 7). Two
data-encapsulation methods are supported: a KDF-based stream cipher
(SM9Engine.Mode.STREAM) and SM4 in ECB mode with PKCS#7 padding
(SM9Engine.Mode.SM4). The ciphertext is C = C1 || C3 || C2, where C1 is the
G1 point [r]Q_B encoded as x||y, C3 = MAC(K2, C2), and C2 is the encapsulated
message.
Usage follows the SM2Engine pattern: construct with the desired mode,
to encrypt or
to decrypt, then processBlock(byte[], int, int).
| Nested Class Summary | |
static class |
SM9Engine.Mode
The GM/T 0044.4-2016 data-encapsulation method. |
| Constructor Summary | |
SM9Engine()
Base constructor: SM4 data encapsulation ( SM9Engine.Mode.SM4). |
|
SM9Engine(SM9Engine.Mode mode)
|
|
| Method Summary | |
int |
getOutputSize(int inputLen)
Return an upper bound for the output produced by processBlock(byte[], int, int) on
input bytes (exact for encryption and stream-mode decryption,
an upper bound for SM4-mode decryption, whose padding length is unknown until
removed). |
void |
init(boolean forEncryption,
CipherParameters param)
Initialise the engine. |
byte[] |
processBlock(byte[] in,
int inOff,
int inLen)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SM9Engine()
SM9Engine.Mode.SM4).
public SM9Engine(SM9Engine.Mode mode)
| Method Detail |
public void init(boolean forEncryption,
CipherParameters param)
SM9EncPublicKeyParameters, optionally wrapped in a
ParametersWithRandom; for decryption pass the user's
SM9EncPrivateKeyParameters.
public int getOutputSize(int inputLen)
processBlock(byte[], int, int) on
input bytes (exact for encryption and stream-mode decryption,
an upper bound for SM4-mode decryption, whose padding length is unknown until
removed).
public byte[] processBlock(byte[] in,
int inOff,
int inLen)
throws InvalidCipherTextException
InvalidCipherTextException
|
Bouncy Castle Cryptography Library 1.86 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||