Ubirch API accessor methods.
◆ __init__()
None __init__ |
( |
|
self, |
|
|
|
env = "demo" , |
|
|
|
debug = False |
|
) |
| |
Initialize the API.
- Parameters
-
env | Can be one of [prod, demo, dev] |
debug | Print debug output? |
◆ deregister_identity()
Response deregister_identity |
( |
|
self, |
|
|
bytes |
key_deregistration |
|
) |
| |
De-register an identity at the backend.
Deletes the public key.
- Parameters
-
key_deregistration | The public key signed |
- Returns
- The response from the server
◆ get_trusted_identities_json()
Response get_trusted_identities_json |
( |
|
self, |
|
|
dict |
get_trusted |
|
) |
| |
Get the trusted identities as a list in JSON format.
- Parameters
-
get_trusted | Dictionary containing the identity details |
- Returns
- The response from the server
◆ get_url()
str or None get_url |
( |
|
self, |
|
|
str |
service |
|
) |
| |
- Parameters
-
service | Can be one of [prod, demo, dev] |
- Returns
- URL of this service
◆ is_identity_registered()
bool is_identity_registered |
( |
|
self, |
|
|
UUID |
uuid |
|
) |
| |
Check if this identity is registered with the backend.
- Parameters
-
uuid | The UUID of the identity to check |
- Returns
- True If the identity exists
◆ register_identity()
Response register_identity |
( |
|
self, |
|
|
bytes |
key_registration |
|
) |
| |
Register an identity with the backend.
- Parameters
-
key_registration | The key registration data |
- Returns
- The response from the server
◆ send()
Response send |
( |
|
self, |
|
|
UUID |
uuid, |
|
|
bytes |
data |
|
) |
| |
Send data to the ubirch authentication service (Niomon).
Requires encoding before sending.
- Parameters
-
uuid | The sender's UUID |
data | The msgpack or JSON encoded data to send |
- Returns
- The response from the server
◆ send_data()
Response send_data |
( |
|
self, |
|
|
UUID |
uuid, |
|
|
bytes |
data |
|
) |
| |
Send data to the ubirch data service.
Requires encoding before sending.
- Parameters
-
uuid | The sender's UUID |
data | The msgpack or JSON encoded data to send |
- Returns
- The response from the server
◆ set_authentication()
def set_authentication |
( |
|
self, |
|
|
UUID |
uuid, |
|
|
str or None |
auth |
|
) |
| |
- Parameters
-
uuid | The UUID of the authentication to add |
auth | The auth key / password of the ubirch 'thing' |
◆ trust_identity_json()
Response trust_identity_json |
( |
|
self, |
|
|
dict |
signed_trust |
|
) |
| |
Trust a new identity.
- Parameters
-
signed_trust | Dictionary containing the identity details |
- Returns
- The response from the server
◆ verify()
Response verify |
( |
|
self, |
|
|
bytes |
data, |
|
|
|
quick = False |
|
) |
| |
Verify a given hash with the ubirch backend.
Returns all available verification data.
- Parameters
-
data | The hash of the message to verify |
quick | Only run quick check to verify that the hash has been stored in backend |
- Returns
- If the verification was successful and the data related to it
The documentation for this class was generated from the following file: