Now the commands/flags are parsed by Cobra Commander library. This library is used by a lot of Golang Projects and handles the most common flags cases, showing a helpful explanation if the flags are not consistent.
I reorganized the code a bit, moving methods between files and rewriting some functions as struct methods or changing multiple return values for structs.
I added some tests to the code and I changed some function signatures to be compatible with the tests (receiving readers instead of file paths, for example)
I commented all the methods and the comments should be shown in the project GoDoc page if this branch is merged with master.
I added an Expiration Date argument for signatures (Issue #7). The default signature expiration date is one year from the signing date. I also added a test to check if a signature is still valid or not.
This implementation doesn't fix the error in #8. But it also should not make it worse (the function was only changed to a method and the logic was not changed).
There is a backwards incompatible change on this version, though:
Some flags names were changed for more consistency (all the compound flags use a mid-dash, on the previous version, sometimes they used a low_dash)
If there are no problems with these changes, we should be able to merge it.
I refactored some parts of the dhsm-signer:
There is a backwards incompatible change on this version, though:
If there are no problems with these changes, we should be able to merge it.