If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
icastillo
Posts: 21
Registered: ‎11-05-2008
My Device: Not Specified

CMSSignedDataOuputStream class

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.

Please use plain text.
New Developer
icastillo
Posts: 21
Registered: ‎11-05-2008
My Device: Not Specified

Re: CMSSignedDataOuputStream class

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

 

Please use plain text.
New Developer
icastillo
Posts: 21
Registered: ‎11-05-2008
My Device: Not Specified

Re: CMSSignedDataOuputStream class

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

Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: CMSSignedDataOuputStream class

I am sorry, but I have no experience in this field. So I cannot give you a useful advice.
Please use plain text.
New Developer
icastillo
Posts: 21
Registered: ‎11-05-2008
My Device: Not Specified

Re: CMSSignedDataOuputStream class

Oh! :smileysad: 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

Please use plain text.
Contributor
cruser11232
Posts: 10
Registered: ‎05-31-2010
My Device: Black berry curve 8530
My Carrier: programmer

Re: CMSSignedDataOuputStream class

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

 

Please use plain text.
New Contributor
AnisimovSPB
Posts: 9
Registered: ‎06-25-2010
My Device: BB 8900
My Carrier: Beeline

Re: CMSSignedDataOuputStream class

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();

 

 

Please use plain text.