Package org.bouncycastle.crypto.params
Class SM9EncMasterPublicKeyParameters
- java.lang.Object
-
- org.bouncycastle.crypto.params.AsymmetricKeyParameter
-
- org.bouncycastle.crypto.params.SM9EncMasterPublicKeyParameters
-
- All Implemented Interfaces:
CipherParameters
public class SM9EncMasterPublicKeyParameters extends AsymmetricKeyParameter
SM9 encryption master public key P_pub-e = [ke]P1, a point of G1 (GM/T 0044.4-2016). Note the group roles are swapped relative to signature: the encryption master public key lives in G1 and users' keys in G2.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SM9EncMasterPublicKeyParametersfromEncoded(byte[] enc)byte[]getEncoded()The master public key point P_pub-e of G1 in uncompressed form (0x04 || x || y, 65 bytes).SM9EncPublicKeyParametersgetUserPublicKey(byte[] identity)The encryption public key of the user identified byidentity: the recipient key a sender encapsulates to (or encrypts to), formed from this master public key and the identity under the encryption hid 0x03 (GM/T 0044.4).SM9EncPublicKeyParametersgetUserPublicKey(byte[] identity, byte hid)The public key of the user identified byidentityunder an explicit hid (0x03encryption/KEM,0x02key exchange) - use when the KGC's published hid differs from the encryption default.Fp12pairingWithP2()g = e(P_pub-e, P2), the fixed pairing value used by both encapsulation and encryption.ECPointrecipientPoint(byte[] identity)Q = [H1(identity||hid, N)]P1 + P_pub-e, the recipient's public key point in G1, using the encryption hid (0x03).ECPointrecipientPoint(byte[] identity, byte hid)Q = [H1(identity||hid, N)]P1 + P_pub-e for an explicit hid (0x03 encryption, 0x02 key exchange).-
Methods inherited from class org.bouncycastle.crypto.params.AsymmetricKeyParameter
isPrivate
-
-
-
-
Method Detail
-
getUserPublicKey
public SM9EncPublicKeyParameters getUserPublicKey(byte[] identity)
The encryption public key of the user identified byidentity: the recipient key a sender encapsulates to (or encrypts to), formed from this master public key and the identity under the encryption hid 0x03 (GM/T 0044.4). It is derived from the published master public key alone, so any sender can construct it without KGC interaction.
-
getUserPublicKey
public SM9EncPublicKeyParameters getUserPublicKey(byte[] identity, byte hid)
The public key of the user identified byidentityunder an explicit hid (0x03encryption/KEM,0x02key exchange) - use when the KGC's published hid differs from the encryption default.
-
recipientPoint
public ECPoint recipientPoint(byte[] identity)
Q = [H1(identity||hid, N)]P1 + P_pub-e, the recipient's public key point in G1, using the encryption hid (0x03).
-
recipientPoint
public ECPoint recipientPoint(byte[] identity, byte hid)
Q = [H1(identity||hid, N)]P1 + P_pub-e for an explicit hid (0x03 encryption, 0x02 key exchange).
-
pairingWithP2
public Fp12 pairingWithP2()
g = e(P_pub-e, P2), the fixed pairing value used by both encapsulation and encryption.
-
getEncoded
public byte[] getEncoded()
The master public key point P_pub-e of G1 in uncompressed form (0x04 || x || y, 65 bytes).
-
fromEncoded
public static SM9EncMasterPublicKeyParameters fromEncoded(byte[] enc)
-
-