lganee / trusted-timestamps
Imported from https://d-mueller.de/blog/dealing-with-trusted-timestamps-in-php-rfc-3161/
Installs: 13 123
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- ext-curl: *
Requires (Dev)
- phpunit/phpunit: ^7.3
This package is not auto-updated.
Last update: 2023-08-22 07:28:39 UTC
README
Packaging of https://d-mueller.de/blog/dealing-with-trusted-timestamps-in-php-rfc-3161/
Install
Install with composer
composer require lganee/trusted-timestamps ~1.0
Usage
Timestamp a file (certified)
NOTE: $tsa_url = url of your Timestamp Authority you can find free TSA ex: https://gist.github.com/Manouchehri/fd754e402d98430243455713efada710
$requestFile = TrustedTimestamps::createRequestfile($sha1); $signature = TrustedTimestamps::signRequestfile($requestFile, $tsa_url); file_put_contents($signature_filename, base64_decode($signature['response_string']));
Get timestamp (datetime) from a signature file
$content64 = base64_encode(file_get_contents($signature_filename)); $timestamp = TrustedTimestamps::getTimestampFromAnswer($content64);