Package org.bouncycastle.crypto.params
Class SM9SigPrivateKeyParameters
- java.lang.Object
-
- org.bouncycastle.crypto.params.AsymmetricKeyParameter
-
- org.bouncycastle.crypto.params.SM9SigPrivateKeyParameters
-
- All Implemented Interfaces:
javax.security.auth.Destroyable,CipherParameters
public class SM9SigPrivateKeyParameters extends AsymmetricKeyParameter implements javax.security.auth.Destroyable
A user's SM9 signature private key ds_A = [t2]P1, a point of G1 (GM/T 0044.2-2016). Generated by the KGC from the signature master private key and the user's identity. Carries the identity (needed by nothing in this class directly, but part of what a caller needs to identify the key) and a reference to the master public key, which the signer needs to compute g = e(P1, P_pub-s).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Destroy this object, dropping its reference to the private point ds and zeroizing the identity.static SM9SigPrivateKeyParametersfromEncoded(byte[] enc, SM9SigMasterPublicKeyParameters masterPublicKey, byte[] identity)byte[]getEncoded()The user's signature private key point ds of G1 in uncompressed form (0x04 || x || y, 65 bytes).byte[]getIdentity()SM9SigMasterPublicKeyParametersgetMasterPublicKey()ECPointgetPrivatePoint()booleanisDestroyed()-
Methods inherited from class org.bouncycastle.crypto.params.AsymmetricKeyParameter
isPrivate
-
-
-
-
Method Detail
-
getPrivatePoint
public ECPoint getPrivatePoint()
-
getMasterPublicKey
public SM9SigMasterPublicKeyParameters getMasterPublicKey()
-
getIdentity
public byte[] getIdentity()
-
getEncoded
public byte[] getEncoded()
The user's signature private key point ds of G1 in uncompressed form (0x04 || x || y, 65 bytes). The master public key and identity are not part of this encoding; supply them viafromEncoded(byte[], org.bouncycastle.crypto.params.SM9SigMasterPublicKeyParameters, byte[])to rebuild a usable key.
-
fromEncoded
public static SM9SigPrivateKeyParameters fromEncoded(byte[] enc, SM9SigMasterPublicKeyParameters masterPublicKey, byte[] identity)
-
destroy
public void destroy()
Destroy this object, dropping its reference to the private point ds and zeroizing the identity.As the point's coordinates are immutable they cannot be zeroized in place; destruction drops the reference and marks the key destroyed, after which
getPrivatePoint(),getEncoded()andgetIdentity()throwIllegalStateException. The master public key remains available.- Specified by:
destroyin interfacejavax.security.auth.Destroyable
-
isDestroyed
public boolean isDestroyed()
- Specified by:
isDestroyedin interfacejavax.security.auth.Destroyable
-
-