33 Zeilen
1,1 KiB
Rust
33 Zeilen
1,1 KiB
Rust
use std::time::Duration;
|
|
|
|
use openssl::nid::Nid;
|
|
use tokio::fs::OpenOptions;
|
|
|
|
use lazy_static::lazy_static;
|
|
|
|
lazy_static! {
|
|
pub static ref FILE_MODE: OpenOptions = OpenOptions::new().create(false).read(true).write(false).truncate(false).to_owned();
|
|
pub static ref FILE_MODE_WRITE: OpenOptions = OpenOptions::new().create(true).write(true).truncate(true).to_owned();
|
|
pub static ref LETS_ENCRYPT: String = String::from("letsencrypt");
|
|
pub static ref LETS_ENCRYPT_STAGING: String = String::from("letsencrypt-staging");
|
|
}
|
|
|
|
pub const POOL_SIZE: usize = 1;
|
|
|
|
pub const MAX_WAIT_TIME: Duration = Duration::from_secs(1 * 60);
|
|
pub const WAIT_TIME: Duration = Duration::from_secs(5);
|
|
pub const ATTEMPTS: usize = MAX_WAIT_TIME.div_duration_f64(WAIT_TIME) as usize;
|
|
|
|
#[repr(u32)]
|
|
pub enum RsaStrength {
|
|
Weak = 1024,
|
|
Middle = 2048,
|
|
Strong = 4096,
|
|
}
|
|
|
|
pub const SECP_WEAK: Nid = Nid::SECP112R1;
|
|
pub const SECP_MIDDLE: Nid = Nid::SECP160R1;
|
|
pub const SECP_STRONG: Nid = Nid::SECP521R1;
|
|
pub const BRAINPOOL_WEAK: Nid = Nid::BRAINPOOL_P256R1;
|
|
pub const BRAINPOOL_MIDDLE: Nid = Nid::BRAINPOOL_P384R1;
|
|
pub const BRAINPOOL_STRONG: Nid = Nid::BRAINPOOL_P512R1;
|