All Packages Class Hierarchy This Package Previous Next Index
Class au.net.aba.crypto.provider.MD5withRSA
java.lang.Object
|
+----java.security.Signature
|
+----au.net.aba.crypto.provider.MD5withRSA
- public class MD5withRSA
- extends Signature
This algorithm implements the Signature algorithm of "MD5 with RSA"
as defined in PKCS#1. The algorithm returns an ecnrypted block
containing an ASN.1 DigestInfo structure.
AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL
}
DigestInfo ::= SEQUENCE {
digestAlgorithm DigestAlgorithmIdentifier,
digest Digest }
digestAlgorithmIdentifier ::= AlgorithmIdentifier
Digest ::= OCTET STRING
id-md5 OBJECT IDENTIFIER ::= { 1 2 840 113549 2 5 }
md5Identifier :== AlgorithmIdentifier { id-md5, NULL }
-
MD5withRSA()
-
-
engineGetParameter(String)
- This algorithm does not support parameters.
-
engineInitSign(PrivateKey)
- Initializes this signature object with the specified
private key for signing operations.
-
engineInitVerify(PublicKey)
- Initializes this signature object with the specified
public key for verification operations.
-
engineSetParameter(String, Object)
- This algorithm does not support parameters.
-
engineSign()
-
Returns the signature block for all the data update so far.
-
engineUpdate(byte)
- Updates the data to be signed or verified using the specified byte.
-
engineUpdate(byte[], int, int)
- Updates the data to be signed or verified, using the specified
array of bytes, starting at the specified offset.
-
engineVerify(byte[])
-
Verifies the passed-in signature.
MD5withRSA
public MD5withRSA()
engineInitVerify
protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException
- Initializes this signature object with the specified
public key for verification operations.
- Parameters:
- publicKey - the public key of the identity whose signature is
going to be verified.
- Throws: InvalidKeyException
- if the key is improperly
encoded, parameters are missing, and so on.
- Overrides:
- engineInitVerify in class Signature
engineInitSign
protected void engineInitSign(PrivateKey privateKey) throws InvalidKeyException
- Initializes this signature object with the specified
private key for signing operations.
- Parameters:
- privateKey - the private key of the identity whose signature
will be generated.
- Throws: InvalidKeyException
- if the key is improperly
encoded, parameters are missing, and so on.
- Overrides:
- engineInitSign in class Signature
engineUpdate
protected void engineUpdate(byte b) throws SignatureException
- Updates the data to be signed or verified using the specified byte.
- Parameters:
- b - the byte to use for the update.
- Throws: SignatureException
- if the engine is not initialized
properly.
- Overrides:
- engineUpdate in class Signature
engineUpdate
protected void engineUpdate(byte b[],
int off,
int len) throws SignatureException
- Updates the data to be signed or verified, using the specified
array of bytes, starting at the specified offset.
- Parameters:
- data - the array of bytes.
- off - the offset to start from in the array of bytes.
- len - the number of bytes to use, starting at offset.
- Throws: SignatureException
- if the engine is not initialized
properly.
- Overrides:
- engineUpdate in class Signature
engineSign
protected byte[] engineSign() throws SignatureException
- Returns the signature block for all the data update so far.
This block is a PKCS#1 encrypted block of a BER encoded
ASN.1 DigestInfo block.
- Returns:
- the signature bytes of the signing operation's result.
- Throws: SignatureException
- if the engine is not
initialized properly.
- Overrides:
- engineSign in class Signature
engineVerify
protected boolean engineVerify(byte sigBytes[]) throws SignatureException
- Verifies the passed-in signature. The signature block is
an RSA encrypted block containing a DER encoded ASN.1
DigestInfo structure.
- Returns:
- true if the signature was verfied, false if not.
- Overrides:
- engineVerify in class Signature
engineSetParameter
protected void engineSetParameter(String param,
Object value) throws InvalidParameterException
- This algorithm does not support parameters. This method
will throw an exception to indicate so.
- Overrides:
- engineSetParameter in class Signature
engineGetParameter
protected Object engineGetParameter(String param) throws InvalidParameterException
- This algorithm does not support parameters. This method
will throw an exception to indicate so.
- Overrides:
- engineGetParameter in class Signature
All Packages Class Hierarchy This Package Previous Next Index