Skip to content

Commit

Permalink
feat(trust_stores): imcomplete implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhexists committed Aug 31, 2024
1 parent bc14217 commit 76609c6
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mod commands;
mod errors;
mod trust_stores;
mod utils;
mod x509;
use clap::{Parser, Subcommand};
Expand Down
33 changes: 33 additions & 0 deletions core/src/trust_stores/linux.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
pub struct CAValue {}

impl CAValue {}

enum PossibleStores {
RedHat,
Debian,
SuSE,
Other,
}

impl PossibleStores {
fn get_details(&self) -> (String, Vec<&'static str>) {
match self {
PossibleStores::RedHat => (
"/etc/pki/ca-trust/source/anchors/".to_string(),
vec!["update-ca-trust", "extract"],
),
PossibleStores::Debian => (
"/usr/local/share/ca-certificates/".to_string(),
vec!["update-ca-certificates"],
),
PossibleStores::SuSE => (
"/etc/ca-certificates/trust-source/anchors/".to_string(),
vec!["trust", "extract-compat"],
),
PossibleStores::Other => (
"/usr/share/pki/trust/anchors/".to_string(),
vec!["update-ca-certificates"],
),
}
}
}
1 change: 1 addition & 0 deletions core/src/trust_stores/macos.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// NOT YET IMPLEMENTED
17 changes: 17 additions & 0 deletions core/src/trust_stores/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#[cfg(target_os = "windows")]
mod windows;

#[cfg(target_os = "macos")]
mod macos;

#[cfg(target_os = "linux")]
mod linux;

#[cfg(target_os = "windows")]
pub use self::windows::*;

#[cfg(target_os = "macos")]
pub use self::macos::*;

#[cfg(target_os = "linux")]
pub use self::linux::*;
1 change: 1 addition & 0 deletions core/src/trust_stores/windows.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// NOT YET IMPLEMENTED

0 comments on commit 76609c6

Please sign in to comment.