02-13-2009 09:16 PM
Hi folks,
Somebody has used the CMSSignedDataOuputStream class?
This is my problem, I have been trying to generate a document CMS with a parallel signatures.
I just can get signature over signature, (I think this schema is called "signatures in serial")
I have spent too much time to figure out how to get it.
Any idea?, Please Help Me.
02-16-2009 12:35 PM
Hi,
Does anybody have been experienced the same problem?
Or any suggestion where i can find more information about this topic?
Please, help me.
Thanks for your time.
ICL
02-16-2009 12:43 PM
Check the links below:
http://www.openscdp.org/scsh3/cmssigneddata.html
http://www.ceenet.org/workshops/lectures2000/Wolfg
Hope this helps
02-17-2009 11:14 AM
Thanks to Tbilisoft Team,
I have looked the hyperlinks that you have posted, those one have been useful to me.
But I have one question. It is possible to generate an Encapsulated Signed Data using the CMS from BB APIs?
Graphically this is what i want:
|-------------|
|-----------| | Signed-data |
Data-----|Signed-Data| ||-----------||
|Generator |-----|| Data ||
Signer---| | ||-----------||
|-----------| | |
||-----------||
||Signature-1||
||-----------||
||Signature-2||
||-----------||
||Signature-n||
||-----------||
|-------------|
So, each signer signs the same encapsulatedContentInfo (Data section on the graphic).
I have got this with Bouncy Castle, but any idea on How can I get the same approach on BB?.
Thanks for your time, I really appreciate it.
ICL
02-17-2009 11:37 AM
02-17-2009 06:04 PM
Oh!
Thanks anyway! Tbilisoft.
Somebody has an idea?
Maybe it is a basic question for experts.
Could help me an expert from RIM or BlackBerry APIs, please?
If it is so basic, only tell me if I can reach the approach shown in the graphic (above) using the CMS package.
Thanks for your time.
ICL
07-08-2010 09:18 AM
Hi all,
Sorry for opening the older post. But i face a similar kind of a problem. I have signed a data using the keys in the keystore in the blackberry phone.
Now i need to pack the signed data into a PKCS7 format signature file. (normal signed data type, no parallel or other types of signatures). Is it possible to do it with CMS API provided by blackberry or should i go for Bouncy castle APIS. Any sample implementations or any pointers could be of great help
thanks and regards
Charley
07-15-2010 09:37 AM
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Base64OutputStream b64Os = new Base64OutputStream(baos);
CMSSignedDataOutputStream cos = new CMSSignedDataOutputStream(b64Os, CMSContentTypes.DATA, true, true, true);
SignatureSigner signer = SignatureSignerFactory.getInstance(yourPrivateKey, yourSignatureAlgorithm);
CMSSigner cmsSigner = new CMSSigner(signer, yourCertificate);
cos.addSigner(cmsSigner);
MIMEOutputStream mos = new MIMEOutputStream(cos, false, MIMEOutputStream.ENCODING_7BIT);
try {
mos.setContentType("text/plain; charset=iso-8859-1");
mos.write(yourData, 0, yourData.length);
} finally {
mos.close();
}
byte[] pkcs7Bytes = baos.toByteArray();