Class CipherSpi

java.lang.Object
javax.crypto.CipherSpi
org.bouncycastle.jcajce.provider.asymmetric.sm9.CipherSpi

public class CipherSpi extends CipherSpi
JCA Cipher for SM9 public-key encryption (GM/T 0044.4).

Encrypt with the recipient's public key, formed from the published master public key and the recipient's identity via SM9EncMasterPublicKey.getUserPublicKey(byte[]) (the same recipient key the SM9-KEM encapsulates to); decrypt with the recipient's private key. The ciphertext is a DER SM9Cipher whose enType records the data-encapsulation mode, so decryption selects the mode automatically. The default encryption mode is SM4/ECB/PKCS#7 (enType = 1); call setMode("XOR") for the KDF stream mode.

The ciphertext is the GM/T 0080-2020 SM9Cipher structure (see SM9Cipher).