Struct rustls_ffi::cipher::rustls_root_cert_store [−][src]
pub struct rustls_root_cert_store { /* fields omitted */ }
Expand description
A root cert store that is done being constructed and is now read-only.
Under the hood, this object corresponds to an Arc
Implementations
Create a rustls_root_cert_store. Caller owns the memory and must eventually call rustls_root_cert_store_free. The store starts out empty. Caller must add root certificates with rustls_root_cert_store_add_pem. https://docs.rs/rustls/0.20.0/rustls/struct.RootCertStore.html#method.empty
#[no_mangle]pub extern "C" fn rustls_root_cert_store_add_pem(
store: *mut rustls_root_cert_store,
pem: *const u8,
pem_len: size_t,
strict: bool
) -> rustls_result
#[no_mangle]pub extern "C" fn rustls_root_cert_store_add_pem(
store: *mut rustls_root_cert_store,
pem: *const u8,
pem_len: size_t,
strict: bool
) -> rustls_result
Add one or more certificates to the root cert store 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.
“Free” a rustls_root_cert_store previously returned from rustls_root_cert_store_builder_build. Since rustls_root_cert_store is actually an atomically reference-counted pointer, extant rustls_root_cert_store may still hold an internal reference to the Rust object. However, C code must consider this pointer unusable after “free“ing it. Calling with NULL is fine. Must not be called twice with the same value.