fission-codes / fission

Fission CLI & server
https://runfission.com/docs
119 stars 14 forks source link

Quick and Dirty AES Key Export Code Snippet #495

Closed expede closed 3 years ago

matheus23 commented 3 years ago

Oh, I think I have this in my notes:

await webnative.keystore.getKeyByName(`wnfs__readKey__${await webnative.keystore.sha256Str("/private")}`)

This should work when run in the auth lobby/drive.

expede commented 3 years ago

FYI @walkah

matheus23 commented 3 years ago

What I learned today: If you don't have access to private files (e.g. when you're running this from within some other app with fewer permissions), then it'll just generate a new key. In other words, in that case it's confusingly useless :smile:

expede commented 3 years ago

What I learned today: If you don't have access to private files (e.g. when you're running this from within some other app with fewer permissions), then it'll just generate a new key. In other words, in that case it's confusingly useless 😄

Oooooooh that's indeed confusing. We may want to wrap that in a tag, something like:

{existing: "mywnfskey"}
{generated: "newwnfskey"}

Thoughts?

expede commented 3 years ago

Or maybe better, it would be good to have separate methods for getOrGenerate versus getExisting

matheus23 commented 3 years ago

Alternative:

{ key: ...
, generated: true
}

(Whoops excuse the Elm syntax)

Or maybe better, it would be good to have separate methods for getOrGenerate versus getExisting

Yup. Agree

And possibly support both. Eh. I mean. Just yes. :D