Answer the question
In order to leave comments, you need to log in
How to sign a request to ESIA using a certificate from CryptoPro?
Hello.
I'm trying to generate a request for an authorization code.
Maybe someone can suggest what I'm doing wrong.
The customer, using CryptoPro CSP, uploaded the ES certificate file to me in .pfx format.
I threw it into ubuntu and loaded it with the command
certmgr -install -store uMy -file "<file_name>.pfx" -pfx -silent -keep_exportable -pin <password>
cryptcp -signf -der -dir /tmp -strict -cert --hashAlg 1.2.643.7.1.1.2.2 -detached -thumbprint <thumbprint> /tmp/message';
$signature = file_get_contents("tmp/message.sgn");
$encoded = base64_encode($signature);
$encoded = str_replace(array('+','/','='),array('-','_',''),$encoded);
$encoded = str_replace(PHP_EOL, "", $encoded);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question