signer/backend/src/ProdSignService.php

16 lines
639 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
declare(strict_types=1);
namespace App;
class ProdSignService
{
public function sign(string $documentUrl): void
{
exec(sprintf('cp %s %s.pdf', $documentUrl, $documentUrl));
exec(sprintf('pdfcpro sign %s.pdf -out %s_sign.pdf -cert cbfc28b024316bfe43066008cae177713533a6dd -text "\n\t\tПодписано ЭП\n\t\t{subject/cn}\n\t\tСертификат {sha1}\n\t\tДействителен от {since} до {until}\n\t\tДата {date}\n\t\t{subject/t}\n\t\t{subject/fullname}\n\t\t" -fontfile /usr/local/share/fonts/Inter-Bold.ttf -fontsize 8 -x 2 -y 2 -w 96 -h 9', $documentUrl, $documentUrl));
}
}