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 December 22nd, 2011, 01:25 AM
Registered User
 
Join Date: Dec 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Question Problem of compling KeyTransEnvelopedDataExample.java

Hi David,

When I complied KeyTransEnvelopedDataExample, I got the following compiling error. Thanks!

KeyTransEnvelopedDataExample.java:46:error: RecipientId is abstract; cannot be instantiated
RecipientId recId = new RecipientId();
 
Old December 22nd, 2011, 07:20 PM
dgh dgh is offline
Wrox Author
 
Join Date: Aug 2005
Posts: 206
Thanks: 0
Thanked 20 Times in 20 Posts
Default

Okay, the CMS API changed a bit in 1.46 - I think KeyTransRecipientId is the class you want. It would be worth looking at the new API, it's more flexible and it makes some things a lot easier.

Regards,

David
 
Old December 22nd, 2011, 09:15 PM
Registered User
 
Join Date: Dec 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Question New Problem for KeyTransEnvelopedDataExample.java

Hi David,

Based on your suggesion, I tried to modify the code for "RecipientId recId = new RecipientId();" using KeyTransRecipientId

I used he following three versions. However, the compiler still complains that no suitable constructor is found. How can I find right argument for KeyTransRecipientId constructor?

thanks

KeyTransRecipientId recId = new KeyTransRecipientId(cert.getPublicKey());

KeyTransRecipientId recId = new KeyTransRecipientId(cert.getIssuerX500Principal(). getName(), cert.getSerialNumber());

KeyTransRecipientId recId = new KeyTransRecipientId(cert.getIssuerX500Principal(). getEncoded(), cert.getSerialNumber());
 
Old December 22nd, 2011, 11:42 PM
dgh dgh is offline
Wrox Author
 
Join Date: Aug 2005
Posts: 206
Thanks: 0
Thanked 20 Times in 20 Posts
Default

You can take a lead from the set() calls on the old object. In this case the best one to use is JceKeyTransRecipientId and just pass it the certificate.

Regards,

David





Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Applet problem chris1012 Java Basics 0 January 18th, 2009 01:57 PM
java problem p0120144 Java Basics 3 September 26th, 2006 12:10 PM
database problem[java] sunanda_chowdary Java Databases 0 February 21st, 2006 04:00 AM
JAVA Security problem :) Stephen Lam All Other Wrox Books 1 March 14th, 2005 11:41 PM
Java code problem Loevet J2EE 5 October 23rd, 2003 08:42 AM





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