简体   繁体   中英

OpenSSL TimeStampQuery equivalent in PHP

I'm trying to create a TimeStampQuery (tsq) to use with the Time-Stamp Protocol . In order to achieve this, I'm using the following OpenSSL terminal command:

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? If so, how?

I finally found a feasible alternative written entirely in 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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