Copy constructor of org.bouncycastle.cms.SignerInfoGenerator
The class org.bouncycastle.cms.SignerInfoGenerator has a constructor which combine origin generator and additional attribute table generator.
public SignerInfoGenerator(SignerInfoGenerator original, CMSAttributeTableGenerator sAttrGen, CMSAttributeTableGenerator unsAttrGen)
This constructor combines the fields of the original object with the parameters attrGen and unsAttrGen, but it does not retain the certHolder from the original object. I'm unsure whether this is a bug or intended behavior.
Please check the line about 70 in file SignerInfoGenerator.java
https://github.com/bcgit/bc-java/blob/94fadb56f60b55cebf1028ef444362a9e8820bde/pkix/src/main/java/org/bouncycastle/cms/SignerInfoGenerator.java#L70C1-L84C1
public SignerInfoGenerator(
SignerInfoGenerator original,
CMSAttributeTableGenerator sAttrGen,
CMSAttributeTableGenerator unsAttrGen)
{
this.signerIdentifier = original.signerIdentifier;
this.signer = original.signer;
this.digestAlgorithm = original.digestAlgorithm;
this.digester = original.digester;
this.sigEncAlgFinder = original.sigEncAlgFinder;
this.sAttrGen = sAttrGen;
this.unsAttrGen = unsAttrGen;
}
I think I'd classify that as a bug. Thanks for the report, I've pushed a fix for it which should appear shortly.
The fixed version is now up in https://downloads.bouncycastle.org/betas