Wrox Programmer Forums
|
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 13th, 2012, 11:26 AM
Registered User
 
Join Date: Dec 2012
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default SignerInformationVerifier

Hi.

I've downloaded and using the latest version (1.47) of the BouncyCastle API.
In this version the SignerInformation class only has one verify method that takes a SignerInformationVerifier object. This class is not mentioned in the book. I've tried to figure out how to use it the best. As it is right now I've made my own method that looks like this.

private SignerInformationVerifier createSIV(X509CertificateHolder x509ch) throws Exception {
BcRSAContentVerifierProviderBuilder qaz = new BcRSAContentVerifierProviderBuilder((DigestAlgorit hmIdentifierFinder) new DefaultDigestAlgorithmIdentifierFinder()); CMSSignatureAlgorithmNameGenerator sang = new DefaultCMSSignatureAlgorithmNameGenerator(); SignatureAlgorithmIdentifierFinder saif = new DefaultSignatureAlgorithmIdentifierFinder();
DigestCalculatorProvider dcp = new BcDigestCalculatorProvider();
SignerInformationVerifier siv = new SignerInformationVerifier(sang, saif, qaz.build(x509ch), dcp);
return siv;
}

I've a hard time thinking this is how it's supposed to be.

Could you please explain how to use/create the SignerInformationVerifier class and an example.

Regards
Patric
 
Old December 13th, 2012, 07:37 PM
dgh dgh is offline
Wrox Author
 
Join Date: Aug 2005
Posts: 206
Thanks: 0
Thanked 20 Times in 20 Posts
Default

The class you're referring to is one of the next generation BC APIs which have only recently been added.

You can find some more details on them at:

http://www.bouncycastle.org/wiki/dis...Version+2+APIs

The other place which is good to look is at the test classes, specifically the CMS test class BcSignedDataTest which is slowly evolving to doing more and more operations using the lightweight API.

Other than that, it looks like you have worked it out yourself!

Regards,

David
The Following User Says Thank You to dgh For This Useful Post:
poggen (December 14th, 2012)
 
Old December 14th, 2012, 09:21 AM
Registered User
 
Join Date: Dec 2012
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks!

The JcaSimpleSignerInfoVerifierBuilder class is the easier way to go and the one I was looking for.

Your support is commendable.

Regards
Patric









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