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

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

CryptoSmartCard - CMSSignedDataOutputStream

Hi folks!,

I am confused about using CMSSignedDataOutputStream class.

I am trying to sign five documents using the CMSSignedDataOutputStream class of CMS API, using a private key stored in a CryptoSmartCard, but for each document that I want to sign the CMSSignedDataOutputStream is asking the PIN access to the CryptoSmartCard... so that retyping smart card PIN N-times is frustating.

What I have tried, to avoid this, is open a crypto smart card session, get the private key with a KeyStoreDataTicket, and pass this private key through the CMSSigner class to the CMSSignedDataOutputStream class, but it hangs, becasue I assume that is trying to open another crypto smart card session, and by definition this could no be possible...

So, How can avoid the behavior of retyping PIN N-times? I just want to be asked for PIN one time, and apply five or N-signatures for each document.

I will appreciate any suggestion and thanks for you time.

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

Re: CryptoSmartCard - CMSSignedDataOutputStream

Any comments?,

Maybe this is not the way...for signing electronic documents

But, why the CMSDSignedDataInputStream class try to open an Smart Card session even when it is already open?