neosmart / SecureStore

A .NET implementation of the cross-platform SecureStore (symmetrically-encrypted secrets) protocol
MIT License
96 stars 15 forks source link

Command from doc throws error #20

Closed exedor closed 7 months ago

exedor commented 7 months ago

After installing this package I attempted to execute the following command straight out of the docs: SecureStore create secrets.json --password --keyfile secrets.key

And this is what it yields: Error: No decryption key has been loaded yet!

As far as I can tell, there's no way to create a secrets file that can use both password and key file.

mqudsi commented 7 months ago

Thanks for the report. This must be a regression in the recent bugfix release. You should be able to create it with --password then export the keyfile separately in the interim.

exedor commented 7 months ago

Hmm, it wasn't apparently obvious looking at the command help how to do that. It looked like every available option was a load only, not a save/export of key on existing password protected store.

mqudsi commented 7 months ago

It's a bit of a hack but there's the --export-key argument that can be passed along to any operation along with a path to export to. I also just pushed a fix for this, but I should add a proper test to make sure all the cases are handled correctly.

You can also use the ssclient rust version of the tool, as the secret format is compatible.

https://github.com/neosmart/SecureStore/commit/b233226c78652d4699c68efa417603201cb9c897

mqudsi commented 7 months ago

I've just published version 1.2.2 to nuget.org with a proper fix for this and it should be available for download shortly.

Thanks for reporting it.

exedor commented 7 months ago

Many thanks for the prompt response! I will try it out soon.