This repository has been archived by the owner on Oct 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve message formatting when submitting identities * Shell script for revoking certificate * Add sample certificate PDF * Edit time * version bump * Reggie watches for revocation not Emma * Update basic-demo.md text for revocation
- Loading branch information
1 parent
47486d4
commit 16e3363
Showing
4 changed files
with
74 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/sh | ||
|
||
# Run script using 'source ./5_revoke_certificate.sh' or '. ./5_revoke_certificate.sh' | ||
|
||
reggie_response=$(curl -s -X 'GET' http://localhost:8020/v1/certificate -H 'accept: application/json') | ||
|
||
export reggie_local_id=$(echo $reggie_response | jq -r '.[] | .id') | ||
|
||
echo "Reginald the Regulator submits the documentation explaining the grounds for revocation" | ||
|
||
file_id=$(curl -s -X 'POST' http://localhost:8020/v1/attachment \ | ||
-H 'accept: application/json' \ | ||
-H 'Content-Type: multipart/form-data' \ | ||
-F 'file=@Revocation_Reason.pdf;type=application/pdf' | jq -r .id) | ||
|
||
sleep 2 | ||
|
||
echo "Reginald the Regulator now revokes the certificate" | ||
|
||
revoked_cert=$(curl -s -X 'POST' http://localhost:8020/v1/certificate/$reggie_local_id/revocation \ | ||
-H 'accept: application/json' \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{ | ||
"reason": "'"$file_id"'" | ||
}') | ||
|
||
sleep 1 | ||
|
||
echo "Waiting for certificate to be revoked on-chain" | ||
|
||
state=$(curl -s http://localhost:8020/v1/certificate/$reggie_local_id -H 'accept: application/json' | jq -r .state) | ||
|
||
while [ "$state" != "revoked" ] | ||
do | ||
sleep 2 | ||
state=$(curl -s http://localhost:8020/v1/certificate/$reggie_local_id -H 'accept: application/json' | jq -r .state) | ||
echo $state | ||
done | ||
|
||
echo "The final certificate as seen by the Regulator" | ||
|
||
curl -s http://localhost:8020/v1/certificate/$reggie_local_id -H 'accept: application/json' | jq -r |
Binary file not shown.
This file contains 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