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"