hyperledger / aries-cloudagent-python

Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://wiki.hyperledger.org/display/aries
Apache License 2.0
403 stars 510 forks source link

How to view Binary Data in the wallet database storage of agent? #2100

Closed darapich92 closed 1 year ago

darapich92 commented 1 year ago

Hello everyone, i run the postgresql as the wallet storage of the agent. But when I query it in the database, i saw that all data are [binary data]. Do you know how to view it via database admin browser (currently, I use pgadmin4 to view postgres database).

image

Thank you very much!

ianco commented 1 year ago

With an "indy" wallet there's no way to inspect the database contents, they are encrypted.

With an "askar" wallet I'm not sure if there's a setting to run in "unencrypted mode", @andrewwhitehead ?

darapich92 commented 1 year ago

@ianco Thank you for the information and I think it makes sense to encrypt the data. But in some case, we want to query it.

ianco commented 1 year ago

I think it makes sense to encrypt the data. But in some case, we want to query it.

I agree, I think it's an oversight that there is no option in an indy wallet to query the data.

However I thought we had an option with "askar" but I'm not sure offhand.

swcurran commented 1 year ago

There are two ways to search, AFAIK. First, if you are doing an exact match, you can search for the encyrpted value in the tags. That is how, for example, the credential searching is done for credentials with given claim names, or for given claim name/value pairs. In Indy-SDK at least, there is a way to create unecrypted tags, so you can search with expressions. Not sure if that is available for Aries Askar — it’s a pretty tricky feature to use in a general purpose tool.

darapich92 commented 1 year ago

@swcurran thank you very much for the information. So, I should dive to query for data by using provided code from Indy-SDK.

ianco commented 1 year ago

I forgot about the unencrypted tags feature. If you start acapy with --exch-use-unencrypted-tags then aca-py will use unencrypted tags for more (but not all) records

darapich92 commented 1 year ago

@ianco ahh!! thank you for the information.