Git Product home page Git Product logo

privkey's Introduction

privkey

Converts a private key CryptoPro => OpenSSL container

You need to install Strawberry perl and Visual Studio C++

Contents

  1. Download OpenSSL https://github.com/openssl/openssl/releases/tag/OpenSSL_1_1_1a and unpack it to dir "openssl-OpenSSL_1_1_1a"

  2. 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
  1. Download gost https://github.com/gost-engine/engine and unpack it to dir "engine-master"

  2. 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
  1. Convert CryptoPro container to OpenSSL container run:
privkey.exe a:\lp-9a0fe.000 > private.key
  1. 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
  1. 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

Executables

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.

Contacts

Mike Koulikow [email protected] https://habr.com/users/shukan/

privkey's People

Contributors

kulikan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.