Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crypto/src/cms/CMSSignedDataGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ internal SignerInf(
this.sigCalc = sigCalc;
this.signerIdentifier = signerIdentifier;
this.digestOID = new DefaultDigestAlgorithmIdentifierFinder().find((AlgorithmIdentifier)sigCalc.AlgorithmDetails).Algorithm.Id;
this.encOID = ((AlgorithmIdentifier)sigCalc.AlgorithmDetails).Algorithm.Id;
this.encOID = Helper.FindEncryptionAlgOID((AlgorithmIdentifier)sigCalc.AlgorithmDetails);

this.sAttr = sAttr;
this.unsAttr = unsAttr;
this.baseSignedTable = baseSignedTable;
Expand Down
11 changes: 10 additions & 1 deletion crypto/src/cms/CMSSignedHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,16 @@ static CmsSignedHelper()
ecAlgorithms.Add(CmsSignedGenerator.DigestSha512, EncryptionECDsaWithSha512);
}

/**
internal string FindEncryptionAlgOID(AlgorithmIdentifier algorithmDetails)
{
string algName = (string)encryptionAlgs[algorithmDetails.Algorithm.Id];
if ("RSA" == algName)
return CmsSignedGenerator.EncryptionRsa; /* this strips off the digest algorithm */
else
return algorithmDetails.Algorithm.Id;
}

/**
* Return the digest algorithm using one of the standard JCA string
* representations rather than the algorithm identifier (if possible).
*/
Expand Down