public class SM2SignatureSpi extends SignatureSpi
| 限定符和类型 | 类和说明 |
|---|---|
static class |
SM2SignatureSpi.sm3WithSM2 |
| 限定符和类型 | 字段和说明 |
|---|---|
private ByteArrayOutputStream |
byteBuf |
private MessageDigest |
digest |
private ECPrivateKey |
privateKey |
private ECPublicKey |
publicKey |
private ECPoint |
pubPoint |
private SM2ParameterSpec |
sigParams |
private byte[] |
z |
appRandom| 构造器和说明 |
|---|
SM2SignatureSpi() |
SM2SignatureSpi(MessageDigest digest) |
| 限定符和类型 | 方法和说明 |
|---|---|
private BigInteger[] |
decodeSignature(BigInteger n,
byte[] sig) |
private byte[] |
encodeSignature(BigInteger n,
BigInteger r,
BigInteger s) |
protected Object |
engineGetParameter(String param)
已过时。
|
protected AlgorithmParameters |
engineGetParameters() |
protected void |
engineInitSign(PrivateKey privateKey)
Initializes this signature object with the specified
private key for signing operations.
|
protected void |
engineInitVerify(PublicKey publicKey)
Initializes this signature object with the specified
public key for verification operations.
|
protected void |
engineSetParameter(AlgorithmParameterSpec params) |
protected void |
engineSetParameter(String param,
Object value)
已过时。
|
protected byte[] |
engineSign()
Returns the signature bytes of all the data
updated so far.
|
protected void |
engineUpdate(byte b)
Updates the data to be signed or verified
using the specified byte.
|
protected void |
engineUpdate(byte[] b,
int off,
int len)
Updates the data to be signed or verified, using the
specified array of bytes, starting at the specified offset.
|
protected boolean |
engineVerify(byte[] sigBytes)
Verifies the passed-in signature.
|
protected byte[] |
getID()
Get user ID
|
private byte[] |
getZ(ECParameterSpec ecParams,
byte[] entLen,
byte[] ID) |
private static boolean |
isCompatible(SM2ParameterSpec sigParams,
ECParameterSpec keyParams) |
clone, engineInitSign, engineSign, engineUpdate, engineVerifyprivate final MessageDigest digest
private ECPrivateKey privateKey
private ECPublicKey publicKey
private SM2ParameterSpec sigParams
private ECPoint pubPoint
private ByteArrayOutputStream byteBuf
private byte[] z
public SM2SignatureSpi()
throws NoSuchAlgorithmException
public SM2SignatureSpi(MessageDigest digest)
protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException
engineInitVerify 在类中 SignatureSpipublicKey - the public key of the identity whose signature is
going to be verified.InvalidKeyExceptionprotected void engineInitSign(PrivateKey privateKey) throws InvalidKeyException
engineInitSign 在类中 SignatureSpiprivateKey - the private key of the identity whose signature
will be generated.InvalidKeyExceptionprotected byte[] getID()
protected void engineUpdate(byte b)
throws SignatureException
engineUpdate 在类中 SignatureSpib - the byte to use for the update.SignatureException - if the engine is not initialized
properly.protected void engineUpdate(byte[] b,
int off,
int len)
throws SignatureException
engineUpdate 在类中 SignatureSpib - the array of bytesoff - the offset to start from in the array of byteslen - the number of bytes to use, starting at offsetSignatureException - if the engine is not initialized
properlyprotected byte[] engineSign()
throws SignatureException
engineSign 在类中 SignatureSpiSignatureException - if the engine is not
initialized properly or if this signature algorithm is unable to
process the input data provided.protected boolean engineVerify(byte[] sigBytes)
throws SignatureException
engineVerify 在类中 SignatureSpisigBytes - the signature bytes to be verified.SignatureException - if the engine is not
initialized properly, the passed-in signature is improperly
encoded or of the wrong type, if this signature algorithm is unable to
process the input data provided, etc.@Deprecated protected void engineSetParameter(String param, Object value) throws InvalidParameterException
engineSetParameter 在类中 SignatureSpiInvalidParameterExceptionprotected void engineSetParameter(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException
@Deprecated protected Object engineGetParameter(String param) throws InvalidParameterException
engineGetParameter 在类中 SignatureSpiInvalidParameterExceptionprotected AlgorithmParameters engineGetParameters()
engineGetParameters 在类中 SignatureSpiprivate byte[] getZ(ECParameterSpec ecParams, byte[] entLen, byte[] ID)
private byte[] encodeSignature(BigInteger n, BigInteger r, BigInteger s) throws IOException
IOExceptionprivate BigInteger[] decodeSignature(BigInteger n, byte[] sig) throws SignatureException
private static boolean isCompatible(SM2ParameterSpec sigParams, ECParameterSpec keyParams)
Copyright © 2024. All rights reserved.