-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
pdf signature validation: CMSSignedData contains no signed attributes #1984
Comments
Hi @ralfhauser, The signature does not contain any signed attributes, therefore BouncyCastle correctly returns
The signature is computed differently in case the
Therefore, in you case, the signature is computed directly on the original detached content. In case of a PDF, the signed content will correspond to the In order to be able to validate the signature with BouncyCastle, you will need to provide the extracted content externally, as it is not encapsulated within the signature. For that you may use a constructor CMSSignedData(CMSProcessable signedContent, byte[] sigBlock) and provide the extracted content as a KR, |
Thanks - works! |
@ralfhauser , please note that in general CMS without signed attributes are considered less secure, in particular due to an absence of a signing-certificate(-v2), which is, for example, a required property for a PAdES format (see ETSI EN 319 142-1, "Table 1: Requirements on the main attributes for PAdES baseline signatures").
Generally speaking, one still may try to decrypt the signature value using the public key of the signing certificate, provided that it is valid. The output should correspond to the original signed digest value. |
The signed attached file validates with Acrobat Viewer but not with BouncyCastle.
It seems that the
SignerInformation signer = (SignerInformation) signerIt.next(); AttributeTable sigAttr = signer.getSignedAttributes();
returns null ?
This happens with the JcaSimpleSignerInfoVerifierBuilder() as per org.bouncycastle.cms.test.BcSignedDataTest.verifySignatures()
or also with BcRSASignerInfoVerifierBuilder.
t14675.pdf
The text was updated successfully, but these errors were encountered: