feat: added command parsing and spawning
This commit is contained in:
10
examples/bind-shell/key-generator/Cargo.toml
Normal file
10
examples/bind-shell/key-generator/Cargo.toml
Normal file
@@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "key-generator"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
ed25519-dalek = "1.0.1"
|
||||
rand = "0.7"
|
||||
2
examples/bind-shell/key-generator/privkey
Normal file
2
examples/bind-shell/key-generator/privkey
Normal file
@@ -0,0 +1,2 @@
|
||||
<EFBFBD><EFBFBD>c<EFBFBD>I
|
||||
<EFBFBD>7@<40><><EFBFBD><EFBFBD><EFBFBD>BU <20><><EFBFBD>j<EFBFBD>TR]<5D><>z"p*o
|
||||
1
examples/bind-shell/key-generator/pubkey
Normal file
1
examples/bind-shell/key-generator/pubkey
Normal file
@@ -0,0 +1 @@
|
||||
ґ:+6<><36>ɲ<EFBFBD><C9B2>{
|
||||
13
examples/bind-shell/key-generator/src/main.rs
Normal file
13
examples/bind-shell/key-generator/src/main.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
use std::{fs, io};
|
||||
|
||||
use ed25519_dalek::Keypair;
|
||||
|
||||
fn main() -> io::Result<()> {
|
||||
let mut csprng = rand::thread_rng();
|
||||
let keypair = Keypair::generate(&mut csprng);
|
||||
|
||||
fs::write("privkey", keypair.secret)?;
|
||||
fs::write("pubkey", keypair.public)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user