#[repr(C)]pub struct aws_tls_ctx_pkcs11_options {
pub pkcs11_lib: *mut aws_pkcs11_lib,
pub user_pin: aws_byte_cursor,
pub slot_id: *const u64,
pub token_label: aws_byte_cursor,
pub private_key_object_label: aws_byte_cursor,
pub cert_file_path: aws_byte_cursor,
pub cert_file_contents: aws_byte_cursor,
}
Expand description
This struct exists as a graceful way to pass many arguments when calling init-with-pkcs11 functions on aws_tls_ctx_options (this also makes it easy to introduce optional arguments in the future). Instances of this struct should only exist briefly on the stack.
Instructions for binding this to high-level languages:
- Python: The members of this struct should be the keyword args to the init-with-pkcs11 functions.
- JavaScript: This should be an options map passed to init-with-pkcs11 functions.
- Java: This should be an options class passed to init-with-pkcs11 functions.
- C++: Same as Java
Notes on integer types:
PKCS#11 uses unsigned long
for IDs, handles, etc but we expose them as uint64_t
in public APIs.
We do this because sizeof(long) is inconsistent across platform/arch/language
(ex: always 64bit in Java, always 32bit in C on Windows, matches CPU in C on Linux and Apple).
By using uint64_t in our public API, we can keep the careful bounds-checking all in one
place, instead of expecting each high-level language binding to get it just right.
Fields
pkcs11_lib: *mut aws_pkcs11_lib
The PKCS#11 library to use. This field is required.
user_pin: aws_byte_cursor
User PIN, for logging into the PKCS#11 token (UTF-8). Zero out to log into a token with a “protected authentication path”.
slot_id: *const u64
ID of slot containing PKCS#11 token. If set to NULL, the token will be chosen based on other criteria (such as token label).
token_label: aws_byte_cursor
Label of PKCS#11 token to use. If zeroed out, the token will be chosen based on other criteria (such as slot ID).
private_key_object_label: aws_byte_cursor
Label of private key object on PKCS#11 token (UTF-8). If zeroed out, the private key will be chosen based on other criteria (such as being the only available private key on the token).
cert_file_path: aws_byte_cursor
Certificate’s file path on disk (UTF-8). The certificate must be PEM formatted and UTF-8 encoded. Zero out if passing in certificate by some other means (such as file contents).
cert_file_contents: aws_byte_cursor
Certificate’s file contents (UTF-8). The certificate must be PEM formatted and UTF-8 encoded. Zero out if passing in certificate by some other means (such as file path).
Trait Implementations
sourceimpl Clone for aws_tls_ctx_pkcs11_options
impl Clone for aws_tls_ctx_pkcs11_options
sourcefn clone(&self) -> aws_tls_ctx_pkcs11_options
fn clone(&self) -> aws_tls_ctx_pkcs11_options
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more