spiffe/workload_api/
x509_context.rs1use crate::constants::DEFAULT_SVID;
4use crate::{X509BundleSet, X509Svid};
5
6#[derive(Debug, Clone, Eq, PartialEq)]
8pub struct X509Context {
9 svids: Vec<X509Svid>,
10 bundle_set: X509BundleSet,
11}
12
13impl X509Context {
14 pub fn new(svids: Vec<X509Svid>, bundle_set: X509BundleSet) -> Self {
16 Self { svids, bundle_set }
17 }
18
19 pub fn default_svid(&self) -> Option<&X509Svid> {
21 self.svids.get(DEFAULT_SVID)
22 }
23
24 pub fn svids(&self) -> &Vec<X509Svid> {
26 &self.svids
27 }
28
29 pub fn bundle_set(&self) -> &X509BundleSet {
31 &self.bundle_set
32 }
33}