java.security
Class SignatureSpi
java.lang.Object
|
+--java.security.SignatureSpi
public abstract class
SignatureSpiextends
ObjectSignatureSpi defines the Service Provider Interface (SPI)
for the Signature class. The signature class provides an
interface to a digital signature algorithm. Digital signatures
are used for authentication and integrity of data.
Since:Author:- Mark Benvenuto <ivymccough@worldnet.att.net>
appRandom
protected SecureRandom appRandom
Source of randomness
SignatureSpi
public SignatureSpi()
Creates a new instance of SignatureSpi.
clone
public Object clone()
Returns a clone if cloneable.
Returns:
Throws:
engineGetParameter
protected Object engineGetParameter(java.lang.String param)
Gets the value for the specified algorithm parameter.
Parameters:
Returns:
Throws:
engineInitSign
protected void engineInitSign(java.security.PrivateKey privateKey)
Initializes this class with the private key for
signing purposes.
Parameters:
Throws:
engineInitSign
protected void engineInitSign(java.security.PrivateKey privateKey, java.security.SecureRandom random)
Initializes this class with the private key and source
of randomness for signing purposes.
This cannot be abstract backward compatibility reasons
Since:Parameters:
Throws:
engineInitVerify
protected void engineInitVerify(java.security.PublicKey publicKey)
Initializes this class with the public key for
verification purposes.
Parameters:
Throws:
engineSetParameter
protected void engineSetParameter(java.lang.String param, java.lang.Object value)
Sets the specified algorithm parameter to the specified value.
Parameters:
Throws:
engineSetParameter
protected void engineSetParameter(java.security.spec.AlgorithmParameterSpec params)
Sets the signature engine with the specified
AlgorithmParameterSpec;
This cannot be abstract backward compatibility reasons
By default this always throws UnsupportedOperationException
if not overridden;
Parameters:
Throws:
engineSign
protected byte[] engineSign()
Returns the signature bytes of all the data fed to this class.
The format of the output depends on the underlying signature
algorithm.
Returns:
Throws:
engineSign
protected int engineSign(byte[] outbuf, int offset, int len)
Generates signature bytes of all the data fed to this class
and outputs it to the passed array. The format of the
output depends on the underlying signature algorithm.
This cannot be abstract backward compatibility reasons.
After calling this method, the signature is reset to its
initial state and can be used to generate additional
signatures.
Since:Parameters:
Returns:
- number of bytes in outbuf
Throws:
engineUpdate
protected void engineUpdate(byte b)
Updates the data to be signed or verified with the specified
byte.
Parameters:
Throws:
engineUpdate
protected void engineUpdate(byte[] b, int off, int len)
Updates the data to be signed or verified with the specified
bytes.
Parameters:
Throws:
engineVerify
protected boolean engineVerify(byte[] sigBytes)
Verifies the passed signature.
Parameters:
Returns:
- true if verified, false otherwise
Throws: