在 PHP 中使用 Java 密钥库

发布于 2024-07-26 20:24:28 字数 233 浏览 4 评论 0原文

我正在寻求将一个小型 Java 安全库移植到 PHP。 Java 实现使用密钥库来签署一些内容,我想知道如何在 PHP 中重新创建此功能。 当然,原始 Java 实现仍然必须使用相同的密钥对/密钥库。

我对 PHP 的经验很少,以前也没有尝试过用 Java 密钥库做任何可移植的事情。

我希望有某种方法可以将私钥导出为 PHP 可以使用的格式。

有谁确切知道在这种情况下我需要做什么?

I'm looking to port a small Java security library to PHP. The Java implementation makes use of a keystore for signing some stuff and I'm wondering how to go about recreating this functionality in PHP. Of course the original Java implementation must still work with the same key pair/keystore.

I have very little experience with PHP and havn't tried to do anything portable with Java keystores before.

I expect there is some way to export the private key to a format that can be used by PHP.

Does anyone know exactly what I need to do in this situation?

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

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

发布评论

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

评论(2

‖放下 2024-08-02 20:24:28

如果您还没有完全确定将代码移植到 php,则可以使用 php-java桥从 php.ini 调用它。 如果您的 Java 代码经过验证,就没有理由立即丢弃它。

If you aren't absolutely set on porting your code to php, you can use the php-java bridge to make calls to it from php. If your java code is proven, there's no reason to discard it out of hand.

何以心动 2024-08-02 20:24:28

http://phpkeystore.org/ 可能有用。

编辑: 正如 Mihir 下面所暗示的那样,该网站似乎已经消失了。
最后一个“好的”存档可以在 https:// web.archive.org/web/20170607151254/http://phpkeystore.org/

http://phpkeystore.org/ may be of use.

EDIT: As implied by Mihir below, that site appears to be gone.
The last "good" archive of it is available at https://web.archive.org/web/20170607151254/http://phpkeystore.org/

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