Struct rustls_ffi::cipher::rustls_certified_key[][src]

pub struct rustls_certified_key { /* fields omitted */ }
Expand description

The complete chain of certificates to send during a TLS handshake, plus a private key that matches the end-entity (leaf) certificate. Corresponds to CertifiedKey in the Rust API. https://docs.rs/rustls/0.20.0/rustls/sign/struct.CertifiedKey.html

Implementations

Build a rustls_certified_key from a certificate chain and a private key. cert_chain must point to a buffer of cert_chain_len bytes, containing a series of PEM-encoded certificates, with the end-entity (leaf) certificate first.

private_key must point to a buffer of private_key_len bytes, containing a PEM-encoded private key in either PKCS#1 or PKCS#8 format.

On success, this writes a pointer to the newly created rustls_certified_key in certified_key_out. That pointer must later be freed with rustls_certified_key_free to avoid memory leaks. Note that internally, this is an atomically reference-counted pointer, so even after the original caller has called rustls_certified_key_free, other objects may retain a pointer to the object. The memory will be freed when all references are gone.

Return the i-th rustls_certificate in the rustls_certified_key. 0 gives the end-entity certificate. 1 and higher give certificates from the chain. Indexes higher than the last available certificate return NULL.

The returned certificate is valid until the rustls_certified_key is freed.

Create a copy of the rustls_certified_key with the given OCSP response data as DER encoded bytes. The OCSP response may be given as NULL to clear any possibly present OCSP data from the cloned key. The cloned key is independent from its original and needs to be freed by the application.

“Free” a certified_key previously returned from rustls_certified_key_build. Since certified_key is actually an atomically reference-counted pointer, extant certified_key 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.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.