| java.lang.Object java.security.SignatureSpi sun.security.mscapi.RSASignature
RSASignature | abstract class RSASignature extends java.security.SignatureSpi (Code) | | RSA signature implementation. Supports RSA signing using PKCS#1 v1.5 padding.
Objects should be instantiated by calling Signature.getInstance() using the
following algorithm names:
. "SHA1withRSA"
. "MD5withRSA"
. "MD2withRSA"
Note: RSA keys must be at least 512 bits long
since: 1.6 author: Stanley Man-Kit Ho |
Inner Class :final public static class SHA1 extends RSASignature | |
Inner Class :final public static class MD5 extends RSASignature | |
Inner Class :final public static class MD2 extends RSASignature | |
Method Summary | |
protected Object | engineGetParameter(String param) Gets the value of the specified algorithm parameter. | protected void | engineInitSign(PrivateKey key) Initializes this signature object with the specified
private key for signing operations.
Parameters: privateKey - the private key of the identity whose signaturewill be generated. exception: InvalidKeyException - if the key is improperlyencoded, parameters are missing, and so on. | protected void | engineInitVerify(PublicKey key) Initializes this signature object with the specified
public key for verification operations.
Parameters: publicKey - the public key of the identity whose signature isgoing to be verified. exception: InvalidKeyException - if the key is improperlyencoded, parameters are missing, and so on. | protected void | engineSetParameter(String param, Object value) Sets the specified algorithm parameter to the specified
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 void | engineUpdate(ByteBuffer input) Updates the data to be signed or verified, using the
specified ByteBuffer. | protected boolean | engineVerify(byte[] sigBytes) Verifies the passed-in signature. |
engineGetParameter | protected Object engineGetParameter(String param) throws InvalidParameterException(Code) | | Gets the value of the specified algorithm parameter.
This method supplies a general-purpose mechanism through which it
is possible to get the various parameters of this object. A parameter
may be any settable parameter for the algorithm, such as a parameter
size, or a source of random bits for signature generation (if
appropriate), or an indication of whether or not to perform a
specific but optional computation. A uniform algorithm-specific
naming scheme for each parameter is desirable but left unspecified
at this time.
Parameters: param - the string name of the parameter. the object that represents the parameter value, or null ifthere is none. exception: InvalidParameterException - if param is an invalid parameter for this engine, or another exception occurs whiletrying to get this parameter. |
engineInitSign | protected void engineInitSign(PrivateKey key) throws InvalidKeyException(Code) | | Initializes this signature object with the specified
private key for signing operations.
Parameters: privateKey - the private key of the identity whose signaturewill be generated. exception: InvalidKeyException - if the key is improperlyencoded, parameters are missing, and so on. |
engineInitVerify | protected void engineInitVerify(PublicKey key) throws InvalidKeyException(Code) | | Initializes this signature object with the specified
public key for verification operations.
Parameters: publicKey - the public key of the identity whose signature isgoing to be verified. exception: InvalidKeyException - if the key is improperlyencoded, parameters are missing, and so on. |
engineSetParameter | protected void engineSetParameter(String param, Object value) throws InvalidParameterException(Code) | | Sets the specified algorithm parameter to the specified
value. This method supplies a general-purpose mechanism through
which it is possible to set the various parameters of this object.
A parameter may be any settable parameter for the algorithm, such as
a parameter size, or a source of random bits for signature generation
(if appropriate), or an indication of whether or not to perform
a specific but optional computation. A uniform algorithm-specific
naming scheme for each parameter is desirable but left unspecified
at this time.
Parameters: param - the string identifier of the parameter. Parameters: value - the parameter value. exception: InvalidParameterException - if param is aninvalid parameter for this signature algorithm engine,the parameter is already setand cannot be set again, a security exception occurs, and so on. RSASignature.engineSetParameter(java.security.spec.AlgorithmParameterSpec)engineSetParameter |
engineSign | protected byte[] engineSign() throws SignatureException(Code) | | Returns the signature bytes of all the data
updated so far.
The format of the signature depends on the underlying
signature scheme.
the signature bytes of the signing operation's result. exception: SignatureException - if the engine is notinitialized properly or if this signature algorithm is unable toprocess the input data provided. |
engineUpdate | protected void engineUpdate(byte b) throws SignatureException(Code) | | Updates the data to be signed or verified
using the specified byte.
Parameters: b - the byte to use for the update. exception: SignatureException - if the engine is not initializedproperly. |
engineUpdate | protected void engineUpdate(byte[] b, int off, int len) throws SignatureException(Code) | | Updates the data to be signed or verified, using the
specified array of bytes, starting at the specified offset.
Parameters: b - the array of bytes Parameters: off - the offset to start from in the array of bytes Parameters: len - the number of bytes to use, starting at offset exception: SignatureException - if the engine is not initialized properly |
engineUpdate | protected void engineUpdate(ByteBuffer input)(Code) | | Updates the data to be signed or verified, using the
specified ByteBuffer.
Parameters: input - the ByteBuffer |
engineVerify | protected boolean engineVerify(byte[] sigBytes) throws SignatureException(Code) | | Verifies the passed-in signature.
Parameters: sigBytes - the signature bytes to be verified. true if the signature was verified, false if not. exception: 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 toprocess the input data provided, etc. |
|
|