Created
November 12, 2019 11:51
-
-
Save Aleksandr-ru/1a55a4ab70bfc30aa5eb6660611c9d7d to your computer and use it in GitHub Desktop.
Создание 1000 тестовых сертификатов в КриптоПро без браузера
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in {1..1000}; do | |
/opt/cprocsp/bin/amd64/cryptcp -creatcert \ | |
-dn "C=RU,L=Moscow,O=Test inc.,CN=ООО Тест $i,[email protected],INN=$(bash random_inn.sh)" \ | |
-pin '' \ | |
-ca http://testgost2012.cryptopro.ru/certsrv \ | |
-provtype 80 \ | |
-nokeygen \ | |
-cont '\\.\HDIMAGE\testcont100' | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#@see http://mellarius.ru/random-inn | |
region=$(shuf -i 1-92 -n 1 | xargs printf "%02d") | |
inspection=$(shuf -i 1-99 -n 1 | xargs printf "%02d") | |
numba=$(shuf -i 1-99999 -n 1 | xargs printf "%05d") | |
rezult=$region$inspection$numba | |
let kontr="( (2*${rezult:0:1}+4*${rezult:1:1} + 10*${rezult:2:1} +3*${rezult:3:1} + 5*${rezult:4:1} + 9*${rezult:5:1} +4*${rezult:6:1} + 6*${rezult:7:1} + 8*${rezult:8:1}) %11) %10" | |
if [ $kontr -eq 10 ]; then | |
kontr=0; | |
fi | |
echo $rezult$kontr; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment