Converts a private key CryptoPro => OpenSSL container
You need to install Strawberry perl and Visual Studio C++
-
Download OpenSSL https://github.com/openssl/openssl/releases/tag/OpenSSL_1_1_1a and unpack it to dir "openssl-OpenSSL_1_1_1a"
-
Compile OpenSSL via bat-file:
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
path=C:\Strawberry\perl\bin;C:\Users\D36B~1\AppData\Local\bin\NASM;%path%
perl Configure VC-WIN32 no-hw no-asm
nmake
-
Download gost https://github.com/gost-engine/engine and unpack it to dir "engine-master"
-
Use this bat-file to compile privkey.exe :
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
cl -DL_ENDIAN -Iopenssl-OpenSSL_1_1_1a\ms -Iopenssl-OpenSSL_1_1_1a\include -Iengine-master ^
privkey.c ^
engine-master\gost89.c engine-master\gosthash.c engine-master\gost_ameth.c ^
engine-master\gost_crypt.c engine-master\gost_ctl.c engine-master\gost_asn1.c ^
engine-master\gost_ec_sign.c engine-master\e_gost_err.c engine-master\gost_params.c ^
engine-master\gosthash2012.c libcrypto.lib
- Convert CryptoPro container to OpenSSL container run:
privkey.exe a:\lp-9a0fe.000 > private.key
- Sign file using signer.cer and private.key:
openssl cms -sign -inkey private.key -in file.txt -CAfile CA.cer -signer signer.cer -engine gost -out file.txt.sgn -outform DER -noattr -binary
- Check sign file:
openssl cms -verify -content file.txt -in file.txt.sgn -CAfile CA.cer -signer signer.cer -engine gost -inform DER -noattr -binary
You can find the privkey.exe executable in the winfiles.rar arhive.
You can also compile Visual Studio 14.0 (as well as 2019) using comp_cl32.bat from winfiles.rar archive.