-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Same as solana-mint, but without a tokens field.
- Loading branch information
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(()) | ||
} |