|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.security.SignatureSpi
|
+--java.security.Signature
|
+--iaik.security.rsa.RSASignature
|
+--iaik.security.rsa.Md2RSASignature
This class extends the RSASignature class for providing the functionality of the RSA digital signature algorithm using MD2 as message digest algorithm.
This class only creates a new RSASignature object and sets the hash
function to be used to MD2.
The "MD2 with RSA" signature algorithm is described in PKCS#1 and is recommended to be used in signing X.509/PEM certificates, certificate-revocation lists, PKCS#6 extended certificates, and other objects employing digital signatures such as X.401 message tokens. The algorithms presented in PKCS#1 are not intended to be used in PKCS#7, where signatures (encrypted message digests) are treated as octet strings, in contrast to the bit string interpretation of PKCS#1.
An application wishing to sign some message (e.g. the TBSCertificate contents of a X.509 certificate) or to verify some signature using the "MD2 with RSA" algorithm, generally has to perform three steps:
getInstance method, e.g.
Signature md2_rsa = Signature.getInstance("MD2/RSA");
md2_rsa.initSign(rsaPrivateKey);
md2_rsa.initVerify(rsaPublicKey);
sign method returning the signature as DER encoded
byte array. Otherwise, if the Signature object has been initialized for
verifying, first the data to be verified is supplied to the Signature object,
and subsequently the signature is verified by calling the verify
method, supplied with the DER encoded byte array holding the corresponding
signature:
md2_rsa.update(data); byte[] signature = md2_rsa.sign();
md2_rsa.update(data);
System.out.println("Signature " + (md2_rsa.verify(signature) ? "correct!" : "not correct!"));
RSASignature,
Md5RSASignature,
ShaRSASignature,
SSLRSASignature,
Signature,
Md2| Fields inherited from class iaik.security.rsa.RSASignature |
hash |
| Fields inherited from class java.security.Signature |
SIGN,
state,
UNINITIALIZED,
VERIFY |
| Fields inherited from class java.security.SignatureSpi |
appRandom |
| Constructor Summary | |
Md2RSASignature()
Default Constructor. |
|
| Methods inherited from class iaik.security.rsa.RSASignature |
engineGetParameter,
engineInitSign,
engineInitVerify,
engineSetParameter,
engineSign,
engineUpdate,
engineUpdate,
engineVerify |
| Methods inherited from class java.security.Signature |
clone,
getAlgorithm,
getInstance,
getInstance,
getParameter,
getProvider,
initSign,
initSign,
initVerify,
setParameter,
setParameter,
sign,
sign,
toString,
update,
update,
update,
verify |
| Methods inherited from class java.security.SignatureSpi |
engineInitSign,
engineSetParameter,
engineSign |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public Md2RSASignature()
Applications do not call this constructor. They shall use one of the
getInstance methods of the java.security.Signature
class for obtaining a Md2RSASignature object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||