Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add #addDigestAlgorithm(s) method to CMSSignedDataStreamGenerator #1982

Open
bsanchezb opened this issue Feb 3, 2025 · 0 comments
Open

Add #addDigestAlgorithm(s) method to CMSSignedDataStreamGenerator #1982

bsanchezb opened this issue Feb 3, 2025 · 0 comments
Assignees

Comments

@bsanchezb
Copy link

Hello,

As explained in #1965, a similar functionality is required within the CMSSignedDataStreamGenerator, allowing to provide custom digest algorithm identifiers to the CMS generation class.

This can be achieved by adding the following lines after population of digestAlgos set from signerGens processing:

// add additional digest algorithms
if (digestAlgorithmIDs != null && !digestAlgorithmIDs.isEmpty()) {
    digestAlgs.addAll(digestAlgorithmIDs);
}

provided that the following variable and a setter are defined within CMSSignedDataStreamGenerator or its super class CMSSignedGenerator:

private Set<AlgorithmIdentifier> digestAlgorithmIDs;


public void addDigestAlgorithmIDs(Set<AlgorithmIdentifier> digestAlgorithmIDs) {
   this.digestAlgorithmIDs = digestAlgorithmIDs;
}

This functionality is required for us for creation of encapsulating CMS signature with a large content, which can be provided only by streaming.
Currently, we need to copy-paste almost all methods of the CMSSignedDataStreamGenerator class due to its many private methods.

Best regards,
Aleksandr

@ligefeiBouncycastle ligefeiBouncycastle self-assigned this Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants