简体   繁体   English

与PHP中的OpenSSL TimeStampQuery等效

[英]OpenSSL TimeStampQuery equivalent in PHP

I'm trying to create a TimeStampQuery (tsq) to use with the Time-Stamp Protocol . 我正在尝试创建一个TimeStampQuery(tsq)以与Time-Stamp Protocol一起使用 In order to achieve this, I'm using the following OpenSSL terminal command: 为了实现这一点,我使用以下OpenSSL终端命令:

openssl ts -query -data input_file.xml -no_nonce -sha512 -out request.tsq

Can the OpenSSL PHP extension generate Time-Stamp Queries without the need of an external executable? OpenSSL PHP扩展可以在不需要外部可执行文件的情况下生成时间戳查询吗? If so, how? 如果是这样,怎么办?

I finally found a feasible alternative written entirely in PHP: https://github.com/vakata/asn1 我终于找到了完全用PHP编写的可行替代方法: https : //github.com/vakata/asn1

It is designed to create and parse Abstract Syntax Notation One data structures, but comes with a specific class for generating Time-Stamp Queries which is really straight-forward to use: 它旨在创建和解析“ 抽象语法表示法”一个数据结构,但附带一个用于生成时间戳查询的特定类,该类确实很容易使用:

$message = "Hello World";
$tsq = \vakata\asn1\Timestamp::generateRequestFromData($message);
// Send TSQ to an authorized entity

The documentation related to the previous method can be found here . 与以前的方法有关的文档可以在这里找到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM