No way to serialize or restore a key pair?
Opened this issue · 1 comments
adamierymenko commented
It looks like there's no way to save/restore a Keypair. I guess this is nowhere even near production ready right?
Deleted user commented
it's pretty simple to implement your own restoration function. here's an example of how you can do so:
// src/api.rs
impl Keypair {
// -- snip --
pub fn restore(pub_bytes: Vec<u8>, sec_bytes: Vec<u8>) -> Self {
Self {
public: pub_bytes.try_into().unwrap(),
secret: sec_bytes.try_into().unwrap(),
}
}
}
though, it would be really useful if this was included by default (and honestly i'm confused as to why it's not).