easy_ssl

Crates.ioeasy_ssl
lib.rseasy_ssl
version0.0.4
sourcesrc
created_at2020-01-09 10:01:41.406893
updated_at2020-01-09 10:37:33.289861
descriptionthis is a rust lib to create x509 ssl certificate and private key file via an api and can be used in other rust projects.
homepagehttps://github.com/gzbakku/fdb/tree/master/cert
repositoryhttps://github.com/gzbakku/fdb/tree/master/cert
max_upload_size
id196884
size24,483
akku (gzbakku)

documentation

README

EASY SSL

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.

Installation

put the crate name and version in your cargo.toml file

easy_ssl = "0.0.4"

Usage


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");
        }
    }

}

License

MIT

Commit count: 0

cargo fmt