Class SM9KEMKeyGeneratorSpi
- java.lang.Object
-
- javax.crypto.KeyGeneratorSpi
-
- org.bouncycastle.jcajce.provider.asymmetric.sm9.SM9KEMKeyGeneratorSpi
-
public class SM9KEMKeyGeneratorSpi extends javax.crypto.KeyGeneratorSpiJCAKeyGeneratorbridge for the SM9 key encapsulation mechanism (GM/T 0044.4-2016). Registered asKeyGenerator.SM9-KEM; initialise with:- a
KEMGenerateSpecto encapsulate - itsPublicKeymust be aBCSM9EncPublicKey(the recipient's master public key + identity); or - a
KEMExtractSpecto decapsulate - itsPrivateKeymust be aBCSM9EncPrivateKey(the recipient's extracted decryption key).
keySizeInBits) drives SM9's own GM/T 0044.4 KDF, which produces the shared key directly; the spec's generic KDF fields are therefore not applied (an external KDF on top would break interoperability with other GM/T 0044.4 implementations - callers who want one anyway can layer it via thejavax.crypto.KEMAPI,KEM.SM9-KEM, with a KTSParameterSpec KDF).engineGenerateKeyreturns aSecretKeyWithEncapsulation. - a
-
-
Constructor Summary
Constructors Constructor Description SM9KEMKeyGeneratorSpi()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.crypto.SecretKeyengineGenerateKey()protected voidengineInit(int keySize, java.security.SecureRandom random)protected voidengineInit(java.security.SecureRandom random)protected voidengineInit(java.security.spec.AlgorithmParameterSpec spec, java.security.SecureRandom random)
-
-
-
Method Detail
-
engineInit
protected void engineInit(java.security.SecureRandom random)
- Specified by:
engineInitin classjavax.crypto.KeyGeneratorSpi
-
engineInit
protected void engineInit(int keySize, java.security.SecureRandom random)- Specified by:
engineInitin classjavax.crypto.KeyGeneratorSpi
-
engineInit
protected void engineInit(java.security.spec.AlgorithmParameterSpec spec, java.security.SecureRandom random) throws java.security.InvalidAlgorithmParameterException- Specified by:
engineInitin classjavax.crypto.KeyGeneratorSpi- Throws:
java.security.InvalidAlgorithmParameterException
-
engineGenerateKey
protected javax.crypto.SecretKey engineGenerateKey()
- Specified by:
engineGenerateKeyin classjavax.crypto.KeyGeneratorSpi
-
-