public class SM9SigMasterPrivateKeyParameters extends AsymmetricKeyParameter implements javax.security.auth.Destroyable, SM9SigUserKeyParametersGenerator
| Modifier and Type | Field and Description |
|---|---|
static byte |
HID
The signature private-key generation function identifier hid, fixed to
0x01 for the SM9 signature algorithm (GM/T 0044.2-2016, Annex A).
|
| Constructor and Description |
|---|
SM9SigMasterPrivateKeyParameters(java.math.BigInteger ks) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy this object, dropping its reference to the master secret ks.
|
static SM9SigMasterPrivateKeyParameters |
fromEncoded(byte[] enc) |
SM9SigPrivateKeyParameters |
generateUserKey(byte[] identity)
Derive the signature private key for the user identified by
identity
(GM/T 0044.2-2016, 5.3): t1 = H1(identity||hid, N) + ks; if t1 = 0 the master
key must be regenerated; otherwise t2 = ks*t1^-1 and ds = [t2]P1. |
byte[] |
getEncoded()
The master private key ks as a 32-byte big-endian scalar.
|
SM9SigMasterPublicKeyParameters |
getPublicKeyParameters() |
boolean |
isDestroyed() |
isPrivatepublic static final byte HID
public SM9SigMasterPrivateKeyParameters(java.math.BigInteger ks)
public SM9SigMasterPublicKeyParameters getPublicKeyParameters()
public byte[] getEncoded()
public static SM9SigMasterPrivateKeyParameters fromEncoded(byte[] enc)
public SM9SigPrivateKeyParameters generateUserKey(byte[] identity)
identity
(GM/T 0044.2-2016, 5.3): t1 = H1(identity||hid, N) + ks; if t1 = 0 the master
key must be regenerated; otherwise t2 = ks*t1^-1 and ds = [t2]P1.generateUserKey in interface SM9SigUserKeyParametersGeneratoridentity - the user's identity.public void destroy()
As BigInteger is immutable the secret value cannot be zeroized in place;
destruction drops the reference and marks the key destroyed, after which
getEncoded() and generateUserKey(byte[]) throw
IllegalStateException. The public key parameters remain available.
destroy in interface javax.security.auth.Destroyablepublic boolean isDestroyed()
isDestroyed in interface javax.security.auth.Destroyable