Add solana-keygen
Same as solana-mint, but without a tokens field.
This commit is contained in:
committed by
Greg Fitzgerald
parent
0b66a6626a
commit
81c44c605b
14
src/bin/keygen.rs
Normal file
14
src/bin/keygen.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
extern crate ring;
|
||||
extern crate serde_json;
|
||||
|
||||
use ring::rand::SystemRandom;
|
||||
use ring::signature::Ed25519KeyPair;
|
||||
use std::error;
|
||||
|
||||
fn main() -> Result<(), Box<error::Error>> {
|
||||
let rnd = SystemRandom::new();
|
||||
let pkcs8_bytes = Ed25519KeyPair::generate_pkcs8(&rnd)?;
|
||||
let serialized = serde_json::to_string(&pkcs8_bytes.to_vec())?;
|
||||
println!("{}", serialized);
|
||||
Ok(())
|
||||
}
|
Reference in New Issue
Block a user