Closed brenzi closed 3 years ago
Update: NFT will be on the client side, keyvault ist on cli (where the other trustedoperations are handled).
Where should the encrypt and decrypt take place? stf or client?
not sure what the difference between cli and client is. do you mean client vs stf/cli? encrypt and decrypt happens client side, that is for sure (no content is sent to the keyVault) I'd suggest to do encryption and decryption in client/src/main.rs because it has nothing to do with the KeyVault directly
@brenzi is keyvault list
really in the right place? It is necessary for keyvault interaction, but it does not talk with the keyvaults at all if I've understood correctly. Is it not a modified list-workers?
EDIT: Look at the propsal below first.. I think this one is overcomplicating things..
According to the comments in PR #16 and discussion in https://github.com/integritee-network/worker/issues/197 & looking at the main.rs file again I'm proposing the following new client structure:
encrypt
and decrypt
functions. Just the clap arguments, inlcuding getting the argument from the matches. The functionality I'd implement in two dedicated, separate files:
client/decrypt.rs
resp. client/encrypt.rs
client/keyvault/keyvault_clap.rs
). The functionalites will be implemented in separate files but the same folder (client/keyvault/keyvault_provision.rs
)Summarizing it could look like:
client
|-- main.rs (+ encrypt & decrypt clap function)
|-- decrypt.rs
|-- encrypt.rs
|-- keyvault
| |-- clap.rs
| |-- provision.rs
| |-- ...
|-- nft
| |-- clap.rs
| |-- ...
This is not the optimal solution, but somewhat close to what was decided on in https://github.com/integritee-network/worker/issues/197 without touching main.rs too much (which is more than a PoC task..)
@brenzi does this sound like a sound solution to you?
Restructuring proposoal according to the discussion in https://github.com/integritee-network/worker/issues/197 and PR #16:
Add a new ternoa_commands.rs file, which contains all ternoa clap commands. It's handling all commands and subcommands of the newly added client calls. This way the main file can be left untouched.. it's quite messy and cleaning it up would be too much for a PoC. All actual functionalities will be implemented in different files:
client
|-- main.rs
|-- ternoa_commands.rs
|-- ternoa_implementation
| |-- encrypt.rs
| |-- decrypt.rs
| |-- keyvault
| | |-- provision.rs
| | |-- ...
| |-- nft
| | |-- transfer.rs
| | |-- ...
LGTM.
Closing with merge of #16
binary renaming to
ternoa-client
In addition to existing commands, prepare the following CLI. implementation of functionality is out of scope of this issue. just the CLI
encryption
NFT stuff
The NFT contains a filename of the capsule /cyphertext file. It is identified by a u32
KeyVault stuff
decryption