public abstract class AbstractSignatureSpi extends SignatureSpi
sun.security.ec.ECDSASignature and
sun.security.rsa.RSASignature.appRandom| Constructor and Description |
|---|
AbstractSignatureSpi(String messageDigestAlgorithmName) |
| Modifier and Type | Method and Description |
|---|---|
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 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[] |
getDigestValue()
Returns the message digest value.
|
protected abstract byte[] |
implSign(byte[] digestValue) |
protected abstract boolean |
implVerify(byte[] sigBytes,
byte[] digestValue) |
protected void |
resetDigest()
Resets the message digest if needed.
|
protected abstract void |
setKeys(PublicKey publicKey,
PrivateKey privateKey)
Sets the public and private keys for this signature.
|
clone, engineInitSign, engineSetParameter, engineSign, engineVerifypublic AbstractSignatureSpi(String messageDigestAlgorithmName)
protected void engineInitSign(PrivateKey privateKey) throws InvalidKeyException
SignatureSpiengineInitSign in class SignatureSpiprivateKey - the private key of the identity whose signature will be generated.InvalidKeyException - if the key is improperly encoded, parameters are missing, and so on.protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException
SignatureSpiengineInitVerify in class SignatureSpipublicKey - the public key of the identity whose signature is going to be verified.InvalidKeyException - if the key is improperly encoded, parameters are missing, and so on.protected byte[] engineSign()
throws SignatureException
SignatureSpiengineSign in class SignatureSpiSignatureException - if the engine is not initialized properly or if this signature algorithm is unable to process the
input data provided.protected void engineUpdate(byte b)
throws SignatureException
SignatureSpiengineUpdate in class 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
SignatureSpiengineUpdate in class 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 boolean engineVerify(byte[] sigBytes)
throws SignatureException
SignatureSpiengineVerify in class 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.protected byte[] getDigestValue()
throws SignatureException
SignatureExceptionprotected abstract byte[] implSign(byte[] digestValue)
protected abstract boolean implVerify(byte[] sigBytes,
byte[] digestValue)
protected void resetDigest()
protected abstract void setKeys(PublicKey publicKey, PrivateKey privateKey) throws InvalidKeyException
publicKey - the public key to setprivateKey - the private key to setInvalidKeyException - if one of the keys is invalid.