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 @@
|
||||
öťc—I
|
||||
‚7@‹¶Źů˙BU ˇö”jŠTR]˘<>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ñºÉ²<C389>Ø{
|
||||
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