Discussion:
creating SignerInformation from SignerInfo
Marcin Cinik
2007-05-14 15:04:04 UTC
Permalink
Hello!

Do You know how to generate CMSSignedData when I have:
D - original data (being signed)
S1,S2,..,Sn - all SignerInfo structures encoded as DER (those structures
are already signed).

I want to persist every S1,..Sn in a database so every S1,..Sn would be in
its own row. But I don't know how to splice all those data again to form
something like CMSSignedData binary representation of those data.

thanks in advance,

Marcin Cinik
Karsten Ohme
2007-05-14 20:14:46 UTC
Permalink
Post by Marcin Cinik
Hello!
D - original data (being signed)
S1,S2,..,Sn - all SignerInfo structures encoded as DER (those structures
are already signed).
Look at RFC 3852 and use the corresponding classes of the
org.bouncycastle.asn.cms package of BC.

Regards,
Karsten
Post by Marcin Cinik
I want to persist every S1,..Sn in a database so every S1,..Sn would be in
its own row. But I don't know how to splice all those data again to form
something like CMSSignedData binary representation of those data.
thanks in advance,
Marcin Cinik
David Hook
2007-05-15 00:33:15 UTC
Permalink
CMSSignedDataGenerator.addSigners() should allow you to do this - I've
never tried it without adding a new signer as well, but "theoretically"
it should work.

Regards,

David
Post by Marcin Cinik
Hello!
D - original data (being signed)
S1,S2,..,Sn - all SignerInfo structures encoded as DER (those structures
are already signed).
I want to persist every S1,..Sn in a database so every S1,..Sn would be in
its own row. But I don't know how to splice all those data again to form
something like CMSSignedData binary representation of those data.
thanks in advance,
Marcin Cinik
Marcin Cinik
2007-05-15 09:03:11 UTC
Permalink
CMSSignedDataGenerator.addSigners(SignerInformationStore signerStore)

gets SignerInformationStore as its argument. SignerInformationStore has one
parameter constructor:

SignerInformationStore(Collection signerInfos). The collection contains
SignerInformation structures.

The problem is that SignerInformation has no public constructor. There is
only one constructor which can be

accessed from package (default):

(default) SignerInformation(
SignerInfo info,
DERObjectIdentifier contentType,
CMSProcessable content,
byte[] digest)

SignerInfo can be created from DER encoding of SignerInfo. Default value for
contentType is CMSSignedGenerator.DATA. So the real problem is that this
constructor cannot be accessed from other package, but I will work around
this.

Do You think that it is reasonable to make this constructor public in the
future ?

Thanks David,

Marcin


-----Original Message-----
From: David Hook [mailto:dgh-9CT+jbG4G9e6c6uEtOJ/***@public.gmane.org]
Sent: Tuesday, May 15, 2007 2:33 AM
To: Marcin Cinik
Cc: dev-crypto-***@public.gmane.org
Subject: Re: [dev-crypto] creating SignerInformation from SignerInfo



CMSSignedDataGenerator.addSigners() should allow you to do this - I've
never tried it without adding a new signer as well, but "theoretically"
it should work.

Regards,

David
Post by Marcin Cinik
Hello!
D - original data (being signed)
S1,S2,..,Sn - all SignerInfo structures encoded as DER (those structures
are already signed).
I want to persist every S1,..Sn in a database so every S1,..Sn would be in
its own row. But I don't know how to splice all those data again to form
something like CMSSignedData binary representation of those data.
thanks in advance,
Marcin Cinik
Talim
2014-08-11 08:10:53 UTC
Permalink
Is there a Solution now - or whats the work around?

I have a functioncall where I get the SignedData as byte[]m with one signer,
which I wanne verify. I thought easyest is to put data into
SignerInformation.

Thx



--
View this message in context: http://bouncy-castle.1462172.n4.nabble.com/creating-SignerInformation-from-SignerInfo-tp1465231p4657282.html
Sent from the Bouncy Castle - Dev mailing list archive at Nabble.com.
David Hook
2014-08-12 01:07:49 UTC
Permalink
Use CMSSignedData - a SignedData encoding needs to be feed into that
before you try to extract the SignerInformation.

Regards,

David
Post by Talim
Is there a Solution now - or whats the work around?
I have a functioncall where I get the SignedData as byte[]m with one signer,
which I wanne verify. I thought easyest is to put data into
SignerInformation.
Thx
--
View this message in context: http://bouncy-castle.1462172.n4.nabble.com/creating-SignerInformation-from-SignerInfo-tp1465231p4657282.html
Sent from the Bouncy Castle - Dev mailing list archive at Nabble.com.
Loading...