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
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
#[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
#[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
#[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
#[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,
)
#[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.