11 releases
0.2.11 | Dec 17, 2019 |
---|---|
0.2.10 | Dec 17, 2019 |
0.1.0 | Dec 12, 2019 |
#5 in #rustc-serialize
5KB
Example code to use nxmpki library, ( https://crates.io/crates/nxmpki )
In the main.rs file:
extern crate nxmpki;
extern crate rustc_serialize;
use rustc_serialize::json::Json;
fn main() {
let mut json_str=nxmpki::get_nxm_pki().to_string();
json_str = json_str.to_string();
let json = Json::from_str(&json_str).unwrap();
let js = json.find_path(&["cid"]).unwrap();
let pub_k=json.find_path(&["public_key"]).unwrap();
println!("cid :{}, public key : {}", js, pub_k);
}
In the cargo.toml file:
[dependencies]
nxmpki = "0.2.5"
json = "0.12.0"
rustc-serialize = "0.3.24"
lib.rs
:
The function get_nxm_pki returns a json string that contains public key, private key , Base64 encoded public key and Concrete ID
Dependencies
~10MB
~172K SLoC