hi can any one tell whats wrong i am doing in this code...
I sign the Message using Java IBMFIPS compliant the code to sign the message
is
//Signs the hash of each chunk and adds it to the Message Header
//data is 256Kb length
//Get private key function is created by me to read the DER key formated
file
GetPrivateKey privkey = new GetPrivateKey();
Signature genSign = Signature.getInstance("SHA1withRSA","IBMJCEFIPS");
genSign.initSign(privkey.get());
genSign.update(data.getBytes());
byte[] byteSignedData = genSign.sign();
Get Private Key function code
File privateKeyFile = new File("Certificates" +
File.separator+"mykey.der");
byte[] encodedKey = new byte[(int)privateKeyFile.length()];
new FileInputStream(privateKeyFile).read(encodedKey);
PKCS8EncodedKeySpec privateKeySpec = new
PKCS8EncodedKeySpec(encodedKey);
KeyFactory kf = KeyFactory.getInstance("RSA","IBMJCEFIPS");
RSAPrivateCrtKey privatekey = (RSAPrivateCrtKey)
.generatePrivate(privateKeySpec);
return privatekey;
I am verifying this signature using openssl 0.9.8g, RSA_Verify() function.
--
View this message in context:
http://old.nabble.com/RSA_Verify-error%3A04077064%3Arsa-routines%3ARSA_verify%3Aalgorithm-mismatch-tp32478403p32478403.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [email protected]
Automated List Manager [email protected]