Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the error of php signature

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to solve php signature errors". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The reason for the php signature error is that the signature container embedded in the document exceeds the size originally reserved for it, and the solution is to reserve more space for the signature container.

This article operating environment: Windows7 system, PHP7.1 version, DELL G3 computer

How to solve the problem of php signature error?

Problem description:

I am using TCPDF to generate and sign a pdf document. TCPDF itself is just calling PHP's openssl_pkcs7_sign function, which in my opinion is based on the source code.

Until recently, everything was fine. Then I changed the certificate provider. I just updated the private key, certificate, and certificate chain:

$pdf- > setSignature ($this- > public_certificate_path, $this- > private_key_path, $this- > private_key_password, $this- > extra_certificates_path, 1)

I copied the new root certificate and intermediate certificate in PEM format in the extra_certificates_path file. I validated this file using openssl and it looks good.

Now, when I open a signed PDF in Adobe Reader, it displays the following error:

When opening the file, it says that the file is corrupted but the blue ribbon above is in the process of repairing that the authentication is invalid when I open the signature panel, it shows authentication error details by% s that the format or information contained in this signature is incorrect (supporting information: SigDict/Contents illegal data) when I click "Certificate details", there is no response?

Solution:

Analyzing the sample file shared by OP can understand the problem: the signature container embedded in the document exceeds the size originally reserved for it.

Therefore, the solution is to reserve more space for the signature container.

This is the end of the content of "how to solve php signature errors". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report