PHP 使用 USB 令牌对 PDF 文件进行数字签名

发布于 2024-11-14 08:28:27 字数 169 浏览 4 评论 0原文

我想使用客户端证书签署 PDF。仅当我将文件存储在我的电脑中时它才起作用。由于我想使用 USB 令牌中存储的证书来签署我的 PDF,我应该怎样做才能实现这一目标。

我试图从网上搜索,但我得到的大部分都是使用JAVA。有没有办法使用 PHP 来实现相同的目标?如果没有,谁能提供一种替代方法来签署我的 PDF。

I want to sign the PDF using client certificate. It only work when I got the file is stored in my PC. Since I want to sign my PDF by using the certificate stored inside a USB token, what should I do to achieve that.

I tried to search from the internet, but all I got are mostly using JAVA. Is there anyway to achieve the same goal using PHP? If not, can anyone provide an alternative way to sign my PDF.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沦落红尘 2024-11-21 08:28:27

您是在谈论在 Web 服务器上运行的 PHP 应用程序,以及连接到您的客户端计算机的 USB 令牌吗?然后忘记它;它不起作用,因为如果没有其他插件,您无法通过客户端浏览器从 Web 服务器访问客户端的 USB 端口。

您所讨论的 java 应用程序正在客户端的浏览器中运行,因此可能可以访问 USB 端口。

Are you talking about a PHP application that's running on a web server, and the USB token being attached to your client machine? Then forget it; it won't work because you cannot access the client's USB port from your web server via the client's browser without further plugins.

The java apps you're talking about are running in the client's browser and thus may have access to the usb port.

莫言歌 2024-11-21 08:28:27

这项任务很棘手但可行。您需要创建一个客户端模块,然后计算服务器上文档的哈希值,将其与客户端模块一起发送到 Web 浏览器(通过将其包含到网页中)并让客户端模块签署哈希。然后将哈希值发送回服务器。

我们的 SecureBlackbox 产品可以做到这一点,但目前在服务器端尚不支持 PHP(我们计划明年某个地方发布带有 PHP 绑定的库版本)。

The task is tricky but doable. You need to create a client-side module, then calculate the hash of the document on the server, send it along with the client module to the web browser (by including it into the web page) and have the client-side module sign the hash. Then send the hash back to the server.

Our SecureBlackbox product does this, but it's not currently available for PHP on the server side (we plan to release library edition with PHP binding somewhere next year).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文