Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
contrib
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rafael Bidegain
contrib
Commits
2ccda06b
Commit
2ccda06b
authored
4 years ago
by
Rafael Bidegain
Browse files
Options
Downloads
Patches
Plain Diff
verificar.bat para verificar desde ms-windows
parent
5837bdad
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
verificar.bat
+63
-0
63 additions, 0 deletions
verificar.bat
with
63 additions
and
0 deletions
verificar.bat
0 → 100644
+
63
−
0
View file @
2ccda06b
@echo
off
rem verificar.bat
rem Verifica si un archivo fue sellado en la BFA
rem Autor: Rafael Bidegain rbidegain@loteriadelaciudad.gob.ar
rem 04 de mayo de 2021
rem Licencia GPLv2-only
rem Este script fue dessarrollado observando tsa2.sh de Robert Martin-Legene
rem
rem controlo la llamada al verificar.bat tenga un parametro
if
[
%
1
]==[]
(
echo
falta
el
archivo
para
verificar
echo
verificar
file
.xml
goto
fin
)
rem controlo el parametro corresponda a un archivo que existe
IF
NOT
EXIST
%
1
(
echo
no
existe
el
archivo
[
%
1
]
para
verificar
goto
fin
)
rem elimino el archivo sha.txt usado en otra oportunidad
IF
EXIST
sha
.txt
(
del
sha
.txt
)
rem elimino el archivo salida.json usado en otra oportunidad
IF
EXIST
salida
.json
(
del
salida
.json
)
rem obtengo el hash sha256 del archivo y lo guardo en sha.txt
bin
\sha256sum
%
1
|
bin
\awk
"{print $1}"
>
sha
.txt
rem obtengo el hash sha256 del archivo y lo guardo en sha.txt
set
/p
SHA
=<
sha
.txt
rem controlo la variable SHA
if
[
%SHA%
]==[]
(
echo
fallo
al
generar
el
hash
sha256
.
goto
fin
)
rem armo una variable para llamar a curl con la url del sellador y el hash obtenido antes
set
SHA2
=
https
://tsa2.buenosaires.gob.ar/verify/
%SHA%
rem hago la verificación y guardo el resultado en el archivo salida.json
bin
\curl
--silent
%SHA2
%
>
salida
.json
rem muestro el resultado de la verificación
IF
EXIST
salida
.json
(
echo
--------------------------------------------------------------------------------
bin
\jq
-win
64
"."
salida
.json
echo
--------------------------------------------------------------------------------
bin
\jq
-win
64
".stamped"
salida
.json
bin
\jq
-win
64
-r
".stamps[0].whostamped"
salida
.json
bin
\jq
-win
64
-r
".stamps[0].blocknumber"
salida
.json
bin
\jq
-win
64
-r
".stamps[0].blocktimestamp"
salida
.json
)
:fin
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment