See the test_basic() test in linux_key_storage.rs. I ran it successfully on my MacOS machine and a linux VM. The BasicFileStorage impl just stores each Keypair as a SerializableKeypair json object with the file name as the public key hex in ~/.notedeck_credentials. The SerializableKeypair uses the nip49 EncryptedSecretKey, but we just use an empty string as the password for now.
The BasicFileStorage impl works in MacOS, but it only conditionally compiles to linux for simplicity.
This is used as a response so that it's possible for the storage impl to be async, since secret_service is async. It seems that secret_service would allow for a more robust linux key storage impl so I went ahead and made the API compatible with an async impl.
See the
test_basic()
test inlinux_key_storage.rs
. I ran it successfully on my MacOS machine and a linux VM. TheBasicFileStorage
impl just stores eachKeypair
as aSerializableKeypair
json object with the file name as the public key hex in~/.notedeck_credentials
. TheSerializableKeypair
uses the nip49EncryptedSecretKey
, but we just use an empty string as the password for now.The
BasicFileStorage
impl works in MacOS, but it only conditionally compiles to linux for simplicity.This is used as a response so that it's possible for the storage impl to be async, since secret_service is async. It seems that
secret_service
would allow for a more robust linux key storage impl so I went ahead and made the API compatible with an async impl.