Closed blankdots closed 5 years ago
@dtitov @AlexanderSenf @anandmohan777 you are the ones that have implemented this so can you agree on the format and then make the implementation to follow one format?
I vote for using HEX everywhere: Base64 can contain some characters which are not URL-friendly, while HEX-string is always URL-friendly.
Description
This is related to
crypt4gh
header in the Database it is stored as HEX, however RES expected bytes, moreover when decrypting the header inparseHeader
function the header is decrypted and the session key and IV are encoded into base64 but theLocalEGAServiceImpl
expects Hex viagetInputStream
... and this creates a confusion, of encoding and decoding.Can we operate with just HEX for now or base64. - don't care much about the format let us just agree on one and use it. A solution is proposed in https://github.com/EGA-archive/ega-data-api/blob/test/m4/ega-data-api-res/src/main/java/eu/elixir/ega/ebi/reencryptionmvc/service/internal/LocalEGAArchiveServiceImpl.java
Definition of Done
Allow RES to process headers as HEX strings from db, indifferent of the programming language of encoding. Proper error handling, as now it is difficult to spot where the header was not properly decrypted and why.
How to test
Unit test and integration tests added for headers that match the desired format and those that don't.