Signature.SM9, Cipher.SM9, KeyAgreement.SM9 and the SM9 KEM through
KeyGenerator.SM9-KEM (and KEM.SM9-KEM on Java 21 and later).See: Description
| Class | Description |
|---|---|
| CipherSpi |
JCA
Cipher for SM9 public-key encryption (GM/T 0044.4). |
| KeyAgreementSpi |
JCA adapter for the SM9 key exchange protocol (GM/T 0044.3-2016), registered as
KeyAgreement.SM9. |
| KeyFactorySpi |
KeyFactory for the SM9 master keys (
sm9sign and sm9encrypt): the master
public and private keys round-trip through their JCA X.509 / PKCS#8 encodings (the GM/T 0080-2020 key
material under the GM algorithm OID; the bare GM/T 0080-2020 form is the lightweight
key-parameter class's getEncoded()). |
| KeyPairGeneratorSpi |
Generator for SM9 encryption master key pairs (GM/T 0044.4), registered as
KeyPairGenerator.SM9-ENC: the KGC's randomly-generated root of the scheme. |
| KeyPairGeneratorSpi.Sign |
Generator for the SM9 signature master key pair (GM/T 0044.2), registered as
KeyPairGenerator.SM9-SIGN. |
| SignatureSpi |
JCA
SM9 signature (GM/T 0044.2). |
| SM9KEMKeyGeneratorSpi |
JCA
KeyGenerator bridge for the SM9 key encapsulation mechanism
(GM/T 0044.4-2016). |
Signature.SM9, Cipher.SM9, KeyAgreement.SM9 and the SM9 KEM through
KeyGenerator.SM9-KEM (and KEM.SM9-KEM on Java 21 and later). The public key
interfaces these classes implement are in org.bouncycastle.jcajce.interfaces; the
lightweight implementation they wrap is described in org.bouncycastle.math.ec.sm9.
Serialization. Only the master keys are serializable. Each is written as an
SM9KeyProxy holding its standard encoding, and rebuilt through the key factory by the
proxy's readResolve; the user keys and the key exchange's ephemeral keys refuse to be
written, and no key class accepts a stream that names it directly. A deserialization filter
(java.io.ObjectInputFilter) is also shown the object readResolve returns, so an
allow-list for SM9 master keys has to name the resolved class as well as the proxy and the byte
array it carries, for example:
org.bouncycastle.jcajce.provider.asymmetric.sm9.SM9KeyProxy; org.bouncycastle.jcajce.provider.asymmetric.sm9.BCSM9SigMasterPublicKey; org.bouncycastle.jcajce.provider.asymmetric.sm9.BCSM9SigMasterPrivateKey; org.bouncycastle.jcajce.provider.asymmetric.sm9.BCSM9EncMasterPublicKey; org.bouncycastle.jcajce.provider.asymmetric.sm9.BCSM9EncMasterPrivateKey; [B;!*(as one pattern string, without the line breaks). A filter naming the proxy alone rejects every SM9 key. Serialization carries no integrity protection: a stream yields whatever well-formed master key it encodes, so a stored key that must not be substituted or corrupted needs protecting by the application.