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
bash
easy_ssl = "0.0.3"
```rust
use easy_ssl::{Builder,create};
let mut build = Builder::new();
build.setkeypath("D://key.pem".tostring()); build.setcertificatepath("D://cert.pem".tostring()); build.setkeysize(4048);
build.issuer.setcountry("IN".tostring()); build.issuer.setstate("UP".tostring()); build.issuer.setlocation("GZB".tostring()); build.issuer.setorg("DAACHI".tostring()); build.issuer.setcommonname("https://daachi.in".to_string());
build.subject.setcountry("IN".tostring()); build.subject.setstate("UP".tostring()); build.subject.setlocation("GZB".tostring()); build.subject.setorg("DAACHI".tostring()); build.subject.setcommonname("127.0.0.1".to_string());
match create(&mut build) { Ok()=>{ common::log("ssl files created successfully"); }, Err()=>{ common::error("failed to create ssl files"); } }
```