Interface SM9EncMasterPublicKey
- All Superinterfaces:
AsymmetricKey, DEREncodablePREVIEW, Key, PublicKey, Serializable
Interface for an SM9 (GM/T 0044) encryption master public key, the published
root of the identity-based scheme.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteThe encryption private-key generation function identifier hid, 0x03 - the value the GM/T 0044.5-2016 Annex C/D worked examples publish for KEM and public-key encryption.static final byteThe key-exchange private-key generation function identifier hid, 0x02, as published by the Chinese edition of the GM/T 0044.5-2016 Annex B worked example (the official English edition of the same annex chose 0x03 - the KGC's published choice governs).Fields inherited from interface PublicKey
serialVersionUID -
Method Summary
Modifier and TypeMethodDescriptiongetExchangeEphemeral(byte[] encoded) Wrap a peer's key-exchange ephemeral value R, as received, for the finaldoPhaseofKeyAgreement.SM9- the encoding is the standard's 64-byte x || y form returned by the firstdoPhaseon the peer's side.getUserPublicKey(byte[] identity) Return the public key of the user identified byidentity: the key a sender encapsulates to.getUserPublicKey(byte[] identity, byte hid) Return the public key of the user identified byidentityunder an explicit hid -0x03for KEM / public-key encryption,0x02for key exchange; the KGC's published choice governs.Methods inherited from interface AsymmetricKey
getParamsMethods inherited from interface Key
getAlgorithm, getEncoded, getFormat
-
Field Details
-
HID
static final byte HIDThe encryption private-key generation function identifier hid, 0x03 - the value the GM/T 0044.5-2016 Annex C/D worked examples publish for KEM and public-key encryption. hid is not fixed by the standard: GM/T 0044.3-2016 defines it as the "identifier of the encryption private key generating function, denoted by one byte", chosen and published by the KGC. These are the two values the published GM/T 0044 examples use.- See Also:
-
HID_EXCHANGE
static final byte HID_EXCHANGEThe key-exchange private-key generation function identifier hid, 0x02, as published by the Chinese edition of the GM/T 0044.5-2016 Annex B worked example (the official English edition of the same annex chose 0x03 - the KGC's published choice governs).- See Also:
-
-
Method Details
-
getUserPublicKey
Return the public key of the user identified byidentity: the key a sender encapsulates to. It is derived from the master public key and the identity alone, so any sender holding the published master public key can construct it - no certificate or KGC interaction is needed.- Parameters:
identity- the user's identity.- Returns:
- the user's public key.
-
getUserPublicKey
Return the public key of the user identified byidentityunder an explicit hid -0x03for KEM / public-key encryption,0x02for key exchange; the KGC's published choice governs.- Parameters:
identity- the user's identity.hid- the private-key generation function identifier the KGC chose.- Returns:
- the user's public key.
-
getExchangeEphemeral
Wrap a peer's key-exchange ephemeral value R, as received, for the finaldoPhaseofKeyAgreement.SM9- the encoding is the standard's 64-byte x || y form returned by the firstdoPhaseon the peer's side. A value that is not a point of G1, or is the point at infinity, is rejected here rather than reaching the pairing.- Parameters:
encoded- the peer's ephemeral value R, 64 bytes.- Returns:
- the peer's ephemeral value, to pass to
doPhase.
-