Class 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 SM9EncMasterPublicKeyParameters fromEncoded​(byte[] enc)  
      byte[] getEncoded()
      The master public key point P_pub-e of G1 in uncompressed form (0x04 || x || y, 65 bytes).
      SM9EncPublicKeyParameters getUserPublicKey​(byte[] identity)
      The encryption public key of the user identified by identity: 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).
      SM9EncPublicKeyParameters getUserPublicKey​(byte[] identity, byte hid)
      The public key of the user identified by identity under an explicit hid (0x03 encryption/KEM, 0x02 key exchange) - use when the KGC's published hid differs from the encryption default.
      Fp12 pairingWithP2()
      g = e(P_pub-e, P2), the fixed pairing value used by both encapsulation and encryption.
      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).
      ECPoint recipientPoint​(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 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getUserPublicKey

        public SM9EncPublicKeyParameters getUserPublicKey​(byte[] identity)
        The encryption public key of the user identified by identity: 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 by identity under an explicit hid (0x03 encryption/KEM, 0x02 key 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).