Crates.io | easy_ssl |
lib.rs | easy_ssl |
version | 0.0.4 |
source | src |
created_at | 2020-01-09 10:01:41.406893 |
updated_at | 2020-01-09 10:37:33.289861 |
description | this is a rust lib to create x509 ssl certificate and private key file via an api and can be used in other rust projects. |
homepage | https://github.com/gzbakku/fdb/tree/master/cert |
repository | https://github.com/gzbakku/fdb/tree/master/cert |
max_upload_size | |
id | 196884 |
size | 24,483 |
this is a rust lib to create x509 ssl certificate and private key file via an api and can be used in other rust projects.
put the crate name and version in your cargo.toml file
easy_ssl = "0.0.4"
use easy_ssl::{builder,common,generate_as_files};
fn main(){
let mut build = builder::Builder::new();
build.set_key_path("D://workstation/expo/rust/fdb/cert/keys/key.pem".to_string());
build.set_certificate_path("D://workstation/expo/rust/fdb/cert/keys/cert.pem".to_string());
build.set_key_size(4048);
build.issuer.set_country("IN".to_string());
build.issuer.set_state("UP".to_string());
build.issuer.set_location("GZB".to_string());
build.issuer.set_org("DAACHI".to_string());
build.issuer.set_common_name("https://daachi.in".to_string());
build.subject.set_country("IN".to_string());
build.subject.set_state("UP".to_string());
build.subject.set_location("GZB".to_string());
build.subject.set_org("DAACHI".to_string());
build.subject.set_common_name("127.0.0.1".to_string());
match generate_as_files(&mut build) {
Ok(r)=>{
println!("{:?}",r);
},
Err(e)=>{
println!("erro : {:?}",e);
common::error("failed-generate_as_vec");
}
}
}