This is a bare-minimum implementation of the ubirch-protocol for Python 3. Please see ubirch-protocol for details.
The library consists of three parts which can be used individually:
ubirch.API- a python layer covering the ubirch backend REST APIubirch.Protocol- the protocol compiler which packages messages and handles signing and verificationubirch.KeyStore- a simple key store based on pyjks to store keys and certificates
the ubirch protocol uses the Ed25519 signature scheme by default.
-
Install dependencies.
$ pip install ubirch-protocol
-
Register your UUID at https://console.prod.ubirch.com/ and retrieve the "password" for your device
-
Insert your UUID and password in the example code.
uuid = UUID("<<insert your uuid>>") auth = "<<insert your device password>>"
-
Insert your own message in the example code.
test_message = "ubirch me!"
The message has to be unique! You'll get a
409status code, if you try to anchor an already anchored message. -
Run the example.
$ python ./hello_world.py
The output should look like this:
key registration status code: 200 message hash: FJXjDsX0jS3pEX7H28pvkp7brOPWqCfzl1V7fqv+P10= status code: 200 https://ubirch.de/verifier/hash-verifier#hash=FJXjDsX0jS3pEX7H28pvkp7brOPWqCfzl1V7fqv+P10= -
Verify your message hash at https://ubirch.de/verifier/hash-verifier
A more elaborate example can be found here: Python Example