keybase / saltpack

a modern crypto messaging format
https://saltpack.org/
BSD 3-Clause "New" or "Revised" License
989 stars 62 forks source link

Way to get the `RawBoxKey` out of a `SecretKey` #62

Closed geoah closed 6 years ago

geoah commented 6 years ago

I was wondering if there a reason why we can't get the RawBoxKey out of a SecretKey.
I'm playing around with saltpack and I'm using the keyring to create secret keys, but I can't seem to find a way to get the RawBoxKey from it in order to store it and then load again later.

Am I missing something obvious?

geoah commented 6 years ago

ps. I can create it with the following, but I wanted to just use the keyring as I'm lazy. :)

    pub, priv, err := box.GenerateKey(rand.Reader)
    if err != nil {
        return nil, err
    }
    sk := basic.NewSecretKey(pub, priv)
oconnor663 commented 6 years ago

I don't think there's any particular reason we didn't include a function for that. Probably we just never happened to need it. If you want to add one, I'd be happy to review :)