1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
//! The function get_nxm_pki returns a json string that contains public key, private key , Base64 encoded public key and Concrete ID //! //! [Github](https://git.vtoid.xyz/sajin/rust-nxm-library/) //! //! [Crates](https://crates.io/crates/nxmpki) #[macro_use] extern crate json; /// `pki` module mod pki; /// # Examples ///``` /// 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); /// } /// ``` pub fn get_nxm_pki() -> String{ let pki_data = pki::pki::create_pki(); return pki_data; }