Struct security_framework::trust_settings::TrustSettings

source ·
pub struct TrustSettings { /* private fields */ }
Expand description

Allows access to the certificates and their trust settings in a given domain.

Implementations§

source§

impl TrustSettings

source

pub fn new(domain: Domain) -> Self

Create a new TrustSettings for the given domain.

You can call iter() to discover the certificates with settings in this domain.

Then you can call tls_trust_settings_for_certificate() with a given certificate to learn what the aggregate trust setting for that certificate within this domain.

source

pub fn iter(&self) -> Result<TrustSettingsIter>

Create an iterator over the certificates with settings in this domain. This produces an empty iterator if there are no such certificates.

source

pub fn set_trust_settings_always(&self, cert: &SecCertificate) -> Result<()>

set trust settings to ““always trust this root certificate regardless of use.”. Sets the trust settings for the provided certificate to “always trust this root certificate regardless of use.”

This method configures the trust settings for the specified certificate, indicating that it should always be trusted as a TLS root certificate, regardless of its usage.

If successful, the trust settings are updated for the certificate in the given domain. If the certificate had no previous trust settings in the domain, new trust settings are created. If the certificate had existing trust settings, they are replaced with the new settings.

It is not possible to modify per-user trust settings when not running in a GUI environment, if you try it will return error 2070: errSecInternalComponent

source

pub fn tls_trust_settings_for_certificate( &self, cert: &SecCertificate, ) -> Result<Option<TrustSettingsForCertificate>>

Returns the aggregate trust setting for the given certificate.

This tells you whether the certificate should be trusted as a TLS root certificate.

If the certificate has no trust settings in the given domain, the errSecItemNotFound error is returned.

If the certificate has no specific trust settings for TLS in the given domain None is returned.

Otherwise, the specific trust settings are aggregated and returned.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.