Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / March 2005

Tip: Looking for answers? Try searching our database.

PKCS#7

Thread view: 
Michal Havlicek - 21 Feb 2005 00:33 GMT
Can somebody help me? I need to encrypt XML data in PKCS#7 format (version
1.5) with .pk7 or another certificate. I want to use java but i m truly
newbie. PKCS7 must include signed data and certificate of signer,type of
object is "signedData". After encoding data i want to send it to a remote
server by using https (post). Thanks for your help!
Karl Scheibelhofer - 02 Mar 2005 08:42 GMT
there is no standard API in Java for handling PKCS#7. you have to use a
proprietary API for this purpose.
you may have a look at our IAIK-JCE toolkit. for non-commercial use it is
for free. commercial licenses are available.
you can get an evaluation copy from
http://jce.iaik.tugraz.at/download/evaluation/index.php (first register for
free).

a piece of code creating a SignedData as you need it would look something
like this:

 byte[] data = ...;
 SignedData signedData = new SignedData(data, SignedData.IMPLICIT);
 signedData.setCertificates(new X509Certificate[] { signerCertificate } );
 IssuerAndSerialNumber signerIssuerAndSerialNumber = new
IssuerAndSerialNumber(signerCertificate);
 SignerInfo signerInfo = new SignerInfo(signerIssuerAndSerialNumber,
AlgorithmID.sha1, signatureKey);
 signedData.addSignerInfo(signerInfo);
 byte[] encoding = signedData.getEncoded();

regards

 Karl Scheibelhofer

--

Karl Scheibelhofer, IAIK - Graz University of Technology
Inffeldgasse 16a, 8010 Graz, Austria
Fax: +43 316 873 5520
http://jce.iaik.tugraz.at/
Visit us at the RSA conference in San Francisco, 14-18 Feb 2005, booth 438

> Can somebody help me? I need to encrypt XML data in PKCS#7 format (version
> 1.5) with .pk7 or another certificate. I want to use java but i m truly
> newbie. PKCS7 must include signed data and certificate of signer,type of
> object is "signedData". After encoding data i want to send it to a remote
> server by using https (post). Thanks for your help!


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.