AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PKCS#7

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Security and Java
View previous topic :: View next topic  
Author Message
Michal Havlicek via JavaK
Guest





PostPosted: Mon Feb 21, 2005 12:33 am    Post subject: PKCS#7 Reply with quote



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!

--
Message posted via http://www.javakb.com
Back to top
Karl Scheibelhofer
Guest





PostPosted: Wed Mar 02, 2005 8:42 am    Post subject: Re: PKCS#7 Reply with quote



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


"Michal Havlicek via JavaKB.com" <forum (AT) JavaKB (DOT) com> wrote

Quote:
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!

--
Message posted via http://www.javakb.com



Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Security and Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.