-
Notifications
You must be signed in to change notification settings - Fork 0
DatasetTool
SebastianGoendoer edited this page Sep 22, 2016
·
1 revision
Sample:
ReThink GlobalRegistry Dataset Tool
----------
v 0.0.3
----------
create, c: create new dataset
edit, e: edit dataset
exit, x: exit
help, h: print this help
print, p: print current dataset
quit, q: exit
readfile, rf: read dataset from file
resolve, r: resolve guid via global registry
setnode, sn: set primary greg node to use
status, s: run status check on all global registry nodes
upload, u: upload dataset to globalregistry
verify, v: verify current dataset
writefile, wf: write dataset to file
quit, q: exit
> c
creating new dataset ...
creating new ECDSA keypair... ok
specify salt (26 char length) [6j4pakf1daqqtrs0]:
> 6j4pakf1daqqtrs0
specify specify timeout (XSDDateTime) [2016-12-21T17:07:26+01:00]:
> 2016-12-21T17:07:26+01:00
specify specify active (0|1) [1]:
> 1
specify specify revoked (0|1) [0]:
> 0
add UserID? (y|n) [n]:
y
specify userID:
aaa
add another UserID? (y|n) [n]:
n
finishing up...
verifying values of dataset ... ok!
dataset successfully created. GUID: SkzLT8PhKWlD5ItEOj5WHKaj7gFYYjn4i88EjHFakPY
current dataset:
{
"guid": "SkzLT8PhKWlD5ItEOj5WHKaj7gFYYjn4i88EjHFakPY",
"publicKey": "-----BEGIN PUBLIC KEY-----MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEGdMHMyXMiS2BX1GFQWw27jeimmKjt3aUsGAUag6QOzj5rw9U2/m9k/0Ev1ez3EJRGkPQJBpbNcsL7ewrg2pOLA==-----END PUBLIC KEY-----",
"lastUpdate": "2016-09-22T17:07:26+02:00",
"active": 1,
"userIDs": ["aaa"],
"revoked": 0,
"timeout": "2016-12-21T17:07:26+01:00",
"salt": "6j4pakf1daqqtrs0"
}
> v
verifying values of dataset ... ok!
> wf
writing to file SkzLT8PhKWlD5ItEOj5WHKaj7gFYYjn4i88EjHFakPY.json ...export successful!
> u
encoding to base64URL... ok
[ encoded: eyJndWlkIjoiU2t6TFQ4UGhLV2xENUl0RU9qNVdIS2FqN2dGWVlqbjR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QCIAO8dX2nwdm1oJGd4H7dgwVum0arb1RVPFo0v2eU1sAWAiAKQDl6PGv9zMZ2RBqbL6Y4BAlBN3Wym_aPIC3hdjDGtQ ]
verifying JWT... JWT successfully verified!
SkzLT8PhKWlD5ItEOj5WHKaj7gFYYjn4i88EjHFakPY resolved to
{"publicKey":"-----BEGIN PUBLIC KEY-----MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEGdMHMyXMiS2BX1GFQWw27jeimmKjt3aUsGAUag6QOzj5rw9U2/m9k/0Ev1ez3EJRGkPQJBpbNcsL7ewrg2pOLA==-----END PUBLIC KEY-----","guid":"SkzLT8PhKWlD5ItEOj5WHKaj7gFYYjn4i88EjHFakPY","lastUpdate":"2016-09-22T17:07:26+02:00","active":1,"userIDs":["aaa"],"timeout":"2016-12-21T17:07:26+01:00","revoked":0,"salt":"6j4pakf1daqqtrs0"}
> e
ok
specify specify timeout (XSDDateTime) [2016-12-21T17:07:26+01:00]:
> 2016-12-21T17:07:26+01:00
specify specify active (0|1) [1]:
> 1
specify specify revoked (0:1) [0]:
> 0
type new value for userID. enter for leaving it unchanged. [aaa]:
aaa_edited
> aaa
add UserID? (y|n) [n]:
y
specify userID:
bbb
add another UserID? (y|n) [n]:
n
finishing up...
dataset successfully edited. GUID: SkzLT8PhKWlD5ItEOj5WHKaj7gFYYjn4i88EjHFakPY
current dataset:
{
"guid": "SkzLT8PhKWlD5ItEOj5WHKaj7gFYYjn4i88EjHFakPY",
"publicKey": "-----BEGIN PUBLIC KEY-----MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEGdMHMyXMiS2BX1GFQWw27jeimmKjt3aUsGAUag6QOzj5rw9U2/m9k/0Ev1ez3EJRGkPQJBpbNcsL7ewrg2pOLA==-----END PUBLIC KEY-----",
"lastUpdate": "2016-09-22T17:08:50+02:00",
"active": 1,
"userIDs": [
"aaa_edited",
"bbb"
],
"revoked": 0,
"timeout": "2016-12-21T17:07:26+01:00",
"salt": "6j4pakf1daqqtrs0"
}
> rf
specify guid to read from file:SkzLT8PhKWlD5ItEOj5WHKaj7gFYYjn4i88EjHFakPY
Successfully read file SkzLT8PhKWlD5ItEOj5WHKaj7gFYYjn4i88EjHFakPY.json
contents: {"publicKey":"-----BEGIN PUBLIC KEY-----MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEGdMHMyXMiS2BX1GFQWw27jeimmKjt3aUsGAUag6QOzj5rw9U2/m9k/0Ev1ez3EJRGkPQJBpbNcsL7ewrg2pOLA==-----END PUBLIC KEY-----","guid":"SkzLT8PhKWlD5ItEOj5WHKaj7gFYYjn4i88EjHFakPY","lastUpdate":"2016-09-22T17:07:26+02:00","active":1,"userIDs":["aaa"],"timeout":"2016-12-21T17:07:26+01:00","revoked":0,"salt":"6j4pakf1daqqtrs0"}
> p
current dataset:
{
"guid": "SkzLT8PhKWlD5ItEOj5WHKaj7gFYYjn4i88EjHFakPY",
"publicKey": "-----BEGIN PUBLIC KEY-----MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEGdMHMyXMiS2BX1GFQWw27jeimmKjt3aUsGAUag6QOzj5rw9U2/m9k/0Ev1ez3EJRGkPQJBpbNcsL7ewrg2pOLA==-----END PUBLIC KEY-----",
"lastUpdate": "2016-09-22T17:07:26+02:00",
"active": 1,
"userIDs": ["aaa"],
"revoked": 0,
"timeout": "2016-12-21T17:07:26+01:00",
"salt": "6j4pakf1daqqtrs0"
}
> s
Testing 130.149.22.133:5002 ... OK!
Testing 130.149.22.134:5002 ... OK!
Testing 130.149.22.135:5002 ... OK!
> sn
specify node number (0-2) [0]: 1
primary node set to 130.149.22.134:5002
> unrecognized command. type "help" or "h" for help
> q
bye...