]> Sergey Matveev's repositories - zeasypki.git/blobdiff - zeasypki
Use GoGOST instead of PyGOST utilities
[zeasypki.git] / zeasypki
index 19df2339d07873d9515668d7de4e96da424cee37..f9693fc1ec3dfd3139d1e93a2fd61b722c8d022a 100755 (executable)
--- a/zeasypki
+++ b/zeasypki
@@ -7,10 +7,11 @@ set -e
 KEY_ENCRYPT_RECIPIENT=${KEY_ENCRYPT_RECIPIENT:-12AD32689C660D426967FD75CB8205632107AD8A}
 COUNTRY=${COUNTRY:-RU}
 
-# Turn on PyGOST utilities
-path=(~/local/stow/py310/bin ~/work/pygost/pygost/asn1schemas $path)
-export -TU PYTHONPATH pythonpath
-pythonpath=(~/work/pygost ~/work/pyderasn)
+path=(
+    ~/work/gogost/cmd/cer-selfsigned-example
+    ~/work/gogost/cmd/cer-dane-hash
+    $path
+)
 
 key_encrypt() {
     gpg --encrypt --recipient $KEY_ENCRYPT_RECIPIENT
@@ -91,7 +92,7 @@ ee_key_new_eddsa() {
 }
 
 ee_key_new_gost() {
-    cert-selfsigned-example.py --cn does-not-matter --ai 256A --only-key
+    cer-selfsigned-example -cn does-not-matter -ai 256A -only-key
 }
 
 ee_renew_xdsa() {
@@ -138,13 +139,14 @@ ee_renew_gost() {
     trap "rm -f $cakey $key $cert" HUP PIPE INT QUIT TERM EXIT
     key_get ca/gost/$ca
     mapfile[$cakey]=$REPLY
+    print >> $cakey
     cat >> $cakey < ca/gost/$ca/cer.pem
     key_get ee/gost/$ca/$domain
     mapfile[$key]=$REPLY
-    cert-selfsigned-example.py \
-        --issue-with $cakey \
-        --reuse-key $key \
-        --cn $domain --country $COUNTRY --ai 256A
+    cer-selfsigned-example \
+        -issue-with $cakey \
+        -reuse-key $key \
+        -cn $domain -country $COUNTRY -ai 256A
 }
 
 ca_new_gost() {
@@ -152,14 +154,14 @@ ca_new_gost() {
     local key=`mktemp`
     local cert=`mktemp`
     trap "rm -f $key $cert" HUP PIPE INT QUIT TERM EXIT
-    cert-selfsigned-example.py \
-        --ca \
-        --cn $domain \
-        --country $COUNTRY \
-        --serial 1 \
-        --ai 512C \
-        --out-key $key \
-        --out-cert $cert
+    cer-selfsigned-example \
+        -ca \
+        -cn $domain \
+        -country $COUNTRY \
+        -serial 1 \
+        -ai 512C \
+        -out-key $key \
+        -out-cert $cert
     reply=(${mapfile[$key]} ${mapfile[$cert]})
 }
 
@@ -172,7 +174,7 @@ dane_eddsa() {
 }
 
 dane_gost() {
-    cert-dane-hash.py
+    cer-dane-hash
 }
 
 case $1 in