Struct rustls_root_cert_store_builder

Source
pub struct rustls_root_cert_store_builder { /* private fields */ }
Expand description

A rustls_root_cert_store being constructed.

A builder can be modified by adding trust anchor root certificates with rustls_root_cert_store_builder_add_pem. Once you’re done adding root certificates, call rustls_root_cert_store_builder_build to turn it into a rustls_root_cert_store. This object is not safe for concurrent mutation.

Implementations§

Source§

impl rustls_root_cert_store_builder

Source

#[no_mangle]
pub extern "C" fn rustls_root_cert_store_builder_new() -> *mut rustls_root_cert_store_builder

Create a rustls_root_cert_store_builder.

Caller owns the memory and may free it with rustls_root_cert_store_free, regardless of whether rustls_root_cert_store_builder_build was called.

If you wish to abandon the builder without calling rustls_root_cert_store_builder_build, it must be freed with rustls_root_cert_store_builder_free.

Source

#[no_mangle]
pub extern "C" fn rustls_root_cert_store_builder_add_pem( builder: *mut rustls_root_cert_store_builder, pem: *const u8, pem_len: size_t, strict: bool, ) -> rustls_result

Add one or more certificates to the root cert store builder using PEM encoded data.

When strict is true an error will return a CertificateParseError result. So will an attempt to parse data that has zero certificates.

When strict is false, unparseable root certificates will be ignored. This may be useful on systems that have syntactically invalid root certificates.

Source

#[no_mangle]
pub extern "C" fn rustls_root_cert_store_builder_load_roots_from_file( builder: *mut rustls_root_cert_store_builder, filename: *const c_char, strict: bool, ) -> rustls_result

Add one or more certificates to the root cert store builder using PEM encoded data read from the named file.

When strict is true an error will return a CertificateParseError result. So will an attempt to parse data that has zero certificates.

When strict is false, unparseable root certificates will be ignored. This may be useful on systems that have syntactically invalid root certificates.

Source

#[no_mangle]
pub extern "C" fn rustls_root_cert_store_builder_build( builder: *mut rustls_root_cert_store_builder, root_cert_store_out: *mut *const rustls_root_cert_store, ) -> rustls_result

Create a new rustls_root_cert_store from the builder.

The builder is consumed and cannot be used again, but must still be freed.

The root cert store can be used in several rustls_web_pki_client_cert_verifier_builder_new instances and must be freed by the application when no longer needed. See the documentation of rustls_root_cert_store_free for details about lifetime.

Source

#[no_mangle]
pub extern "C" fn rustls_root_cert_store_builder_free( builder: *mut rustls_root_cert_store_builder, )

Free a rustls_root_cert_store_builder previously returned from rustls_root_cert_store_builder_new.

Calling with NULL is fine. Must not be called twice with the same value.

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>,

Source§

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>,

Source§

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.