Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > BOOK: Beginning Cryptography with Java
|
BOOK: Beginning Cryptography with Java
This is the forum to discuss the Wrox book Beginning Cryptography with Java by David Hook; ISBN: 9780764596339
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Cryptography with Java section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 10th, 2012, 03:35 PM
Registered User
 
Join Date: May 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question Manually embedding of RSA digital signature into CMS structure

Hi David,

Do you know if its possible to manually embed a previously calculated 1024 bits RSA digital signature into a CMS. With bouncycastle, the way I saw to sign data and generate a CMSSignedData structure is done with 'generate' method of CMSSignedDataGenerator.

This method requires as Input the private key that will be used for signing. In my case I can't do that as I'm calculating the digital signature of a SHA-1 hash using a smartcard, at the APDU level. After performing the digital signature (with a previous authentication in order to gain access to the private key that never leaves the card), the card returns a 128 bytes answer (the pure 1024 bits signature).

I'm requested to return this signature as a CMSSignedData object, that includes the hash to be signed (SHA1, 20 bytes), the signed hash (this 128 bytes), and the public key certificate associated with the private key that has been used to sign.

I've all the things separated: the hash, the signed hash and the X509 Public Key Certificate, but I don't know how to manually construct a valid CMSSignedData struct with all these.

Do you know how this can be done with BouncyCastle? or any other way to achieve it?

Thank you in advance!
Best Regards,

Lautaro.
 
Old May 11th, 2012, 04:44 AM
dgh dgh is offline
Wrox Author
 
Join Date: Aug 2005
Posts: 206
Thanks: 0
Thanked 20 Times in 20 Posts
Default

Have a look at the new API in BC 1.47. You'll need to use the ContentSigner interface.

Regards,

David





Similar Threads
Thread Thread Starter Forum Replies Last Post
Digital Signature for SoapRequest fullingdale BOOK: Professional C# 4.0 and .NET 4 0 August 24th, 2011 10:33 AM
how to implement the digital signature kotaiah J2EE 0 May 11th, 2007 05:06 AM
How to create Digital Signature using certificate iron_ ASP.NET 1.0 and 1.1 Professional 0 September 5th, 2005 10:02 PM
Incorporate Signature thru Digital Pad ashu_gupta75 Classic ASP Basics 0 May 14th, 2004 01:24 AM
Digital signature verification using PHP. Hawk PHP How-To 0 July 16th, 2003 08:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.