EldoS | Feel safer!

Software components for data protection, secure storage and transfer

PDF signature validation

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#23134
Posted: 01/10/2013 14:28:49
by Jose Morales (Basic support level)
Joined: 01/02/2013
Posts: 7

Hi there! Need some help with a Signed PDF validation.

After signing a PDF (with SBB), I'm trying to validate the signature, so I've made a little testing program in windows where I can load the PDF and after get the signature (using TElPDFSignature.get_Signatures(n)), I validate the signature pdfsig.Validate().

This is an example how I do it.

if (_CurrDoc.Signed)
{
int sigCount = _pdfDoc.SignatureCount;
for (int i=0; i < sigCount; i++)
{
TElPDFSignature pdfSig = _pdfDoc.get_Signatures(i);

if (!pdfSig.Validate())
{
MessageBox.Show("The signature is not valid", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
}
}

}

It always returns that the signature is invalid (false), but I don't know why, when I check the same file with Adobe acrobat it shows the signature is valid.

I've attached the image of the adobe reader with the valid signature.


#23136
Posted: 01/11/2013 01:12:13
by Eugene Mayevski (EldoS Corp.)

Did you check our samples for the code that validates signatures? Your code is incomplete (at least you need to add certificate validation). Please review samples before posting.


Sincerely yours
Eugene Mayevski
#23141
Posted: 01/11/2013 10:33:47
by Jose Morales (Basic support level)
Joined: 01/02/2013
Posts: 7

Hi Eugene.

Thanks for your answer but as a matter of fact I've already checked the samples, and in detail the Sample called PAdESDemo_VS2010.

In that sample the signature shows as invalid too, due my lack of experience in PAdES I don't know if I'm trying to do a different thing that the sample is intended to.

As far as I understand the example what its shown in the Signatures list, it's the signatures on the document, it shows a chain validation error (chain validation failed), this means the signature is invalid?

Or is not the right sample, for what I'm looking to do?

From your previous answer (is not clear to me) I have to add a certificate validation, could you please elaborate a little bit on this.

Thanks


#23142
Posted: 01/11/2013 10:54:17
by Eugene Mayevski (EldoS Corp.)

1. I suggested that you look at samples for correct validation code. Basic support level does not include checking user code for correctness.

2. Certificate validation is required but possibly it's not the only reason of your problem.

3. The error means exactly what is written - certificate chain validation has failed. Please refer to article 1 and article 2 for details.


Sincerely yours
Eugene Mayevski
#23143
Posted: 01/11/2013 10:56:25
by Jose Morales (Basic support level)
Joined: 01/02/2013
Posts: 7

Thanks Eugene.

One last question, is the sample that I pointed you in my previous post the correct to validate my signed file or there is another one?

Thanks again.
#23144
Posted: 01/11/2013 11:13:00
by Eugene Mayevski (EldoS Corp.)

Processor sample should be easier to deal with so you can start with it.

Also, are you writing validation code because you *need* validation for your tasks or you just wanted to check correctness of the made signature? If you need the latter, maybe it's just not worth bothering with validation: proper validation (certificate validation part first of all) is quite complicated and it would be waste of time if you don't need it for business.


Sincerely yours
Eugene Mayevski
Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.

Reply

Statistics

Topic viewed 1620 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!