[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-jce] Verifying PKCS#7 signature



Hi!

I have created an explicitly signed message:

				SignedContent signed = new
SignedContent(false);
				signed.setDataHandler(dh);
	
signed.setSigner((RSAPrivateKey)key_store.getKey(signerID,
"password".toCharArray()),
(X509Certificate)key_store.getCertificate(signerID));
				setContent(signed,
signed.getContentType());

I tried to verify the signature with:

	
signed.verify(((X509Certificate)key_store.getCertificate(receiverId)).ge
tPublicKey());

and got this exception:

java.security.SignatureException: javax.crypto.BadPaddingException:
Invalid PKCS#1 padding: no leading zero!
	at iaik.pkcs.pkcs7.SignerInfo.getDigest(Unknown Source)
	at iaik.pkcs.pkcs7.SignedDataStream.verify(Unknown Source)
	at iaik.security.smime.SMimeSigned.verify(Unknown Source)
	at iaik.security.smime.SignedContent.verify(Unknown Source)
	at MyMimePartMessage.verifySmime(MyMimePartMessage.java:170)
	at MyMimePartMessage.storeEdiData(Compiled Code)
	at MyMimePartMessage.main(MyMimePartMessage.java:223)

Any idea what's wrong?

Best Regards,
Christian
-- 
SEEBURGER GmbH, Ruiter Str. 2, D-75015 Bretten, Germany
SEEBURGER elecronic commerce GmbH & Co.KG - SEEBURGER EDI*CASH
GmbH&Co.KG
Fax: +49 (0)7252 9358-33 - Fon: +49 (0)7252 9358-291 -
<URL:http://www.seeburger.de/>

--
Mailinglist-archive at http://jcewww.iaik.tu-graz.ac.at/mailarchive/iaik-jce/maillist.html

To unsubscribe send an email to listserv@iaik.tu-graz.ac.at with the folowing content: UNSUBSCRIBE iaik-jce