pub struct Trust { /* private fields */ }Expand description
Owned SecTrustRef created from a certificate and one or more policies.
Implementations§
Source§impl Trust
impl Trust
Sourcepub fn new(certificate: &Certificate, policies: &[Policy]) -> Result<Self>
pub fn new(certificate: &Certificate, policies: &[Policy]) -> Result<Self>
Create a trust object from one certificate and one or more policies.
§Errors
Returns an error if no policies were supplied or Security.framework rejects the inputs.
Sourcepub fn set_policies(&mut self, policies: &[Policy]) -> Result<()>
pub fn set_policies(&mut self, policies: &[Policy]) -> Result<()>
Replace the policies used by this trust object.
§Errors
Returns an error if no policies were supplied or Security.framework rejects the update.
Sourcepub fn evaluate(&self) -> Result<()>
pub fn evaluate(&self) -> Result<()>
Evaluate the trust object.
§Errors
Returns SecurityError::TrustEvaluationFailed when the certificate chain does not satisfy the configured policies.
Sourcepub const fn as_raw(&self) -> SecTrustRef
pub const fn as_raw(&self) -> SecTrustRef
Borrow the raw SecTrustRef.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Trust
impl RefUnwindSafe for Trust
impl !Send for Trust
impl !Sync for Trust
impl Unpin for Trust
impl UnsafeUnpin for Trust
impl UnwindSafe for Trust
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more