You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I'm trying to develop an API for PAdES Signatures using PDFTron and OpenSSL and I have an issue while adding signingCertificatev2 attribute which is required by PAdES standard. I tried to use this slice of code to create ESS_SIGNING_CERT field:
PDFDoc& PadesSignatureService::signfile(SignatureHandler&handler,char*Reason)
{
SignatureHandlerId sigHandlerId = this->document->AddSignatureHandler(handler);
this->signature_field->SignOnNextSaveWithCustomHandler(sigHandlerId);
Date* d = new Date();
d->SetCurrentTime();
this->signature_field->SetSigDictTimeOfSigning(*d);
//i tried with and without this sequence (i replaced it with the OpenSSL field for ESSSIgnatureCert when i didn't use this call)
std::vector<unsigned char>signing_certificate = this->signature_field->GenerateESSSigningCertPAdESAttribute(((PadesSignatureBHandler&)handler).getcertificate(), ((PadesSignatureBHandler&)handler).getdigestalgorithm());
Obj sig_dict = this->signature_field->GetSDFObj();
sig_dict.FindObj("V").PutName("SubFilter", "ETSI.CAdES.detached");
this->signature_field->SetReason(Reason);
char *output_file=get_output_filename(this->filename);
try {
this->document->Save(output_file, SDFDoc::e_incremental, NULL);
}
catch (pdftron::Common::Exception e)
{
std::cout << e.GetMessage();
}
return *(this->document);
}
Now, the issue is that my signature is recognized by FoxitReader, but not by AdobeReader. The error that I encounter is this one:
In FoxitReader, the signature does not have any problem:
UPDATE:
I modified the code to add the ESS_Signing_Certificate_V2, but I receive this error:
An error occurred while trying to save the file.
The file might be locked, corrupt, or unavailable.
Detailed error:
vector too long
I think this happens because the size of the initial vector allocated for the signature is exceeded, do you know how to resize it to don't exceed the limits?
Hello! I'm trying to develop an API for PAdES Signatures using PDFTron and OpenSSL and I have an issue while adding signingCertificatev2 attribute which is required by PAdES standard. I tried to use this slice of code to create ESS_SIGNING_CERT field:
I also tried to create this field using this method:
my function has the following code:
Now, the issue is that my signature is recognized by FoxitReader, but not by AdobeReader. The error that I encounter is this one:
In FoxitReader, the signature does not have any problem:
Using DSS Verification I obtained the following results:
I attach here also the report of DSS:
DSS-Detailed-report.pdf
I used a GemBox PKCS12 for testing.
Could you help me?
Best Wishes,
Ionut Corbu
The text was updated successfully, but these errors were encountered: