|
Botan 3.13.0
Crypto and TLS for C&
|
Public Header. More...
#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | BOTAN_CHECK_KEY_EXPENSIVE_TESTS 1 |
| #define | BOTAN_CIPHER_INIT_FLAG_DECRYPT 1 |
| #define | BOTAN_CIPHER_INIT_FLAG_ENCRYPT 0 |
| #define | BOTAN_CIPHER_INIT_FLAG_MASK_DIRECTION 1 |
| #define | BOTAN_CIPHER_UPDATE_FLAG_FINAL (1U << 0) |
| #define | BOTAN_FFI_API_VERSION 20260811 |
| #define | BOTAN_FFI_DEPRECATED(msg) |
| #define | BOTAN_FFI_EXPORT(maj, min) |
| #define | BOTAN_FFI_HEX_LOWER_CASE 1 |
| #define | BOTAN_FPE_FLAG_FE1_COMPAT_MODE 1 |
| #define | BOTAN_PRIVKEY_EXPORT_FLAG_DER 0 |
| #define | BOTAN_PRIVKEY_EXPORT_FLAG_PEM 1 |
| #define | BOTAN_PRIVKEY_EXPORT_FLAG_RAW 2 |
| #define | BOTAN_PUBKEY_DER_FORMAT_SIGNATURE 1 |
Typedefs | |
| typedef struct botan_asn1_oid_struct * | botan_asn1_oid_t |
| typedef struct botan_block_cipher_struct * | botan_block_cipher_t |
| typedef struct botan_cipher_struct * | botan_cipher_t |
| typedef struct botan_ec_group_struct * | botan_ec_group_t |
| typedef struct botan_ec_point_struct * | botan_ec_point_t |
| typedef struct botan_ec_scalar_struct * | botan_ec_scalar_t |
| typedef struct botan_fpe_struct * | botan_fpe_t |
| typedef struct botan_hash_struct * | botan_hash_t |
| typedef struct botan_hotp_struct * | botan_hotp_t |
| typedef struct botan_mac_struct * | botan_mac_t |
| typedef struct botan_mp_struct * | botan_mp_t |
| typedef struct botan_pk_op_decrypt_struct * | botan_pk_op_decrypt_t |
| typedef struct botan_pk_op_encrypt_struct * | botan_pk_op_encrypt_t |
| typedef struct botan_pk_op_ka_struct * | botan_pk_op_ka_t |
| typedef struct botan_pk_op_kem_decrypt_struct * | botan_pk_op_kem_decrypt_t |
| typedef struct botan_pk_op_kem_encrypt_struct * | botan_pk_op_kem_encrypt_t |
| typedef struct botan_pk_op_sign_struct * | botan_pk_op_sign_t |
| typedef struct botan_pk_op_verify_struct * | botan_pk_op_verify_t |
| typedef struct botan_privkey_struct * | botan_privkey_t |
| typedef struct botan_pubkey_struct * | botan_pubkey_t |
| typedef struct botan_rng_struct * | botan_rng_t |
| typedef struct botan_spake2p_params_struct * | botan_spake2p_params_t |
| typedef struct botan_spake2p_prover_struct * | botan_spake2p_prover_t |
| typedef struct botan_spake2p_verifier_struct * | botan_spake2p_verifier_t |
| typedef struct botan_srp6_server_session_struct * | botan_srp6_server_session_t |
| typedef struct botan_totp_struct * | botan_totp_t |
| typedef struct botan_tpm2_crypto_backend_state_struct * | botan_tpm2_crypto_backend_state_t |
| typedef struct botan_tpm2_ctx_struct * | botan_tpm2_ctx_t |
| typedef struct botan_tpm2_session_struct * | botan_tpm2_session_t |
| typedef int(* | botan_view_bin_fn) (botan_view_ctx view_ctx, const uint8_t *data, size_t len) |
| typedef void * | botan_view_ctx |
| typedef int(* | botan_view_str_fn) (botan_view_ctx view_ctx, const char *str, size_t len) |
| typedef struct botan_x509_cert_struct * | botan_x509_cert_t |
| typedef struct botan_x509_crl_entry_struct * | botan_x509_crl_entry_t |
| typedef struct botan_x509_crl_struct * | botan_x509_crl_t |
| typedef struct botan_x509_general_name_struct * | botan_x509_general_name_t |
| typedef struct botan_xof_struct * | botan_xof_t |
Functions | |
| int | botan_base64_decode (const char *base64_str, size_t in_len, uint8_t *out, size_t *out_len) |
| int | botan_base64_encode (const uint8_t *x, size_t len, char *out, size_t *out_len) |
| int | botan_bcrypt_generate (uint8_t *out, size_t *out_len, const char *password, botan_rng_t rng, size_t work_factor, uint32_t flags) |
| int | botan_bcrypt_is_valid (const char *pass, const char *hash) |
| int | botan_block_cipher_block_size (botan_block_cipher_t bc) |
| int | botan_block_cipher_clear (botan_block_cipher_t bc) |
| int | botan_block_cipher_decrypt_blocks (botan_block_cipher_t bc, const uint8_t in[], uint8_t out[], size_t blocks) |
| int | botan_block_cipher_destroy (botan_block_cipher_t bc) |
| int | botan_block_cipher_encrypt_blocks (botan_block_cipher_t bc, const uint8_t in[], uint8_t out[], size_t blocks) |
| int | botan_block_cipher_get_keyspec (botan_block_cipher_t cipher, size_t *out_minimum_keylength, size_t *out_maximum_keylength, size_t *out_keylength_modulo) |
| int | botan_block_cipher_init (botan_block_cipher_t *bc, const char *cipher_name) |
| int | botan_block_cipher_name (botan_block_cipher_t cipher, char *name, size_t *name_len) |
| int | botan_block_cipher_set_key (botan_block_cipher_t bc, const uint8_t key[], size_t len) |
| int | botan_cipher_clear (botan_cipher_t hash) |
| int | botan_cipher_destroy (botan_cipher_t cipher) |
| int | botan_cipher_get_default_nonce_length (botan_cipher_t cipher, size_t *nl) |
| int | botan_cipher_get_ideal_update_granularity (botan_cipher_t cipher, size_t *ug) |
| int | botan_cipher_get_keyspec (botan_cipher_t cipher, size_t *min_keylen, size_t *max_keylen, size_t *mod_keylen) |
| int | botan_cipher_get_tag_length (botan_cipher_t cipher, size_t *tag_size) |
| int | botan_cipher_get_update_granularity (botan_cipher_t cipher, size_t *ug) |
| int | botan_cipher_init (botan_cipher_t *cipher, const char *name, uint32_t flags) |
| int | botan_cipher_is_authenticated (botan_cipher_t cipher) |
| int | botan_cipher_name (botan_cipher_t cipher, char *name, size_t *name_len) |
| int | botan_cipher_output_length (botan_cipher_t cipher, size_t in_len, size_t *out_len) |
| int | botan_cipher_query_keylen (botan_cipher_t cipher, size_t *out_minimum_keylength, size_t *out_maximum_keylength) |
| int | botan_cipher_requires_entire_message (botan_cipher_t cipher) |
| int | botan_cipher_reset (botan_cipher_t cipher) |
| int | botan_cipher_set_associated_data (botan_cipher_t cipher, const uint8_t *ad, size_t ad_len) |
| int | botan_cipher_set_key (botan_cipher_t cipher, const uint8_t *key, size_t key_len) |
| int | botan_cipher_start (botan_cipher_t cipher, const uint8_t *nonce, size_t nonce_len) |
| int | botan_cipher_update (botan_cipher_t cipher, uint32_t flags, uint8_t output[], size_t output_size, size_t *output_written, const uint8_t input_bytes[], size_t input_size, size_t *input_consumed) |
| Encrypt/Decrypt some data and/or finalize the encryption/decryption. | |
| int | botan_cipher_valid_nonce_length (botan_cipher_t cipher, size_t nl) |
| int | botan_constant_time_compare (const uint8_t *x, const uint8_t *y, size_t len) |
| int | botan_ec_group_destroy (botan_ec_group_t ec_group) |
| int | botan_ec_group_equal (botan_ec_group_t curve1, botan_ec_group_t curve2) |
| int | botan_ec_group_from_ber (botan_ec_group_t *ec_group, const uint8_t *ber, size_t ber_len) |
| int | botan_ec_group_from_name (botan_ec_group_t *ec_group, const char *name) |
| int | botan_ec_group_from_oid (botan_ec_group_t *ec_group, botan_asn1_oid_t oid) |
| int | botan_ec_group_from_params (botan_ec_group_t *ec_group, botan_asn1_oid_t oid, botan_mp_t p, botan_mp_t a, botan_mp_t b, botan_mp_t base_x, botan_mp_t base_y, botan_mp_t order) |
| int | botan_ec_group_from_pem (botan_ec_group_t *ec_group, const char *pem) |
| int | botan_ec_group_get_a (botan_mp_t *a, botan_ec_group_t ec_group) |
| int | botan_ec_group_get_b (botan_mp_t *b, botan_ec_group_t ec_group) |
| int | botan_ec_group_get_curve_oid (botan_asn1_oid_t *oid, botan_ec_group_t ec_group) |
| int | botan_ec_group_get_g_x (botan_mp_t *g_x, botan_ec_group_t ec_group) |
| int | botan_ec_group_get_g_y (botan_mp_t *g_y, botan_ec_group_t ec_group) |
| int | botan_ec_group_get_order (botan_mp_t *order, botan_ec_group_t ec_group) |
| int | botan_ec_group_get_p (botan_mp_t *p, botan_ec_group_t ec_group) |
| int | botan_ec_group_supports_application_specific_group (int *out) |
| int | botan_ec_group_supports_named_group (const char *name, int *out) |
| int | botan_ec_group_unregister (botan_asn1_oid_t oid) |
| int | botan_ec_group_view_der (botan_ec_group_t ec_group, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_ec_group_view_pem (botan_ec_group_t ec_group, botan_view_ctx ctx, botan_view_str_fn view) |
| int | botan_ec_point_add (botan_ec_point_t *result, botan_ec_point_t x, botan_ec_point_t y) |
| int | botan_ec_point_destroy (botan_ec_point_t ec_point) |
| int | botan_ec_point_equal (botan_ec_point_t x, botan_ec_point_t y) |
| int | botan_ec_point_from_bytes (botan_ec_point_t *ec_point, botan_ec_group_t ec_group, const uint8_t *bytes, size_t bytes_len) |
| int | botan_ec_point_from_xy (botan_ec_point_t *ec_point, botan_ec_group_t ec_group, botan_mp_t x, botan_mp_t y) |
| int | botan_ec_point_generator (botan_ec_point_t *ec_point, botan_ec_group_t ec_group) |
| int | botan_ec_point_identity (botan_ec_point_t *ec_point, botan_ec_group_t ec_group) |
| int | botan_ec_point_is_identity (botan_ec_point_t ec_point) |
| int | botan_ec_point_mul (botan_ec_point_t *result, botan_ec_point_t ec_point, botan_ec_scalar_t ec_scalar, botan_rng_t rng) |
| int | botan_ec_point_negate (botan_ec_point_t *result, botan_ec_point_t ec_point) |
| int | botan_ec_point_view_compressed (botan_ec_point_t ec_point, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_ec_point_view_uncompressed (botan_ec_point_t ec_point, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_ec_point_view_x_bytes (botan_ec_point_t ec_point, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_ec_point_view_xy_bytes (botan_ec_point_t ec_point, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_ec_point_view_y_bytes (botan_ec_point_t ec_point, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_ec_privkey_create (botan_privkey_t *key, const char *algo_name, botan_ec_group_t ec_group, botan_rng_t rng) |
| int | botan_ec_privkey_get_group (botan_privkey_t key, botan_ec_group_t *ec_group) |
| int | botan_ec_privkey_get_private_key (botan_privkey_t key, botan_ec_scalar_t *value) |
| int | botan_ec_pubkey_get_group (botan_pubkey_t key, botan_ec_group_t *ec_group) |
| int | botan_ec_scalar_destroy (botan_ec_scalar_t ec_scalar) |
| int | botan_ec_scalar_from_mp (botan_ec_scalar_t *ec_scalar, botan_ec_group_t ec_group, botan_mp_t mp) |
| int | botan_ec_scalar_random (botan_ec_scalar_t *ec_scalar, botan_ec_group_t ec_group, botan_rng_t rng) |
| int | botan_ec_scalar_to_mp (botan_ec_scalar_t ec_scalar, botan_mp_t *mp) |
| const char * | botan_error_description (int err) |
| const char * | botan_error_last_exception_message (void) |
| uint32_t | botan_ffi_api_version (void) |
| int | botan_ffi_supports_api (uint32_t api_version) |
| int | botan_fpe_decrypt (botan_fpe_t fpe, botan_mp_t x, const uint8_t tweak[], size_t tweak_len) |
| int | botan_fpe_destroy (botan_fpe_t fpe) |
| int | botan_fpe_encrypt (botan_fpe_t fpe, botan_mp_t x, const uint8_t tweak[], size_t tweak_len) |
| int | botan_fpe_fe1_init (botan_fpe_t *fpe, botan_mp_t n, const uint8_t key[], size_t key_len, size_t rounds, uint32_t flags) |
| int | botan_hash_block_size (botan_hash_t hash, size_t *block_size) |
| int | botan_hash_clear (botan_hash_t hash) |
| int | botan_hash_copy_state (botan_hash_t *dest, botan_hash_t source) |
| int | botan_hash_destroy (botan_hash_t hash) |
| int | botan_hash_final (botan_hash_t hash, uint8_t out[]) |
| int | botan_hash_init (botan_hash_t *hash, const char *hash_name, uint32_t flags) |
| int | botan_hash_name (botan_hash_t hash, char *name, size_t *name_len) |
| int | botan_hash_output_length (botan_hash_t hash, size_t *output_length) |
| int | botan_hash_security_level (botan_hash_t hash, size_t *security_level) |
| int | botan_hash_update (botan_hash_t hash, const uint8_t *in, size_t in_len) |
| int | botan_hex_decode (const char *hex_str, size_t in_len, uint8_t *out, size_t *out_len) |
| int | botan_hex_encode (const uint8_t *x, size_t len, char *out, uint32_t flags) |
| int | botan_hotp_check (botan_hotp_t hotp, uint64_t *next_hotp_counter, uint32_t hotp_code, uint64_t hotp_counter, size_t resync_range) |
| int | botan_hotp_destroy (botan_hotp_t hotp) |
| int | botan_hotp_generate (botan_hotp_t hotp, uint32_t *hotp_code, uint64_t hotp_counter) |
| int | botan_hotp_init (botan_hotp_t *hotp, const uint8_t key[], size_t key_len, const char *hash_algo, size_t digits) |
| int | botan_kdf (const char *kdf_algo, uint8_t out[], size_t out_len, const uint8_t secret[], size_t secret_len, const uint8_t salt[], size_t salt_len, const uint8_t label[], size_t label_len) |
| int | botan_key_unwrap3394 (const uint8_t wrapped_key[], size_t wrapped_key_len, const uint8_t kek[], size_t kek_len, uint8_t key[], size_t *key_len) |
| int | botan_key_wrap3394 (const uint8_t key[], size_t key_len, const uint8_t kek[], size_t kek_len, uint8_t wrapped_key[], size_t *wrapped_key_len) |
| int | botan_mac_clear (botan_mac_t mac) |
| int | botan_mac_destroy (botan_mac_t mac) |
| int | botan_mac_final (botan_mac_t mac, uint8_t out[]) |
| int | botan_mac_get_keyspec (botan_mac_t mac, size_t *out_minimum_keylength, size_t *out_maximum_keylength, size_t *out_keylength_modulo) |
| int | botan_mac_init (botan_mac_t *mac, const char *mac_name, uint32_t flags) |
| int | botan_mac_name (botan_mac_t mac, char *name, size_t *name_len) |
| int | botan_mac_output_length (botan_mac_t mac, size_t *output_length) |
| int | botan_mac_set_key (botan_mac_t mac, const uint8_t *key, size_t key_len) |
| int | botan_mac_set_nonce (botan_mac_t mac, const uint8_t *nonce, size_t nonce_len) |
| int | botan_mac_update (botan_mac_t mac, const uint8_t *buf, size_t len) |
| int | botan_mceies_decrypt (botan_privkey_t mce_key, const char *aead, const uint8_t ct[], size_t ct_len, const uint8_t ad[], size_t ad_len, uint8_t pt[], size_t *pt_len) |
| int | botan_mceies_encrypt (botan_pubkey_t mce_key, botan_rng_t rng, const char *aead, const uint8_t pt[], size_t pt_len, const uint8_t ad[], size_t ad_len, uint8_t ct[], size_t *ct_len) |
| int | botan_mp_add (botan_mp_t result, botan_mp_t x, botan_mp_t y) |
| int | botan_mp_add_u32 (botan_mp_t result, botan_mp_t x, uint32_t y) |
| int | botan_mp_clear (botan_mp_t mp) |
| int | botan_mp_clear_bit (botan_mp_t n, size_t bit) |
| int | botan_mp_cmp (int *result, botan_mp_t x, botan_mp_t y) |
| int | botan_mp_destroy (botan_mp_t mp) |
| int | botan_mp_div (botan_mp_t quotient, botan_mp_t remainder, botan_mp_t x, botan_mp_t y) |
| int | botan_mp_equal (botan_mp_t x, botan_mp_t y) |
| int | botan_mp_flip_sign (botan_mp_t mp) |
| int | botan_mp_from_bin (botan_mp_t mp, const uint8_t vec[], size_t vec_len) |
| int | botan_mp_gcd (botan_mp_t out, botan_mp_t x, botan_mp_t y) |
| int | botan_mp_get_bit (botan_mp_t n, size_t bit) |
| int | botan_mp_init (botan_mp_t *mp) |
| int | botan_mp_is_even (botan_mp_t mp) |
| int | botan_mp_is_negative (botan_mp_t mp) |
| int | botan_mp_is_odd (botan_mp_t mp) |
| int | botan_mp_is_positive (botan_mp_t mp) |
| int | botan_mp_is_prime (botan_mp_t n, botan_rng_t rng, size_t test_prob) |
| int | botan_mp_is_zero (botan_mp_t mp) |
| int | botan_mp_lshift (botan_mp_t out, botan_mp_t in, size_t shift) |
| int | botan_mp_mod_inverse (botan_mp_t out, botan_mp_t in, botan_mp_t modulus) |
| int | botan_mp_mod_mul (botan_mp_t result, botan_mp_t x, botan_mp_t y, botan_mp_t mod) |
| int | botan_mp_mul (botan_mp_t result, botan_mp_t x, botan_mp_t y) |
| int | botan_mp_num_bits (botan_mp_t n, size_t *bits) |
| int | botan_mp_num_bytes (botan_mp_t n, size_t *bytes) |
| int | botan_mp_powmod (botan_mp_t out, botan_mp_t base, botan_mp_t exponent, botan_mp_t modulus) |
| int | botan_mp_rand_bits (botan_mp_t rand_out, botan_rng_t rng, size_t bits) |
| int | botan_mp_rand_range (botan_mp_t rand_out, botan_rng_t rng, botan_mp_t lower_bound, botan_mp_t upper_bound) |
| int | botan_mp_rshift (botan_mp_t out, botan_mp_t in, size_t shift) |
| int | botan_mp_set_bit (botan_mp_t n, size_t bit) |
| int | botan_mp_set_from_int (botan_mp_t mp, int initial_value) |
| int | botan_mp_set_from_mp (botan_mp_t dest, botan_mp_t source) |
| int | botan_mp_set_from_radix_str (botan_mp_t dest, const char *str, size_t radix) |
| int | botan_mp_set_from_str (botan_mp_t dest, const char *str) |
| int | botan_mp_sub (botan_mp_t result, botan_mp_t x, botan_mp_t y) |
| int | botan_mp_sub_u32 (botan_mp_t result, botan_mp_t x, uint32_t y) |
| int | botan_mp_swap (botan_mp_t x, botan_mp_t y) |
| int | botan_mp_to_bin (botan_mp_t mp, uint8_t vec[]) |
| int | botan_mp_to_hex (botan_mp_t mp, char *out) |
| int | botan_mp_to_str (botan_mp_t mp, uint8_t radix, char *out, size_t *out_len) |
| int | botan_mp_to_uint32 (botan_mp_t mp, uint32_t *val) |
| int | botan_mp_view_bin (botan_mp_t mp, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_mp_view_hex (botan_mp_t mp, botan_view_ctx ctx, botan_view_str_fn view) |
| int | botan_mp_view_str (botan_mp_t mp, uint8_t radix, botan_view_ctx ctx, botan_view_str_fn view) |
| int | botan_nist_kw_dec (const char *cipher_algo, int padded, const uint8_t wrapped_key[], size_t wrapped_key_len, const uint8_t kek[], size_t kek_len, uint8_t key[], size_t *key_len) |
| int | botan_nist_kw_enc (const char *cipher_algo, int padded, const uint8_t key[], size_t key_len, const uint8_t kek[], size_t kek_len, uint8_t wrapped_key[], size_t *wrapped_key_len) |
| int | botan_oid_cmp (int *result, botan_asn1_oid_t a, botan_asn1_oid_t b) |
| int | botan_oid_destroy (botan_asn1_oid_t oid) |
| int | botan_oid_equal (botan_asn1_oid_t a, botan_asn1_oid_t b) |
| int | botan_oid_from_string (botan_asn1_oid_t *oid, const char *oid_str) |
| int | botan_oid_register (botan_asn1_oid_t oid, const char *name) |
| int | botan_oid_view_name (botan_asn1_oid_t oid, botan_view_ctx ctx, botan_view_str_fn view) |
| int | botan_oid_view_string (botan_asn1_oid_t oid, botan_view_ctx ctx, botan_view_str_fn view) |
| int | botan_pbkdf (const char *pbkdf_algo, uint8_t out[], size_t out_len, const char *passphrase, const uint8_t salt[], size_t salt_len, size_t iterations) |
| int | botan_pbkdf_timed (const char *pbkdf_algo, uint8_t out[], size_t out_len, const char *passphrase, const uint8_t salt[], size_t salt_len, size_t milliseconds_to_run, size_t *out_iterations_used) |
| int | botan_pk_op_decrypt (botan_pk_op_decrypt_t op, uint8_t out[], size_t *out_len, const uint8_t ciphertext[], size_t ciphertext_len) |
| int | botan_pk_op_decrypt_create (botan_pk_op_decrypt_t *op, botan_privkey_t key, const char *padding, uint32_t flags) |
| int | botan_pk_op_decrypt_destroy (botan_pk_op_decrypt_t op) |
| int | botan_pk_op_decrypt_output_length (botan_pk_op_decrypt_t op, size_t ctext_len, size_t *ptext_len) |
| int | botan_pk_op_encrypt (botan_pk_op_encrypt_t op, botan_rng_t rng, uint8_t out[], size_t *out_len, const uint8_t plaintext[], size_t plaintext_len) |
| int | botan_pk_op_encrypt_create (botan_pk_op_encrypt_t *op, botan_pubkey_t key, const char *padding, uint32_t flags) |
| int | botan_pk_op_encrypt_destroy (botan_pk_op_encrypt_t op) |
| int | botan_pk_op_encrypt_output_length (botan_pk_op_encrypt_t op, size_t ptext_len, size_t *ctext_len) |
| int | botan_pk_op_kem_decrypt_create (botan_pk_op_kem_decrypt_t *op, botan_privkey_t key, const char *kdf) |
| int | botan_pk_op_kem_decrypt_destroy (botan_pk_op_kem_decrypt_t op) |
| int | botan_pk_op_kem_decrypt_shared_key (botan_pk_op_kem_decrypt_t op, const uint8_t salt[], size_t salt_len, const uint8_t encapsulated_key[], size_t encapsulated_key_len, size_t desired_shared_key_len, uint8_t shared_key[], size_t *shared_key_len) |
| int | botan_pk_op_kem_decrypt_shared_key_length (botan_pk_op_kem_decrypt_t op, size_t desired_shared_key_length, size_t *output_shared_key_length) |
| int | botan_pk_op_kem_encrypt_create (botan_pk_op_kem_encrypt_t *op, botan_pubkey_t key, const char *kdf) |
| int | botan_pk_op_kem_encrypt_create_shared_key (botan_pk_op_kem_encrypt_t op, botan_rng_t rng, const uint8_t salt[], size_t salt_len, size_t desired_shared_key_len, uint8_t shared_key[], size_t *shared_key_len, uint8_t encapsulated_key[], size_t *encapsulated_key_len) |
| int | botan_pk_op_kem_encrypt_destroy (botan_pk_op_kem_encrypt_t op) |
| int | botan_pk_op_kem_encrypt_encapsulated_key_length (botan_pk_op_kem_encrypt_t op, size_t *output_encapsulated_key_length) |
| int | botan_pk_op_kem_encrypt_shared_key_length (botan_pk_op_kem_encrypt_t op, size_t desired_shared_key_length, size_t *output_shared_key_length) |
| int | botan_pk_op_key_agreement (botan_pk_op_ka_t op, uint8_t out[], size_t *out_len, const uint8_t other_key[], size_t other_key_len, const uint8_t salt[], size_t salt_len) |
| int | botan_pk_op_key_agreement_create (botan_pk_op_ka_t *op, botan_privkey_t key, const char *kdf, uint32_t flags) |
| int | botan_pk_op_key_agreement_destroy (botan_pk_op_ka_t op) |
| int | botan_pk_op_key_agreement_export_public (botan_privkey_t key, uint8_t out[], size_t *out_len) |
| int | botan_pk_op_key_agreement_size (botan_pk_op_ka_t op, size_t *out_len) |
| int | botan_pk_op_key_agreement_view_public (botan_privkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_pk_op_sign_create (botan_pk_op_sign_t *op, botan_privkey_t key, const char *hash_and_padding, uint32_t flags) |
| int | botan_pk_op_sign_destroy (botan_pk_op_sign_t op) |
| int | botan_pk_op_sign_finish (botan_pk_op_sign_t op, botan_rng_t rng, uint8_t sig[], size_t *sig_len) |
| int | botan_pk_op_sign_output_length (botan_pk_op_sign_t op, size_t *olen) |
| int | botan_pk_op_sign_update (botan_pk_op_sign_t op, const uint8_t in[], size_t in_len) |
| int | botan_pk_op_verify_create (botan_pk_op_verify_t *op, botan_pubkey_t key, const char *hash_and_padding, uint32_t flags) |
| int | botan_pk_op_verify_destroy (botan_pk_op_verify_t op) |
| int | botan_pk_op_verify_finish (botan_pk_op_verify_t op, const uint8_t sig[], size_t sig_len) |
| int | botan_pk_op_verify_update (botan_pk_op_verify_t op, const uint8_t in[], size_t in_len) |
| int | botan_pkcs_hash_id (const char *hash_name, uint8_t pkcs_id[], size_t *pkcs_id_len) |
| int | botan_privkey_algo_name (botan_privkey_t key, char out[], size_t *out_len) |
| int | botan_privkey_check_key (botan_privkey_t key, botan_rng_t rng, uint32_t flags) |
| int | botan_privkey_create (botan_privkey_t *key, const char *algo_name, const char *algo_params, botan_rng_t rng) |
| int | botan_privkey_create_dh (botan_privkey_t *key, botan_rng_t rng, const char *param) |
| int | botan_privkey_create_ecdh (botan_privkey_t *key, botan_rng_t rng, const char *params) |
| int | botan_privkey_create_ecdsa (botan_privkey_t *key, botan_rng_t rng, const char *params) |
| int | botan_privkey_create_mceliece (botan_privkey_t *key, botan_rng_t rng, size_t n, size_t t) |
| int | botan_privkey_create_rsa (botan_privkey_t *key, botan_rng_t rng, size_t n_bits) |
| int | botan_privkey_destroy (botan_privkey_t key) |
| int | botan_privkey_dsa_get_x (botan_mp_t n, botan_privkey_t key) |
| int | botan_privkey_ed25519_get_privkey (botan_privkey_t key, uint8_t output[64]) |
| int | botan_privkey_ed448_get_privkey (botan_privkey_t key, uint8_t output[57]) |
| int | botan_privkey_export (botan_privkey_t key, uint8_t out[], size_t *out_len, uint32_t flags) |
| int | botan_privkey_export_encrypted (botan_privkey_t key, uint8_t out[], size_t *out_len, botan_rng_t rng, const char *passphrase, const char *encryption_algo, uint32_t flags) |
| int | botan_privkey_export_encrypted_pbkdf_iter (botan_privkey_t key, uint8_t out[], size_t *out_len, botan_rng_t rng, const char *passphrase, size_t pbkdf_iterations, const char *cipher_algo, const char *pbkdf_algo, uint32_t flags) |
| int | botan_privkey_export_encrypted_pbkdf_msec (botan_privkey_t key, uint8_t out[], size_t *out_len, botan_rng_t rng, const char *passphrase, uint32_t pbkdf_msec_runtime, size_t *pbkdf_iterations_out, const char *cipher_algo, const char *pbkdf_algo, uint32_t flags) |
| int | botan_privkey_export_pubkey (botan_pubkey_t *out, botan_privkey_t in) |
| int | botan_privkey_get_field (botan_mp_t output, botan_privkey_t key, const char *field_name) |
| int | botan_privkey_load (botan_privkey_t *key, botan_rng_t rng, const uint8_t bits[], size_t len, const char *password) |
| int | botan_privkey_load_classic_mceliece (botan_privkey_t *key, const uint8_t privkey[], size_t key_len, const char *cmce_mode) |
| int | botan_privkey_load_dsa (botan_privkey_t *key, botan_mp_t p, botan_mp_t q, botan_mp_t g, botan_mp_t x) |
| int | botan_privkey_load_ecdh (botan_privkey_t *key, botan_mp_t scalar, const char *curve_name) |
| int | botan_privkey_load_ecdsa (botan_privkey_t *key, botan_mp_t scalar, const char *curve_name) |
| int | botan_privkey_load_ed25519 (botan_privkey_t *key, const uint8_t privkey[32]) |
| int | botan_privkey_load_ed448 (botan_privkey_t *key, const uint8_t privkey[57]) |
| int | botan_privkey_load_frodokem (botan_privkey_t *key, const uint8_t privkey[], size_t key_len, const char *frodo_mode) |
| int | botan_privkey_load_kyber (botan_privkey_t *key, const uint8_t privkey[], size_t key_len) |
| int | botan_privkey_load_ml_dsa (botan_privkey_t *key, const uint8_t privkey[], size_t key_len, const char *mldsa_mode) |
| int | botan_privkey_load_ml_kem (botan_privkey_t *key, const uint8_t privkey[], size_t key_len, const char *mlkem_mode) |
| int | botan_privkey_load_rsa (botan_privkey_t *key, botan_mp_t p, botan_mp_t q, botan_mp_t e) |
| int | botan_privkey_load_rsa_pkcs1 (botan_privkey_t *key, const uint8_t bits[], size_t len) |
| int | botan_privkey_load_slh_dsa (botan_privkey_t *key, const uint8_t privkey[], size_t key_len, const char *slhdsa_mode) |
| int | botan_privkey_load_sm2 (botan_privkey_t *key, botan_mp_t scalar, const char *curve_name) |
| int | botan_privkey_load_sm2_enc (botan_privkey_t *key, botan_mp_t scalar, const char *curve_name) |
| int | botan_privkey_load_x25519 (botan_privkey_t *key, const uint8_t privkey[32]) |
| int | botan_privkey_load_x448 (botan_privkey_t *key, const uint8_t privkey[56]) |
| int | botan_privkey_oid (botan_asn1_oid_t *oid, botan_privkey_t key) |
| int | botan_privkey_remaining_operations (botan_privkey_t key, uint64_t *out) |
| int | botan_privkey_rsa_get_d (botan_mp_t d, botan_privkey_t rsa_key) |
| int | botan_privkey_rsa_get_e (botan_mp_t e, botan_privkey_t rsa_key) |
| int | botan_privkey_rsa_get_n (botan_mp_t n, botan_privkey_t rsa_key) |
| int | botan_privkey_rsa_get_p (botan_mp_t p, botan_privkey_t rsa_key) |
| int | botan_privkey_rsa_get_privkey (botan_privkey_t rsa_key, uint8_t out[], size_t *out_len, uint32_t flags) |
| int | botan_privkey_rsa_get_q (botan_mp_t q, botan_privkey_t rsa_key) |
| int | botan_privkey_stateful_operation (botan_privkey_t key, int *out) |
| int | botan_privkey_view_der (botan_privkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_privkey_view_encrypted_der (botan_privkey_t key, botan_rng_t rng, const char *passphrase, const char *cipher_algo, const char *pbkdf_algo, size_t pbkdf_iterations, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_privkey_view_encrypted_der_timed (botan_privkey_t key, botan_rng_t rng, const char *passphrase, const char *cipher_algo, const char *pbkdf_algo, size_t pbkdf_runtime_msec, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_privkey_view_encrypted_pem (botan_privkey_t key, botan_rng_t rng, const char *passphrase, const char *cipher_algo, const char *pbkdf_algo, size_t pbkdf_iterations, botan_view_ctx ctx, botan_view_str_fn view) |
| int | botan_privkey_view_encrypted_pem_timed (botan_privkey_t key, botan_rng_t rng, const char *passphrase, const char *cipher_algo, const char *pbkdf_algo, size_t pbkdf_runtime_msec, botan_view_ctx ctx, botan_view_str_fn view) |
| int | botan_privkey_view_kyber_raw_key (botan_privkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_privkey_view_pem (botan_privkey_t key, botan_view_ctx ctx, botan_view_str_fn view) |
| int | botan_privkey_view_raw (botan_privkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_privkey_x25519_get_privkey (botan_privkey_t key, uint8_t output[32]) |
| int | botan_privkey_x448_get_privkey (botan_privkey_t key, uint8_t output[56]) |
| int | botan_pubkey_algo_name (botan_pubkey_t key, char out[], size_t *out_len) |
| int | botan_pubkey_check_key (botan_pubkey_t key, botan_rng_t rng, uint32_t flags) |
| int | botan_pubkey_destroy (botan_pubkey_t key) |
| int | botan_pubkey_dsa_get_g (botan_mp_t d, botan_pubkey_t key) |
| int | botan_pubkey_dsa_get_p (botan_mp_t p, botan_pubkey_t key) |
| int | botan_pubkey_dsa_get_q (botan_mp_t q, botan_pubkey_t key) |
| int | botan_pubkey_dsa_get_y (botan_mp_t y, botan_pubkey_t key) |
| int | botan_pubkey_ecc_key_used_explicit_encoding (botan_pubkey_t key) |
| int | botan_pubkey_ed25519_get_pubkey (botan_pubkey_t key, uint8_t pubkey[32]) |
| int | botan_pubkey_ed448_get_pubkey (botan_pubkey_t key, uint8_t pubkey[57]) |
| int | botan_pubkey_estimated_strength (botan_pubkey_t key, size_t *estimate) |
| int | botan_pubkey_export (botan_pubkey_t key, uint8_t out[], size_t *out_len, uint32_t flags) |
| int | botan_pubkey_fingerprint (botan_pubkey_t key, const char *hash, uint8_t out[], size_t *out_len) |
| int | botan_pubkey_get_field (botan_mp_t output, botan_pubkey_t key, const char *field_name) |
| int | botan_pubkey_load (botan_pubkey_t *key, const uint8_t bits[], size_t len) |
| int | botan_pubkey_load_classic_mceliece (botan_pubkey_t *key, const uint8_t pubkey[], size_t key_len, const char *cmce_mode) |
| int | botan_pubkey_load_dsa (botan_pubkey_t *key, botan_mp_t p, botan_mp_t q, botan_mp_t g, botan_mp_t y) |
| int | botan_pubkey_load_ecdh (botan_pubkey_t *key, botan_mp_t public_x, botan_mp_t public_y, const char *curve_name) |
| int | botan_pubkey_load_ecdh_sec1 (botan_pubkey_t *key, const uint8_t sec1[], size_t sec1_len, const char *curve_name) |
| int | botan_pubkey_load_ecdsa (botan_pubkey_t *key, botan_mp_t public_x, botan_mp_t public_y, const char *curve_name) |
| int | botan_pubkey_load_ecdsa_sec1 (botan_pubkey_t *key, const uint8_t sec1[], size_t sec1_len, const char *curve_name) |
| int | botan_pubkey_load_ed25519 (botan_pubkey_t *key, const uint8_t pubkey[32]) |
| int | botan_pubkey_load_ed448 (botan_pubkey_t *key, const uint8_t pubkey[57]) |
| int | botan_pubkey_load_frodokem (botan_pubkey_t *key, const uint8_t pubkey[], size_t key_len, const char *frodo_mode) |
| int | botan_pubkey_load_kyber (botan_pubkey_t *key, const uint8_t pubkey[], size_t key_len) |
| int | botan_pubkey_load_ml_dsa (botan_pubkey_t *key, const uint8_t pubkey[], size_t key_len, const char *mldsa_mode) |
| int | botan_pubkey_load_ml_kem (botan_pubkey_t *key, const uint8_t pubkey[], size_t key_len, const char *mlkem_mode) |
| int | botan_pubkey_load_rsa (botan_pubkey_t *key, botan_mp_t n, botan_mp_t e) |
| int | botan_pubkey_load_rsa_pkcs1 (botan_pubkey_t *key, const uint8_t bits[], size_t len) |
| int | botan_pubkey_load_slh_dsa (botan_pubkey_t *key, const uint8_t pubkey[], size_t key_len, const char *slhdsa_mode) |
| int | botan_pubkey_load_sm2 (botan_pubkey_t *key, botan_mp_t public_x, botan_mp_t public_y, const char *curve_name) |
| int | botan_pubkey_load_sm2_enc (botan_pubkey_t *key, botan_mp_t public_x, botan_mp_t public_y, const char *curve_name) |
| int | botan_pubkey_load_sm2_sec1 (botan_pubkey_t *key, const uint8_t sec1[], size_t sec1_len, const char *curve_name) |
| int | botan_pubkey_load_x25519 (botan_pubkey_t *key, const uint8_t pubkey[32]) |
| int | botan_pubkey_load_x448 (botan_pubkey_t *key, const uint8_t pubkey[56]) |
| int | botan_pubkey_oid (botan_asn1_oid_t *oid, botan_pubkey_t key) |
| int | botan_pubkey_rsa_get_e (botan_mp_t e, botan_pubkey_t rsa_key) |
| int | botan_pubkey_rsa_get_n (botan_mp_t n, botan_pubkey_t rsa_key) |
| int | botan_pubkey_sm2_compute_za (uint8_t out[], size_t *out_len, const char *ident, const char *hash_algo, botan_pubkey_t key) |
| int | botan_pubkey_view_der (botan_pubkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_pubkey_view_ec_public_point (botan_pubkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_pubkey_view_kyber_raw_key (botan_pubkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_pubkey_view_pem (botan_pubkey_t key, botan_view_ctx ctx, botan_view_str_fn view) |
| int | botan_pubkey_view_raw (botan_pubkey_t key, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_pubkey_x25519_get_pubkey (botan_pubkey_t key, uint8_t pubkey[32]) |
| int | botan_pubkey_x448_get_pubkey (botan_pubkey_t key, uint8_t pubkey[56]) |
| int | botan_pwdhash (const char *algo, size_t param1, size_t param2, size_t param3, uint8_t out[], size_t out_len, const char *passphrase, size_t passphrase_len, const uint8_t salt[], size_t salt_len) |
| int | botan_pwdhash_timed (const char *algo, uint32_t msec, size_t *param1, size_t *param2, size_t *param3, uint8_t out[], size_t out_len, const char *passphrase, size_t passphrase_len, const uint8_t salt[], size_t salt_len) |
| int | botan_rng_add_entropy (botan_rng_t rng, const uint8_t *entropy, size_t entropy_len) |
| int | botan_rng_destroy (botan_rng_t rng) |
| int | botan_rng_generate_with_input (botan_rng_t rng, uint8_t *out, size_t out_len, const uint8_t *addl_input, size_t addl_len) |
| int | botan_rng_get (botan_rng_t rng, uint8_t *out, size_t out_len) |
| int | botan_rng_init (botan_rng_t *rng, const char *rng_type) |
| int | botan_rng_init_custom (botan_rng_t *rng_out, const char *rng_name, void *context, int(*get_cb)(void *context, uint8_t *out, size_t out_len), int(*add_entropy_cb)(void *context, const uint8_t input[], size_t length), void(*destroy_cb)(void *context)) |
| int | botan_rng_init_drbg (botan_rng_t *rng_out, const char *drbg_name, const uint8_t *seed, size_t seed_len) |
| int | botan_rng_reseed (botan_rng_t rng, size_t bits) |
| int | botan_rng_reseed_from_rng (botan_rng_t rng, botan_rng_t source_rng, size_t bits) |
| int | botan_same_mem (const uint8_t *x, const uint8_t *y, size_t len) |
| int | botan_scrub_mem (void *mem, size_t bytes) |
| int | botan_scrypt (uint8_t out[], size_t out_len, const char *passphrase, const uint8_t salt[], size_t salt_len, size_t N, size_t r, size_t p) |
| int | botan_spake2p_derive_secret (botan_spake2p_params_t params, const char *password, const uint8_t prover_id[], size_t prover_id_len, const uint8_t verifier_id[], size_t verifier_id_len, const uint8_t salt[], size_t salt_len, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_spake2p_params_confirmation_size (botan_spake2p_params_t params, size_t *confirmation_size) |
| int | botan_spake2p_params_destroy (botan_spake2p_params_t params) |
| int | botan_spake2p_params_init (botan_spake2p_params_t *params, const char *ciphersuite) |
| int | botan_spake2p_params_init_custom (botan_spake2p_params_t *params, botan_ec_group_t group, const uint8_t seed[], size_t seed_len, const char *hash_fn) |
| int | botan_spake2p_params_share_size (botan_spake2p_params_t params, size_t *share_size) |
| int | botan_spake2p_prover_destroy (botan_spake2p_prover_t prover) |
| int | botan_spake2p_prover_generate_message (botan_spake2p_prover_t prover, botan_rng_t rng, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_spake2p_prover_init (botan_spake2p_prover_t *prover, botan_spake2p_params_t params, const uint8_t secret[], size_t secret_len, const uint8_t prover_id[], size_t prover_id_len, const uint8_t verifier_id[], size_t verifier_id_len, const uint8_t context[], size_t context_len) |
| int | botan_spake2p_prover_process_message (botan_spake2p_prover_t prover, botan_rng_t rng, const uint8_t peer_message[], size_t peer_message_len, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_spake2p_prover_shared_secret (botan_spake2p_prover_t prover, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_spake2p_registration_record (botan_spake2p_params_t params, botan_rng_t rng, const uint8_t secret[], size_t secret_len, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_spake2p_verifier_destroy (botan_spake2p_verifier_t verifier) |
| int | botan_spake2p_verifier_init (botan_spake2p_verifier_t *verifier, botan_spake2p_params_t params, const uint8_t record[], size_t record_len, const uint8_t prover_id[], size_t prover_id_len, const uint8_t verifier_id[], size_t verifier_id_len, const uint8_t context[], size_t context_len) |
| int | botan_spake2p_verifier_process_message (botan_spake2p_verifier_t verifier, botan_rng_t rng, const uint8_t peer_message[], size_t peer_message_len, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_spake2p_verifier_shared_secret (botan_spake2p_verifier_t verifier, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_spake2p_verifier_skip_confirmation (botan_spake2p_verifier_t verifier) |
| int | botan_spake2p_verifier_verify_confirmation (botan_spake2p_verifier_t verifier, const uint8_t confirmation[], size_t confirmation_len) |
| int | botan_srp6_client_agree (const char *username, const char *password, const char *group_id, const char *hash_id, const uint8_t salt[], size_t salt_len, const uint8_t B[], size_t B_len, botan_rng_t rng_obj, uint8_t A[], size_t *A_len, uint8_t K[], size_t *K_len) |
| int | botan_srp6_generate_verifier (const char *identifier, const char *password, const uint8_t salt[], size_t salt_len, const char *group_id, const char *hash_id, uint8_t verifier[], size_t *verifier_len) |
| int | botan_srp6_group_size (const char *group_id, size_t *group_p_bytes) |
| int | botan_srp6_server_session_destroy (botan_srp6_server_session_t srp6) |
| int | botan_srp6_server_session_init (botan_srp6_server_session_t *srp6) |
| int | botan_srp6_server_session_step1 (botan_srp6_server_session_t srp6, const uint8_t verifier[], size_t verifier_len, const char *group_id, const char *hash_id, botan_rng_t rng_obj, uint8_t B_pub[], size_t *B_pub_len) |
| int | botan_srp6_server_session_step2 (botan_srp6_server_session_t srp6, const uint8_t A[], size_t A_len, uint8_t key[], size_t *key_len) |
| int | botan_system_rng_get (uint8_t *out, size_t out_len) |
| int | botan_totp_check (botan_totp_t totp, uint32_t totp_code, uint64_t timestamp, size_t acceptable_clock_drift) |
| int | botan_totp_destroy (botan_totp_t totp) |
| int | botan_totp_generate (botan_totp_t totp, uint32_t *totp_code, uint64_t timestamp) |
| int | botan_totp_init (botan_totp_t *totp, const uint8_t key[], size_t key_len, const char *hash_algo, size_t digits, size_t time_step) |
| int | botan_tpm2_crypto_backend_state_destroy (botan_tpm2_crypto_backend_state_t cbs) |
| int | botan_tpm2_ctx_destroy (botan_tpm2_ctx_t ctx) |
| int | botan_tpm2_ctx_enable_crypto_backend (botan_tpm2_ctx_t ctx, botan_rng_t rng) |
| int | botan_tpm2_ctx_from_esys (botan_tpm2_ctx_t *ctx_out, struct ESYS_CONTEXT *esys_ctx) |
| int | botan_tpm2_ctx_init (botan_tpm2_ctx_t *ctx_out, const char *tcti_nameconf) |
| int | botan_tpm2_ctx_init_ex (botan_tpm2_ctx_t *ctx_out, const char *tcti_name, const char *tcti_conf) |
| int | botan_tpm2_enable_crypto_backend (botan_tpm2_crypto_backend_state_t *cbs_out, struct ESYS_CONTEXT *esys_ctx, botan_rng_t rng) |
| int | botan_tpm2_rng_init (botan_rng_t *rng_out, botan_tpm2_ctx_t ctx, botan_tpm2_session_t s1, botan_tpm2_session_t s2, botan_tpm2_session_t s3) |
| int | botan_tpm2_session_destroy (botan_tpm2_session_t session) |
| int | botan_tpm2_supports_crypto_backend (void) |
| int | botan_tpm2_unauthenticated_session_init (botan_tpm2_session_t *session_out, botan_tpm2_ctx_t ctx) |
| uint32_t | botan_version_datestamp (void) |
| uint32_t | botan_version_major (void) |
| uint32_t | botan_version_minor (void) |
| uint32_t | botan_version_patch (void) |
| const char * | botan_version_string (void) |
| int | botan_x509_cert_allowed_extended_usage_oid (botan_x509_cert_t cert, botan_asn1_oid_t oid) |
| int | botan_x509_cert_allowed_extended_usage_str (botan_x509_cert_t cert, const char *oid) |
| int | botan_x509_cert_allowed_usage (botan_x509_cert_t cert, unsigned int key_usage) |
| int | botan_x509_cert_destroy (botan_x509_cert_t cert) |
| int | botan_x509_cert_dup (botan_x509_cert_t *new_cert, botan_x509_cert_t cert) |
| int | botan_x509_cert_excluded_name_constraints (botan_x509_cert_t cert, size_t index, botan_x509_general_name_t *constraint) |
| int | botan_x509_cert_excluded_name_constraints_count (botan_x509_cert_t cert, size_t *count) |
| int | botan_x509_cert_get_authority_key_id (botan_x509_cert_t cert, uint8_t out[], size_t *out_len) |
| int | botan_x509_cert_get_fingerprint (botan_x509_cert_t cert, const char *hash, uint8_t out[], size_t *out_len) |
| int | botan_x509_cert_get_issuer_dn (botan_x509_cert_t cert, const char *key, size_t index, uint8_t out[], size_t *out_len) |
| int | botan_x509_cert_get_issuer_dn_count (botan_x509_cert_t cert, const char *key, size_t *count) |
| int | botan_x509_cert_get_path_length_constraint (botan_x509_cert_t cert, size_t *path_limit) |
| int | botan_x509_cert_get_public_key (botan_x509_cert_t cert, botan_pubkey_t *key) |
| int | botan_x509_cert_get_public_key_bits (botan_x509_cert_t cert, uint8_t out[], size_t *out_len) |
| int | botan_x509_cert_get_serial_number (botan_x509_cert_t cert, uint8_t out[], size_t *out_len) |
| int | botan_x509_cert_get_subject_dn (botan_x509_cert_t cert, const char *key, size_t index, uint8_t out[], size_t *out_len) |
| int | botan_x509_cert_get_subject_dn_count (botan_x509_cert_t cert, const char *key, size_t *count) |
| int | botan_x509_cert_get_subject_key_id (botan_x509_cert_t cert, uint8_t out[], size_t *out_len) |
| int | botan_x509_cert_get_time_expires (botan_x509_cert_t cert, char out[], size_t *out_len) |
| int | botan_x509_cert_get_time_starts (botan_x509_cert_t cert, char out[], size_t *out_len) |
| int | botan_x509_cert_hostname_match (botan_x509_cert_t cert, const char *hostname) |
| int | botan_x509_cert_is_ca (botan_x509_cert_t cert) |
| int | botan_x509_cert_issuer_alternative_names (botan_x509_cert_t cert, size_t index, botan_x509_general_name_t *alt_name) |
| int | botan_x509_cert_issuer_alternative_names_count (botan_x509_cert_t cert, size_t *count) |
| int | botan_x509_cert_load (botan_x509_cert_t *cert_obj, const uint8_t cert[], size_t cert_len) |
| int | botan_x509_cert_load_file (botan_x509_cert_t *cert_obj, const char *filename) |
| int | botan_x509_cert_not_after (botan_x509_cert_t cert, uint64_t *time_since_epoch) |
| int | botan_x509_cert_not_before (botan_x509_cert_t cert, uint64_t *time_since_epoch) |
| int | botan_x509_cert_permitted_name_constraints (botan_x509_cert_t cert, size_t index, botan_x509_general_name_t *constraint) |
| int | botan_x509_cert_permitted_name_constraints_count (botan_x509_cert_t cert, size_t *count) |
| int | botan_x509_cert_serial_number (botan_x509_cert_t cert, botan_mp_t *serial_number) |
| int | botan_x509_cert_subject_alternative_names (botan_x509_cert_t cert, size_t index, botan_x509_general_name_t *alt_name) |
| int | botan_x509_cert_subject_alternative_names_count (botan_x509_cert_t cert, size_t *count) |
| int | botan_x509_cert_to_string (botan_x509_cert_t cert, char out[], size_t *out_len) |
| const char * | botan_x509_cert_validation_status (int code) |
| int | botan_x509_cert_verify (int *validation_result, botan_x509_cert_t cert, const botan_x509_cert_t *intermediates, size_t intermediates_len, const botan_x509_cert_t *trusted, size_t trusted_len, const char *trusted_path, size_t required_strength, const char *hostname, uint64_t reference_time) |
| int | botan_x509_cert_verify_with_crl (int *validation_result, botan_x509_cert_t cert, const botan_x509_cert_t *intermediates, size_t intermediates_len, const botan_x509_cert_t *trusted, size_t trusted_len, const botan_x509_crl_t *crls, size_t crls_len, const char *trusted_path, size_t required_strength, const char *hostname, uint64_t reference_time) |
| int | botan_x509_cert_view_as_string (botan_x509_cert_t cert, botan_view_ctx ctx, botan_view_str_fn view) |
| int | botan_x509_cert_view_binary_values (botan_x509_cert_t cert, botan_x509_value_type value_type, size_t index, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_x509_cert_view_binary_values_count (botan_x509_cert_t cert, botan_x509_value_type value_type, size_t *count) |
| int | botan_x509_cert_view_public_key_bits (botan_x509_cert_t cert, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_x509_cert_view_string_values (botan_x509_cert_t cert, botan_x509_value_type value_type, size_t index, botan_view_ctx ctx, botan_view_str_fn view) |
| int | botan_x509_cert_view_string_values_count (botan_x509_cert_t cert, botan_x509_value_type value_type, size_t *count) |
| int | botan_x509_crl_create (botan_x509_crl_t *crl_obj, botan_rng_t rng, botan_x509_cert_t ca_cert, botan_privkey_t ca_key, uint64_t issue_time, uint32_t next_update, const char *hash_fn, const char *padding) |
| int | botan_x509_crl_destroy (botan_x509_crl_t crl) |
| int | botan_x509_crl_entries (botan_x509_crl_t crl, size_t index, botan_x509_crl_entry_t *entry) |
| int | botan_x509_crl_entries_count (botan_x509_crl_t crl, size_t *count) |
| int | botan_x509_crl_entry_create (botan_x509_crl_entry_t *entry, botan_x509_cert_t cert, int reason_code) |
| int | botan_x509_crl_entry_destroy (botan_x509_crl_entry_t entry) |
| int | botan_x509_crl_entry_reason (botan_x509_crl_entry_t entry, int *reason_code) |
| int | botan_x509_crl_entry_revocation_date (botan_x509_crl_entry_t entry, uint64_t *time_since_epoch) |
| int | botan_x509_crl_entry_serial_number (botan_x509_crl_entry_t entry, botan_mp_t *serial_number) |
| int | botan_x509_crl_entry_view_serial_number (botan_x509_crl_entry_t entry, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_x509_crl_load (botan_x509_crl_t *crl_obj, const uint8_t crl_bits[], size_t crl_bits_len) |
| int | botan_x509_crl_load_file (botan_x509_crl_t *crl_obj, const char *crl_path) |
| int | botan_x509_crl_next_update (botan_x509_crl_t crl, uint64_t *time_since_epoch) |
| int | botan_x509_crl_this_update (botan_x509_crl_t crl, uint64_t *time_since_epoch) |
| int | botan_x509_crl_update (botan_x509_crl_t *crl_obj, botan_x509_crl_t last_crl, botan_rng_t rng, botan_x509_cert_t ca_cert, botan_privkey_t ca_key, uint64_t issue_time, uint32_t next_update, const botan_x509_crl_entry_t *new_entries, size_t new_entries_len, const char *hash_fn, const char *padding) |
| int | botan_x509_crl_verify_signature (botan_x509_crl_t crl, botan_pubkey_t key) |
| int | botan_x509_crl_view_binary_values (botan_x509_crl_t crl_obj, botan_x509_value_type value_type, size_t index, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_x509_crl_view_binary_values_count (botan_x509_crl_t crl_obj, botan_x509_value_type value_type, size_t *count) |
| int | botan_x509_crl_view_string_values (botan_x509_crl_t crl_obj, botan_x509_value_type value_type, size_t index, botan_view_ctx ctx, botan_view_str_fn view) |
| int | botan_x509_crl_view_string_values_count (botan_x509_crl_t crl_obj, botan_x509_value_type value_type, size_t *count) |
| int | botan_x509_ext_as_blocks_get_entry_at (botan_x509_cert_t cert, int asnum, size_t i, uint32_t *min, uint32_t *max) |
| int | botan_x509_ext_as_blocks_get_info (botan_x509_cert_t cert, int asnum, int *present, size_t *count) |
| int | botan_x509_ext_ip_addr_blocks_get_address (botan_x509_cert_t cert, int ipv6, size_t i, size_t entry, uint8_t min_out[], uint8_t max_out[], size_t *out_len) |
| int | botan_x509_ext_ip_addr_blocks_get_counts (botan_x509_cert_t cert, size_t *v4_count, size_t *v6_count) |
| int | botan_x509_ext_ip_addr_blocks_get_family (botan_x509_cert_t cert, int ipv6, size_t i, int *has_safi, uint8_t *safi, int *present, size_t *count) |
| int | botan_x509_general_name_destroy (botan_x509_general_name_t alt_names) |
| int | botan_x509_general_name_get_type (botan_x509_general_name_t name, unsigned int *type) |
| int | botan_x509_general_name_view_binary_value (botan_x509_general_name_t name, botan_view_ctx ctx, botan_view_bin_fn view) |
| int | botan_x509_general_name_view_string_value (botan_x509_general_name_t name, botan_view_ctx ctx, botan_view_str_fn view) |
| int | botan_x509_is_revoked (botan_x509_crl_t crl, botan_x509_cert_t cert) |
| int | botan_xof_accepts_input (botan_xof_t xof) |
| int | botan_xof_block_size (botan_xof_t xof, size_t *block_size) |
| int | botan_xof_clear (botan_xof_t xof) |
| int | botan_xof_copy_state (botan_xof_t *dest, botan_xof_t source) |
| int | botan_xof_destroy (botan_xof_t xof) |
| int | botan_xof_init (botan_xof_t *xof, const char *xof_name, uint32_t flags) |
| int | botan_xof_name (botan_xof_t xof, char *name, size_t *name_len) |
| int | botan_xof_output (botan_xof_t xof, uint8_t *out, size_t out_len) |
| int | botan_xof_update (botan_xof_t xof, const uint8_t *in, size_t in_len) |
| int | botan_zfec_decode (size_t K, size_t N, const size_t *indexes, uint8_t *const *inputs, size_t shareSize, uint8_t **outputs) |
| int | botan_zfec_encode (size_t K, size_t N, const uint8_t *input, size_t size, uint8_t **outputs) |
Public Header.
Definition in file ffi.h.
| #define BOTAN_CHECK_KEY_EXPENSIVE_TESTS 1 |
Definition at line 1800 of file ffi.h.
Referenced by botan_privkey_check_key(), and botan_pubkey_check_key().
| #define BOTAN_CIPHER_INIT_FLAG_ENCRYPT 0 |
Definition at line 677 of file ffi.h.
Referenced by botan_cipher_init().
| #define BOTAN_CIPHER_INIT_FLAG_MASK_DIRECTION 1 |
Definition at line 676 of file ffi.h.
Referenced by botan_cipher_init().
| #define BOTAN_CIPHER_UPDATE_FLAG_FINAL (1U << 0) |
Definition at line 771 of file ffi.h.
Referenced by botan_cipher_update().
| #define BOTAN_FFI_API_VERSION 20260811 |
The compile time API version. This matches the value of botan_ffi_api_version. This can be used for compile-time checking if a particular feature is available.
Note this same value is also reflected in BOTAN_HAS_FFI in build.h, however that declaration is not visible here since this header is intentionally free-standing, depending only on a few C standard library headers.
| #define BOTAN_FFI_EXPORT | ( | maj, | |
| min ) |
BOTAN_FFI_EXPORT indicates public FFI functions.
The arguments to the macro are to indicate the version that that particular FFI function was first available
Definition at line 89 of file ffi.h.
Referenced by botan_srp6_server_session_step1().
| #define BOTAN_FFI_HEX_LOWER_CASE 1 |
Flag that can be provided to botan_hex_encode to request lower case hex
Definition at line 247 of file ffi.h.
Referenced by botan_hex_encode().
| #define BOTAN_FPE_FLAG_FE1_COMPAT_MODE 1 |
Definition at line 4504 of file ffi.h.
Referenced by botan_fpe_fe1_init().
| #define BOTAN_PRIVKEY_EXPORT_FLAG_DER 0 |
Definition at line 1919 of file ffi.h.
Referenced by botan_privkey_export(), botan_privkey_export_encrypted_pbkdf_iter(), botan_privkey_export_encrypted_pbkdf_msec(), botan_privkey_rsa_get_privkey(), and botan_pubkey_export().
| #define BOTAN_PRIVKEY_EXPORT_FLAG_PEM 1 |
Definition at line 1920 of file ffi.h.
Referenced by botan_privkey_export(), botan_privkey_export_encrypted_pbkdf_iter(), botan_privkey_export_encrypted_pbkdf_msec(), botan_privkey_rsa_get_privkey(), and botan_pubkey_export().
| #define BOTAN_PRIVKEY_EXPORT_FLAG_RAW 2 |
Definition at line 1921 of file ffi.h.
Referenced by botan_privkey_export(), and botan_pubkey_export().
| #define BOTAN_PUBKEY_DER_FORMAT_SIGNATURE 1 |
Definition at line 3123 of file ffi.h.
Referenced by botan_pk_op_encrypt_create(), botan_pk_op_sign_create(), and botan_pk_op_verify_create().
| typedef struct botan_asn1_oid_struct* botan_asn1_oid_t |
| typedef struct botan_block_cipher_struct* botan_block_cipher_t |
| typedef struct botan_cipher_struct* botan_cipher_t |
| typedef struct botan_ec_group_struct* botan_ec_group_t |
| typedef struct botan_ec_point_struct* botan_ec_point_t |
| typedef struct botan_ec_scalar_struct* botan_ec_scalar_t |
| typedef struct botan_fpe_struct* botan_fpe_t |
| typedef struct botan_hash_struct* botan_hash_t |
| typedef struct botan_hotp_struct* botan_hotp_t |
| typedef struct botan_mac_struct* botan_mac_t |
| typedef struct botan_mp_struct* botan_mp_t |
| typedef struct botan_pk_op_decrypt_struct* botan_pk_op_decrypt_t |
| typedef struct botan_pk_op_encrypt_struct* botan_pk_op_encrypt_t |
| typedef struct botan_pk_op_ka_struct* botan_pk_op_ka_t |
| typedef struct botan_pk_op_kem_decrypt_struct* botan_pk_op_kem_decrypt_t |
| typedef struct botan_pk_op_kem_encrypt_struct* botan_pk_op_kem_encrypt_t |
| typedef struct botan_pk_op_sign_struct* botan_pk_op_sign_t |
| typedef struct botan_pk_op_verify_struct* botan_pk_op_verify_t |
| typedef struct botan_privkey_struct* botan_privkey_t |
| typedef struct botan_pubkey_struct* botan_pubkey_t |
| typedef struct botan_rng_struct* botan_rng_t |
| typedef struct botan_spake2p_params_struct* botan_spake2p_params_t |
SPAKE2+ (RFC 9383) password authenticated key exchange
All operations are relative to a set of system parameters, which select the elliptic curve group, the SPAKE2+ M/N group elements, and the hash function. The parameters are created either from the name of one of the RFC 9383 ciphersuites using HMAC key confirmation ("P256-SHA256", "P256-SHA512", "P384-SHA256", "P384-SHA512", or "P521-SHA512"), or for an application specific group using botan_spake2p_params_init_custom.
The identity, salt, and context parameters may be null, if the corresponding length is zero.
Since the lengths of the outputs vary with the system parameters, all outputs are produced using view callbacks. The expected lengths of the messages received from the peer can be obtained from botan_spake2p_params_share_size and botan_spake2p_params_confirmation_size. SPAKE2+ system parameters
| typedef struct botan_spake2p_prover_struct* botan_spake2p_prover_t |
| typedef struct botan_spake2p_verifier_struct* botan_spake2p_verifier_t |
| typedef struct botan_srp6_server_session_struct* botan_srp6_server_session_t |
| typedef struct botan_totp_struct* botan_totp_t |
| typedef struct botan_tpm2_crypto_backend_state_struct* botan_tpm2_crypto_backend_state_t |
| typedef struct botan_tpm2_ctx_struct* botan_tpm2_ctx_t |
| typedef struct botan_tpm2_session_struct* botan_tpm2_session_t |
| typedef int(* botan_view_bin_fn) (botan_view_ctx view_ctx, const uint8_t *data, size_t len) |
| typedef void* botan_view_ctx |
| typedef int(* botan_view_str_fn) (botan_view_ctx view_ctx, const char *str, size_t len) |
| typedef struct botan_x509_cert_struct* botan_x509_cert_t |
| typedef struct botan_x509_crl_entry_struct* botan_x509_crl_entry_t |
| typedef struct botan_x509_crl_struct* botan_x509_crl_t |
| typedef struct botan_x509_general_name_struct* botan_x509_general_name_t |
| typedef struct botan_xof_struct* botan_xof_t |
| enum BOTAN_FFI_ERROR |
Error codes
If you add a new value here be sure to also add it in botan_error_description
Definition at line 113 of file ffi.h.
Key usage constraints from the key usage extension
Must match values of Key_Constraints in pkix_enums.h
| Enumerator | |
|---|---|
| NO_CONSTRAINTS | |
| DIGITAL_SIGNATURE | |
| NON_REPUDIATION | |
| KEY_ENCIPHERMENT | |
| DATA_ENCIPHERMENT | |
| KEY_AGREEMENT | |
| KEY_CERT_SIGN | |
| CRL_SIGN | |
| ENCIPHER_ONLY | |
| DECIPHER_ONLY | |
Definition at line 3793 of file ffi.h.
Revocation reason codes for CRL entries, see RFC 5280 Section 5.3.1
Must match values of CRL_Code in pkix_enums.h
Definition at line 4153 of file ffi.h.
GeneralName type identifiers as defined in RFC 5280 A.2 (GeneralName ::= CHOICE) Type identifiers that are omitted here are (currently) not supported. Also, there is currently no way to access OTHER_NAME values via the FFI.
| Enumerator | |
|---|---|
| BOTAN_X509_OTHER_NAME | |
| BOTAN_X509_EMAIL_ADDRESS | |
| BOTAN_X509_DNS_NAME | |
| BOTAN_X509_DIRECTORY_NAME | |
| BOTAN_X509_URI | |
| BOTAN_X509_IP_ADDRESS | |
Definition at line 3851 of file ffi.h.
Generic values that may be retrieved from X.509 certificates or CRLs via the generic getter functions.
When extending this list the existing entries must stay backward-compatible to remain ABI compatible across versions. Therefore, new values must be added to the end of this list.
See:
Definition at line 3498 of file ffi.h.
| int botan_base64_decode | ( | const char * | base64_str, |
| size_t | in_len, | ||
| uint8_t * | out, | ||
| size_t * | out_len ) |
Perform base64 decoding
Definition at line 379 of file ffi.cpp.
References Botan_FFI::any_null_pointers(), Botan::base64_decode(), Botan::base64_decode_max_output(), BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and Botan_FFI::ffi_guard_thunk().
| int botan_base64_encode | ( | const uint8_t * | x, |
| size_t | len, | ||
| char * | out, | ||
| size_t * | out_len ) |
Perform base64 encoding
| x | the input data |
| len | the length of x |
| out | the output buffer |
| out_len | the size of the output buffer on input, set to the number of bytes written |
Definition at line 369 of file ffi.cpp.
References Botan::base64_encode(), BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::write_str_output().
| int botan_bcrypt_generate | ( | uint8_t * | out, |
| size_t * | out_len, | ||
| const char * | password, | ||
| botan_rng_t | rng, | ||
| size_t | work_factor, | ||
| uint32_t | flags ) |
Create a password hash using Bcrypt
| out | buffer holding the password hash, should be of length 64 bytes |
| out_len | the desired output length in bytes |
| password | the password |
| Random Number Generators | a random number generator |
| work_factor | how much work to do to slow down guessing attacks |
| flags | should be 0 in current API revision, all other uses are reserved and return BOTAN_FFI_ERROR_BAD_FLAG |
Output is formatted bcrypt $2a$...
TOD(Botan4) this should use char for the type of out
Definition at line 177 of file ffi_kdf.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan::generate_bcrypt(), Botan_FFI::safe_get(), and Botan_FFI::write_str_output().
| int botan_bcrypt_is_valid | ( | const char * | pass, |
| const char * | hash ) |
Check a previously created password hash
| pass | the password to check against |
| Hashes | the stored hash to check against |
Definition at line 209 of file ffi_kdf.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_INVALID_VERIFIER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan::check_bcrypt(), and Botan_FFI::ffi_guard_thunk().
| int botan_block_cipher_block_size | ( | botan_block_cipher_t | bc | ) |
Return the positive block size of this block cipher, or negative to indicate an error
Definition at line 61 of file ffi_block.cpp.
References BOTAN_FFI_ERROR_INVALID_OBJECT_STATE, and BOTAN_FFI_VISIT.
| int botan_block_cipher_clear | ( | botan_block_cipher_t | bc | ) |
Reinitializes the block cipher
Definition at line 43 of file ffi_block.cpp.
References BOTAN_FFI_VISIT.
| int botan_block_cipher_decrypt_blocks | ( | botan_block_cipher_t | bc, |
| const uint8_t | in[], | ||
| uint8_t | out[], | ||
| size_t | blocks ) |
Decrypt one or more blocks with the cipher
Definition at line 83 of file ffi_block.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_block_cipher_destroy | ( | botan_block_cipher_t | bc | ) |
Destroy a block cipher object
Destroy a block cipher object
Definition at line 39 of file ffi_block.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_block_cipher_encrypt_blocks | ( | botan_block_cipher_t | bc, |
| const uint8_t | in[], | ||
| uint8_t | out[], | ||
| size_t | blocks ) |
Encrypt one or more blocks with the cipher
Definition at line 76 of file ffi_block.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_block_cipher_get_keyspec | ( | botan_block_cipher_t | cipher, |
| size_t * | out_minimum_keylength, | ||
| size_t * | out_maximum_keylength, | ||
| size_t * | out_keylength_modulo ) |
Get the key length limits of this block cipher
| cipher | the object to read |
| out_minimum_keylength | if non-NULL, will be set to minimum keylength of cipher |
| out_maximum_keylength | if non-NULL, will be set to maximum keylength of cipher |
| out_keylength_modulo | if non-NULL will be set to byte multiple of valid keys |
Definition at line 98 of file ffi_block.cpp.
References BOTAN_FFI_VISIT.
| int botan_block_cipher_init | ( | botan_block_cipher_t * | bc, |
| const char * | cipher_name ) |
Initialize a block cipher object
Definition at line 19 of file ffi_block.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, Botan::BlockCipher::create(), Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_block_cipher_name | ( | botan_block_cipher_t | cipher, |
| char * | name, | ||
| size_t * | name_len ) |
Get the name of this block cipher
| cipher | the object to read |
| name | output buffer |
| name_len | on input, the length of buffer, on success the number of bytes written |
Definition at line 90 of file ffi_block.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::write_str_output().
| int botan_block_cipher_set_key | ( | botan_block_cipher_t | bc, |
| const uint8_t | key[], | ||
| size_t | len ) |
Set the key for a block cipher instance
Definition at line 50 of file ffi_block.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_cipher_clear | ( | botan_cipher_t | hash | ) |
Reset the key, nonce, AD and all other state on this cipher object
Definition at line 123 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
| int botan_cipher_destroy | ( | botan_cipher_t | cipher | ) |
Destroy the cipher object
Definition at line 119 of file ffi_cipher.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_cipher_get_default_nonce_length | ( | botan_cipher_t | cipher, |
| size_t * | nl ) |
Get the default nonce length of this cipher
Definition at line 338 of file ffi_cipher.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_cipher_get_ideal_update_granularity | ( | botan_cipher_t | cipher, |
| size_t * | ug ) |
Return the ideal update granularity of the cipher. This is some multiple of the update granularity, reflecting possibilities for optimization.
Definition at line 352 of file ffi_cipher.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_cipher_get_keyspec | ( | botan_cipher_t | cipher, |
| size_t * | min_keylen, | ||
| size_t * | max_keylen, | ||
| size_t * | mod_keylen ) |
Get information about the supported key lengths.
Definition at line 156 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
| int botan_cipher_get_tag_length | ( | botan_cipher_t | cipher, |
| size_t * | tag_size ) |
Get the tag length of the cipher (0 for non-AEAD modes)
Definition at line 359 of file ffi_cipher.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_cipher_get_update_granularity | ( | botan_cipher_t | cipher, |
| size_t * | ug ) |
Return the update granularity of the cipher; botan_cipher_update must be called with blocks of this size, except for the final.
Definition at line 345 of file ffi_cipher.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_cipher_init | ( | botan_cipher_t * | cipher, |
| const char * | name, | ||
| uint32_t | flags ) |
Initialize a cipher object
Definition at line 99 of file ffi_cipher.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_CIPHER_INIT_FLAG_ENCRYPT, BOTAN_CIPHER_INIT_FLAG_MASK_DIRECTION, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, Botan::Cipher_Mode::create(), Botan::Decryption, Botan::Encryption, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_cipher_is_authenticated | ( | botan_cipher_t | cipher | ) |
Returns 1 iff the cipher provides authentication as well as confidentiality.
Definition at line 366 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
| int botan_cipher_name | ( | botan_cipher_t | cipher, |
| char * | name, | ||
| size_t * | name_len ) |
Return the name of the cipher object
Definition at line 374 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::write_str_output().
| int botan_cipher_output_length | ( | botan_cipher_t | cipher, |
| size_t | in_len, | ||
| size_t * | out_len ) |
Return the output length of this cipher, for a particular input length.
Definition at line 137 of file ffi_cipher.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_cipher_query_keylen | ( | botan_cipher_t | cipher, |
| size_t * | out_minimum_keylength, | ||
| size_t * | out_maximum_keylength ) |
Get information about the key lengths. Prefer botan_cipher_get_keyspec
Definition at line 145 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
| int botan_cipher_requires_entire_message | ( | botan_cipher_t | cipher | ) |
Returns 1 iff the cipher requires the entire message before any encryption or decryption can be performed. No output data will be produced in botan_cipher_update() until the final flag is set.
Definition at line 370 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
| int botan_cipher_reset | ( | botan_cipher_t | cipher | ) |
Reset the message specific state for this cipher. Without resetting the keys, this resets the nonce, and any state associated with any message bits that have been processed so far.
It is conceptually equivalent to calling botan_cipher_clear followed by botan_cipher_set_key with the original key.
Definition at line 130 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
| int botan_cipher_set_associated_data | ( | botan_cipher_t | cipher, |
| const uint8_t * | ad, | ||
| size_t | ad_len ) |
Set the associated data. Will fail if cipher is not an AEAD
Definition at line 320 of file ffi_cipher.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and BOTAN_FFI_VISIT.
| int botan_cipher_set_key | ( | botan_cipher_t | cipher, |
| const uint8_t * | key, | ||
| size_t | key_len ) |
Set the key for this cipher object
Definition at line 173 of file ffi_cipher.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_cipher_start | ( | botan_cipher_t | cipher, |
| const uint8_t * | nonce, | ||
| size_t | nonce_len ) |
Begin processing a new message using the provided nonce
Definition at line 180 of file ffi_cipher.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan::Cipher_Mode::start().
| int botan_cipher_update | ( | botan_cipher_t | cipher, |
| uint32_t | flags, | ||
| uint8_t | output[], | ||
| size_t | output_size, | ||
| size_t * | output_written, | ||
| const uint8_t | input_bytes[], | ||
| size_t | input_size, | ||
| size_t * | input_consumed ) |
Encrypt/Decrypt some data and/or finalize the encryption/decryption.
This encrypts as many bytes from input_bytes into output_bytes as possible. Unless BOTAN_CIPHER_UPDATE_FLAG_FINAL is set, this function will consume bytes in multiples of botan_cipher_get_update_granularity(). input_consumed and output_written will be set accordingly and it is the caller's responsibility to adapt their buffers accordingly before calling this function again. Note that, unless BOTAN_CIPHER_UPDATE_FLAG_FINAL is set, the cipher will at most generate input_size output bytes.
Eventually, the caller must set the BOTAN_CIPHER_UPDATE_FLAG_FINAL flag to indicate that no more input will be provided. This will cause the cipher to consume all given input bytes and produce the final output; or return a BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE error if the given output buffer was too small. In the latter case, output_written will be set to the required buffer size. Calling again with BOTAN_CIPHER_UPDATE_FLAG_FINAL, a big enough buffer and no further input will then produce the final output.
Note that some ciphers require the entire message to be provided before any output is produced.
Definition at line 192 of file ffi_cipher.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_ASSERT_NOMSG, BOTAN_CIPHER_UPDATE_FLAG_FINAL, BOTAN_DEBUG_ASSERT, BOTAN_FFI_ERROR_BAD_MAC, BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_INVALID_OBJECT_STATE, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::copy_mem(), Botan_FFI::ffi_guard_thunk(), Botan::Cipher_Mode::finish(), Botan::Cipher_Mode::process(), Botan::Cipher_Mode::requires_entire_message(), and Botan_FFI::safe_get().
| int botan_cipher_valid_nonce_length | ( | botan_cipher_t | cipher, |
| size_t | nl ) |
Return if the specified nonce length is valid for this cipher
Definition at line 334 of file ffi_cipher.cpp.
References BOTAN_FFI_VISIT.
| int botan_constant_time_compare | ( | const uint8_t * | x, |
| const uint8_t * | y, | ||
| size_t | len ) |
Returns 0 if x[0..len] == y[0..len], or otherwise -1
Definition at line 327 of file ffi.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, and Botan::CT::is_equal().
Referenced by botan_same_mem().
| int botan_ec_group_destroy | ( | botan_ec_group_t | ec_group | ) |
Frees all resources of the EC Group object
| EC Group | the EC Group object to destroy |
Definition at line 21 of file ffi_ec.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_ec_group_equal | ( | botan_ec_group_t | curve1, |
| botan_ec_group_t | curve2 ) |
Test if two EC Groups describe the same curve
| curve1 | the first group |
| curve2 | the second group |
Definition at line 190 of file ffi_ec.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_ec_group_from_ber | ( | botan_ec_group_t * | ec_group, |
| const uint8_t * | ber, | ||
| size_t | ber_len ) |
Decode a BER encoded ECC domain parameter set
| EC Group | the new object will be placed here |
| ber | encoding |
| ber_len | size of the encoding in bytes |
Definition at line 72 of file ffi_ec.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_ec_group_from_name | ( | botan_ec_group_t * | ec_group, |
| const char * | name ) |
Initialize an EC Group from a common group name (eg "secp256r1")
| EC Group | the new object will be placed here |
| name | a known group name |
Definition at line 111 of file ffi_ec.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::EC_Group::from_name().
| int botan_ec_group_from_oid | ( | botan_ec_group_t * | ec_group, |
| botan_asn1_oid_t | oid ) |
Initialize an EC Group from a group named by an object identifier
| EC Group | the new object will be placed here |
| oid | a known OID |
Definition at line 98 of file ffi_ec.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan::EC_Group::from_OID(), and Botan_FFI::safe_get().
| int botan_ec_group_from_params | ( | botan_ec_group_t * | ec_group, |
| botan_asn1_oid_t | oid, | ||
| botan_mp_t | p, | ||
| botan_mp_t | a, | ||
| botan_mp_t | b, | ||
| botan_mp_t | base_x, | ||
| botan_mp_t | base_y, | ||
| botan_mp_t | order ) |
Create a new EC Group from parameters
| EC Group | the new object will be placed here |
| oid | the OID to associate with the group |
| p | the elliptic curve prime (at most 521 bits) |
| a | the elliptic curve a param |
| b | the elliptic curve b param |
| base_x | the x coordinate of the group generator |
| base_y | the y coordinate of the group generator |
| order | the order of the group |
Definition at line 51 of file ffi_ec.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_ec_group_from_pem | ( | botan_ec_group_t * | ec_group, |
| const char * | pem ) |
Initialize an EC Group from the PEM/ASN.1 encoding
Definition at line 85 of file ffi_ec.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::EC_Group::from_PEM().
| int botan_ec_group_get_a | ( | botan_mp_t * | a, |
| botan_ec_group_t | ec_group ) |
Get the a parameter of the elliptic curve equation
Definition at line 167 of file ffi_ec.cpp.
| int botan_ec_group_get_b | ( | botan_mp_t * | b, |
| botan_ec_group_t | ec_group ) |
Get the b parameter of the elliptic curve equation
Definition at line 171 of file ffi_ec.cpp.
| int botan_ec_group_get_curve_oid | ( | botan_asn1_oid_t * | oid, |
| botan_ec_group_t | ec_group ) |
Get the curve OID of an EC Group
Definition at line 139 of file ffi_ec.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::ffi_new_object().
| int botan_ec_group_get_g_x | ( | botan_mp_t * | g_x, |
| botan_ec_group_t | ec_group ) |
Get the x coordinate of the base point
Definition at line 175 of file ffi_ec.cpp.
| int botan_ec_group_get_g_y | ( | botan_mp_t * | g_y, |
| botan_ec_group_t | ec_group ) |
Get the y coordinate of the base point
Definition at line 180 of file ffi_ec.cpp.
| int botan_ec_group_get_order | ( | botan_mp_t * | order, |
| botan_ec_group_t | ec_group ) |
Get the order of the base point
Definition at line 185 of file ffi_ec.cpp.
| int botan_ec_group_get_p | ( | botan_mp_t * | p, |
| botan_ec_group_t | ec_group ) |
Get the prime modulus of the field
Definition at line 163 of file ffi_ec.cpp.
| int botan_ec_group_supports_application_specific_group | ( | int * | out | ) |
Checks if in this build configuration it is possible to register an application specific elliptic curve and sets
| out | to 1 if so, 0 otherwise |
Definition at line 25 of file ffi_ec.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and Botan::EC_Group::supports_application_specific_group().
| int botan_ec_group_supports_named_group | ( | const char * | name, |
| int * | out ) |
Checks if in this build configuration botan_ec_group_from_name(group_ptr, name) will succeed and sets
| name | the name of the group to check |
| out | to 1 if so, 0 otherwise. |
Definition at line 37 of file ffi_ec.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), and Botan::EC_Group::supports_named_group().
| int botan_ec_group_unregister | ( | botan_asn1_oid_t | oid | ) |
Unregister a previously registered group.
| oid | the oid associated with the group to unregister |
Using this is discouraged for normal use. This is only useful or necessary if you are registering a very large number of distinct groups, and need to worry about memory constraints.
Definition at line 124 of file ffi_ec.cpp.
References BOTAN_FFI_VISIT, and Botan::EC_Group::unregister().
| int botan_ec_group_view_der | ( | botan_ec_group_t | ec_group, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View an EC Group in DER encoding
Definition at line 128 of file ffi_ec.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
| int botan_ec_group_view_pem | ( | botan_ec_group_t | ec_group, |
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
View an EC Group in PEM encoding
Definition at line 133 of file ffi_ec.cpp.
References BOTAN_FFI_VISIT, Botan_FFI::invoke_view_callback(), and Botan::NamedCurve.
| int botan_ec_point_add | ( | botan_ec_point_t * | result, |
| botan_ec_point_t | x, | ||
| botan_ec_point_t | y ) |
Add two points
| result | the new object will be placed here |
| x | the first point |
| y | the second point |
Definition at line 346 of file ffi_ec.cpp.
References Botan::EC_AffinePoint::add(), Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_ec_point_destroy | ( | botan_ec_point_t | ec_point | ) |
Frees all resources of the point object
| ec_point | the point object to destroy |
Definition at line 230 of file ffi_ec.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_ec_point_equal | ( | botan_ec_point_t | x, |
| botan_ec_point_t | y ) |
Test if two points are equal
| x | the first point |
| y | the second point |
Definition at line 319 of file ffi_ec.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_ec_point_from_bytes | ( | botan_ec_point_t * | ec_point, |
| botan_ec_group_t | ec_group, | ||
| const uint8_t * | bytes, | ||
| size_t | bytes_len ) |
Create a point from a SEC1 compressed or uncompressed format.
Definition at line 267 of file ffi_ec.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::ffi_new_object().
| int botan_ec_point_from_xy | ( | botan_ec_point_t * | ec_point, |
| botan_ec_group_t | ec_group, | ||
| botan_mp_t | x, | ||
| botan_mp_t | y ) |
Create a point from a pair (x,y) of integers The integers must be within the field and must satisfy the curve equation
Definition at line 252 of file ffi_ec.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan::EC_AffinePoint::from_bigint_xy(), and Botan_FFI::safe_get().
| int botan_ec_point_generator | ( | botan_ec_point_t * | ec_point, |
| botan_ec_group_t | ec_group ) |
Create a point set to the standard group generator
Definition at line 243 of file ffi_ec.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::ffi_new_object(), and Botan::EC_AffinePoint::generator().
| int botan_ec_point_identity | ( | botan_ec_point_t * | ec_point, |
| botan_ec_group_t | ec_group ) |
Create a point set to the identity element of the group
Definition at line 234 of file ffi_ec.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::ffi_new_object(), and Botan::EC_AffinePoint::identity().
| int botan_ec_point_is_identity | ( | botan_ec_point_t | ec_point | ) |
Test if a point is the identity element of the group
| ec_point | the point to test |
Definition at line 315 of file ffi_ec.cpp.
References BOTAN_FFI_VISIT.
| int botan_ec_point_mul | ( | botan_ec_point_t * | result, |
| botan_ec_point_t | ec_point, | ||
| botan_ec_scalar_t | ec_scalar, | ||
| botan_rng_t | rng ) |
Multiply a point by a scalar
| result | the new object will be placed here |
| ec_point | the point to multiply |
| ec_scalar | the scalar to multiply by |
| Random Number Generators | a random number generator, used for blinding |
Definition at line 323 of file ffi_ec.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::ffi_new_object(), Botan::EC_AffinePoint::mul(), and Botan_FFI::safe_get().
| int botan_ec_point_negate | ( | botan_ec_point_t * | result, |
| botan_ec_point_t | ec_point ) |
Compute the additive inverse of a point
| result | the new object will be placed here |
| ec_point | point to negate |
Definition at line 336 of file ffi_ec.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::ffi_new_object(), and Botan::EC_AffinePoint::negate().
| int botan_ec_point_view_compressed | ( | botan_ec_point_t | ec_point, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the fixed length SEC1 compressed encoding
Definition at line 308 of file ffi_ec.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
| int botan_ec_point_view_uncompressed | ( | botan_ec_point_t | ec_point, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the fixed length SEC1 uncompressed encoding
Definition at line 301 of file ffi_ec.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
| int botan_ec_point_view_x_bytes | ( | botan_ec_point_t | ec_point, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the fixed length encoding of the affine x coordinate
Definition at line 280 of file ffi_ec.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
| int botan_ec_point_view_xy_bytes | ( | botan_ec_point_t | ec_point, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the fixed length encoding of the affine x and y coordinates
Definition at line 294 of file ffi_ec.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
| int botan_ec_point_view_y_bytes | ( | botan_ec_point_t | ec_point, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the fixed length encoding of the affine y coordinate
Definition at line 287 of file ffi_ec.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
| int botan_ec_privkey_create | ( | botan_privkey_t * | key, |
| const char * | algo_name, | ||
| botan_ec_group_t | ec_group, | ||
| botan_rng_t | rng ) |
Create a new ec private key
| key | the new object will be placed here |
| algo_name | something like "ECDSA" or "ECDH" |
| EC Group | a (possibly application specific) elliptic curve |
| Random Number Generators | a random number generator |
Definition at line 61 of file ffi_pkey.cpp.
References botan_ec_privkey_create(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, Botan::create_ec_private_key(), Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
Referenced by botan_ec_privkey_create().
| int botan_ec_privkey_get_group | ( | botan_privkey_t | key, |
| botan_ec_group_t * | ec_group ) |
Get the group of an elliptic curve private key
| key | the EC private key |
| EC Group | the new object will be placed here |
Definition at line 859 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan::EC_PublicKey::domain(), Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_ec_privkey_get_private_key | ( | botan_privkey_t | key, |
| botan_ec_scalar_t * | value ) |
Loads Diffie Hellman private key
| key | variable populated with key material |
| p | prime order of a Z_p group |
| g | group generator |
| x | private key |
| key | variable populated with key material |
| p | prime order of a Z_p group |
| g | group generator |
| y | public key |
/* Algorithm specific key operations: ElGamal Loads ElGamal public key
| key | variable populated with key material |
| p | prime order of a Z_p group |
| g | group generator |
| y | public key |
/** Loads ElGamal private key
| key | variable populated with key material |
| p | prime order of a Z_p group |
| g | group generator |
| x | private key |
/* Algorithm specific key operations: EC keys Get the secret scalar of an elliptic curve private key
| key | the EC private key |
| value | the new object will be placed here |
Definition at line 841 of file ffi_pkey_algs.cpp.
References Botan::EC_PrivateKey::_private_key(), Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_ec_pubkey_get_group | ( | botan_pubkey_t | key, |
| botan_ec_group_t * | ec_group ) |
Get the group of an elliptic curve public key
| key | the EC public key |
| EC Group | the new object will be placed here |
Definition at line 878 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan::EC_PublicKey::domain(), Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_ec_scalar_destroy | ( | botan_ec_scalar_t | ec_scalar | ) |
Frees all resources of the scalar object
| ec_scalar | the scalar object to destroy |
Definition at line 196 of file ffi_ec.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_ec_scalar_from_mp | ( | botan_ec_scalar_t * | ec_scalar, |
| botan_ec_group_t | ec_group, | ||
| botan_mp_t | mp ) |
Convert from an MPI to a scalar
Definition at line 209 of file ffi_ec.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::ffi_new_object(), Botan::EC_Scalar::from_bigint(), and Botan_FFI::safe_get().
| int botan_ec_scalar_random | ( | botan_ec_scalar_t * | ec_scalar, |
| botan_ec_group_t | ec_group, | ||
| botan_rng_t | rng ) |
Create a new random scalar value
Definition at line 200 of file ffi_ec.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::ffi_new_object(), Botan::EC_Scalar::random(), and Botan_FFI::safe_get().
| int botan_ec_scalar_to_mp | ( | botan_ec_scalar_t | ec_scalar, |
| botan_mp_t * | mp ) |
Convert from a scalar to an MPI
Definition at line 219 of file ffi_ec.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::ffi_new_object().
| const char * botan_error_description | ( | int | err | ) |
Convert an error code into a string. Returns "Unknown error" if the error code is not a known one.
Definition at line 146 of file ffi.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_BAD_MAC, BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_EXCEPTION_THROWN, BOTAN_FFI_ERROR_HTTP_ERROR, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_INTERNAL_ERROR, BOTAN_FFI_ERROR_INVALID_INPUT, BOTAN_FFI_ERROR_INVALID_KEY_LENGTH, BOTAN_FFI_ERROR_INVALID_OBJECT, BOTAN_FFI_ERROR_INVALID_OBJECT_STATE, BOTAN_FFI_ERROR_KEY_NOT_SET, BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_MEMORY, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_ERROR_STRING_CONVERSION_ERROR, BOTAN_FFI_ERROR_SYSTEM_ERROR, BOTAN_FFI_ERROR_TLS_ERROR, BOTAN_FFI_ERROR_UNKNOWN_ERROR, BOTAN_FFI_INVALID_VERIFIER, and BOTAN_FFI_SUCCESS.
| const char * botan_error_last_exception_message | ( | void | ) |
Return the message of the last exception caught in this thread.
This pointer can/will be reallocated or overwritten the next time this thread calls any other Botan FFI function and must be copied to persistent storage first.
Definition at line 142 of file ffi.cpp.
| uint32_t botan_ffi_api_version | ( | void | ) |
Return the version of the currently supported FFI API. This is expressed in the form YYYYMMDD of the release date of this version of the API.
Definition at line 223 of file ffi.cpp.
References BOTAN_HAS_FFI.
| int botan_ffi_supports_api | ( | uint32_t | api_version | ) |
Return 0 (ok) if the version given is one this library supports. botan_ffi_supports_api(botan_ffi_api_version()) will always return 0.
Definition at line 227 of file ffi.cpp.
References BOTAN_FFI_SUCCESS.
| int botan_fpe_decrypt | ( | botan_fpe_t | fpe, |
| botan_mp_t | x, | ||
| const uint8_t | tweak[], | ||
| size_t | tweak_len ) |
Decrypt an integer, replacing it with the result
| fpe | the FPE object |
| x | the value to decrypt, modified in place; must be less than n |
| tweak | the tweak, may be NULL if tweak_len is 0 |
| tweak_len | length of tweak in bytes |
Definition at line 82 of file ffi_fpe.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
| int botan_fpe_destroy | ( | botan_fpe_t | fpe | ) |
Frees all resources of the FPE object
| fpe | the FPE object to destroy |
Definition at line 56 of file ffi_fpe.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_fpe_encrypt | ( | botan_fpe_t | fpe, |
| botan_mp_t | x, | ||
| const uint8_t | tweak[], | ||
| size_t | tweak_len ) |
Encrypt an integer, replacing it with the result
| fpe | the FPE object |
| x | the value to encrypt, modified in place; must be less than n |
| tweak | the tweak, may be NULL if tweak_len is 0 |
| tweak_len | length of tweak in bytes |
Definition at line 65 of file ffi_fpe.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
| int botan_fpe_fe1_init | ( | botan_fpe_t * | fpe, |
| botan_mp_t | n, | ||
| const uint8_t | key[], | ||
| size_t | key_len, | ||
| size_t | rounds, | ||
| uint32_t | flags ) |
Initialize an FE1 format preserving encryption object, which encrypts integers in the range [0, n)
| fpe | the new object will be placed here |
| n | the modulus defining the range of the permutation |
| key | the key |
| key_len | length of key in bytes |
| rounds | the number of Feistel rounds; at least 16 is recommended |
| flags | 0, or BOTAN_FPE_FLAG_FE1_COMPAT_MODE to match the encoding used by Botan versions prior to 2.5 |
Definition at line 28 of file ffi_fpe.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FPE_FLAG_FE1_COMPAT_MODE, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_hash_block_size | ( | botan_hash_t | hash, |
| size_t * | block_size ) |
Writes the block size of the hash function to *block_size
| Hashes | hash object |
| block_size | output buffer to hold the hash function output length |
Definition at line 48 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_hash_clear | ( | botan_hash_t | hash | ) |
Reinitializes the state of the hash computation. A hash can be computed (with update/final) immediately.
| Hashes | hash object |
Definition at line 62 of file ffi_hash.cpp.
References BOTAN_FFI_VISIT.
| int botan_hash_copy_state | ( | botan_hash_t * | dest, |
| botan_hash_t | source ) |
Copy the state of a hash function object
| dest | destination hash object |
| source | source hash object |
Definition at line 86 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::ffi_new_object().
| int botan_hash_destroy | ( | botan_hash_t | hash | ) |
Frees all resources of the hash object
| Hashes | hash object |
Definition at line 37 of file ffi_hash.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_hash_final | ( | botan_hash_t | hash, |
| uint8_t | out[] ) |
Finalizes the hash computation and writes the output to out[0:botan_hash_output_length()] then reinitializes for computing another digest as if botan_hash_clear had been called.
| Hashes | hash object |
| out | output buffer |
Definition at line 78 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_hash_init | ( | botan_hash_t * | hash, |
| const char * | hash_name, | ||
| uint32_t | flags ) |
Initialize a hash function object
| Hashes | hash object |
| hash_name | name of the hash function, e.g., "SHA-384" |
| flags | should be 0 in current API revision, all other uses are reserved and return BOTAN_FFI_ERROR_BAD_FLAG |
Definition at line 18 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::HashFunction::create(), Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_hash_name | ( | botan_hash_t | hash, |
| char * | name, | ||
| size_t * | name_len ) |
Get the name of this hash function
| Hashes | the object to read |
| name | output buffer |
| name_len | on input, the length of buffer, on success the number of bytes written |
Definition at line 93 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::write_str_output().
| int botan_hash_output_length | ( | botan_hash_t | hash, |
| size_t * | output_length ) |
Writes the output length of the hash function to *output_length
| Hashes | hash object |
| output_length | output buffer to hold the hash function output length |
Definition at line 41 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_hash_security_level | ( | botan_hash_t | hash, |
| size_t * | security_level ) |
Writes the estimated security level of the hash function, in bits, with respect to collision resistance, to *security_level. Returns zero for checksums and any hash where finding collisions is trivial.
| Hashes | hash object |
| security_level | output variable to hold the security level |
Definition at line 55 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_hash_update | ( | botan_hash_t | hash, |
| const uint8_t * | in, | ||
| size_t | in_len ) |
Send more input to the hash function
| Hashes | hash object |
| in | input buffer |
| in_len | number of bytes to read from the input buffer |
Definition at line 66 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_hex_decode | ( | const char * | hex_str, |
| size_t | in_len, | ||
| uint8_t * | out, | ||
| size_t * | out_len ) |
Perform hex decoding
| hex_str | a string of hex chars (whitespace is ignored) |
| in_len | the length of hex_str |
| out | the output buffer should be at least strlen(hex_str)/2 bytes |
| out_len | the size of the output buffer on input, set to the number of bytes written |
Definition at line 359 of file ffi.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan::hex_decode(), and Botan_FFI::write_vec_output().
| int botan_hex_encode | ( | const uint8_t * | x, |
| size_t | len, | ||
| char * | out, | ||
| uint32_t | flags ) |
Perform hex encoding
| x | is some binary data |
| len | length of x in bytes |
| out | an array of at least x*2 bytes |
| flags | flags out be upper or lower case? |
Definition at line 348 of file ffi.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_HEX_LOWER_CASE, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), and Botan::hex_encode().
| int botan_hotp_check | ( | botan_hotp_t | hotp, |
| uint64_t * | next_hotp_counter, | ||
| uint32_t | hotp_code, | ||
| uint64_t | hotp_counter, | ||
| size_t | resync_range ) |
Verify a HOTP code
Definition at line 67 of file ffi_hotp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_INVALID_VERIFIER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_hotp_destroy | ( | botan_hotp_t | hotp | ) |
Destroy a HOTP instance
Definition at line 44 of file ffi_hotp.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_hotp_generate | ( | botan_hotp_t | hotp, |
| uint32_t * | hotp_code, | ||
| uint64_t | hotp_counter ) |
Generate a HOTP code for the provided counter
Definition at line 53 of file ffi_hotp.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_hotp_init | ( | botan_hotp_t * | hotp, |
| const uint8_t | key[], | ||
| size_t | key_len, | ||
| const char * | hash_algo, | ||
| size_t | digits ) |
Initialize a HOTP instance
Definition at line 26 of file ffi_hotp.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_kdf | ( | const char * | kdf_algo, |
| uint8_t | out[], | ||
| size_t | out_len, | ||
| const uint8_t | secret[], | ||
| size_t | secret_len, | ||
| const uint8_t | salt[], | ||
| size_t | salt_len, | ||
| const uint8_t | label[], | ||
| size_t | label_len ) |
Derive a key
| kdf_algo | KDF algorithm, e.g., "SP800-56C" |
| out | buffer holding the derived key, must be of length out_len |
| out_len | the desired output length in bytes |
| secret | the secret input |
| secret_len | size of secret in bytes |
| salt | a diversifier |
| salt_len | size of salt in bytes |
| label | purpose for the derived keying material |
| label_len | size of label in bytes |
Definition at line 143 of file ffi_kdf.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::KDF::create_or_throw(), and Botan_FFI::ffi_guard_thunk().
| int botan_key_unwrap3394 | ( | const uint8_t | wrapped_key[], |
| size_t | wrapped_key_len, | ||
| const uint8_t | kek[], | ||
| size_t | kek_len, | ||
| uint8_t | key[], | ||
| size_t * | key_len ) |
Key unwrapping as per RFC 3394
| wrapped_key | the wrapped key to unwrap |
| wrapped_key_len | length of wrapped_key in bytes |
| kek | the key encryption key |
| kek_len | length of kek in bytes |
| key | output buffer for the unwrapped key |
| key_len | on input the size of key, on output the number of bytes written or required |
Definition at line 104 of file ffi_keywrap.cpp.
References botan_nist_kw_dec().
| int botan_key_wrap3394 | ( | const uint8_t | key[], |
| size_t | key_len, | ||
| const uint8_t | kek[], | ||
| size_t | kek_len, | ||
| uint8_t | wrapped_key[], | ||
| size_t * | wrapped_key_len ) |
Key wrapping as per RFC 3394
Definition at line 93 of file ffi_keywrap.cpp.
References botan_nist_kw_enc().
| int botan_mac_clear | ( | botan_mac_t | mac | ) |
Reinitializes the state of the MAC computation. A MAC can be computed (with update/final) immediately.
| Message Authentication Codes | mac object |
Definition at line 62 of file ffi_mac.cpp.
References BOTAN_FFI_VISIT.
| int botan_mac_destroy | ( | botan_mac_t | mac | ) |
Frees all resources of the MAC object
| Message Authentication Codes | mac object |
Definition at line 36 of file ffi_mac.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_mac_final | ( | botan_mac_t | mac, |
| uint8_t | out[] ) |
Finalizes the MAC computation and writes the output to out[0:botan_mac_output_length()] then reinitializes for computing another MAC as if botan_mac_clear had been called.
| Message Authentication Codes | mac object |
| out | output buffer |
Definition at line 76 of file ffi_mac.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_mac_get_keyspec | ( | botan_mac_t | mac, |
| size_t * | out_minimum_keylength, | ||
| size_t * | out_maximum_keylength, | ||
| size_t * | out_keylength_modulo ) |
Get the key length limits of this auth code
| Message Authentication Codes | the object to read |
| out_minimum_keylength | if non-NULL, will be set to minimum keylength of MAC |
| out_maximum_keylength | if non-NULL, will be set to maximum keylength of MAC |
| out_keylength_modulo | if non-NULL will be set to byte multiple of valid keys |
Definition at line 87 of file ffi_mac.cpp.
References BOTAN_FFI_VISIT.
| int botan_mac_init | ( | botan_mac_t * | mac, |
| const char * | mac_name, | ||
| uint32_t | flags ) |
Initialize a message authentication code object
| Message Authentication Codes | mac object |
| mac_name | name of the hash function, e.g., "HMAC(SHA-384)" |
| flags | should be 0 in current API revision, all other uses are reserved and return a negative value (error code) |
Definition at line 18 of file ffi_mac.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, Botan::MessageAuthenticationCode::create(), Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_mac_name | ( | botan_mac_t | mac, |
| char * | name, | ||
| size_t * | name_len ) |
Get the name of this MAC
| Message Authentication Codes | the object to read |
| name | output buffer |
| name_len | on input, the length of buffer, on success the number of bytes written |
Definition at line 83 of file ffi_mac.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::write_str_output().
| int botan_mac_output_length | ( | botan_mac_t | mac, |
| size_t * | output_length ) |
Writes the output length of the message authentication code to *output_length
| Message Authentication Codes | mac object |
| output_length | output buffer to hold the MAC output length |
Definition at line 55 of file ffi_mac.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_mac_set_key | ( | botan_mac_t | mac, |
| const uint8_t * | key, | ||
| size_t | key_len ) |
Sets the key on the MAC
| Message Authentication Codes | mac object |
| key | buffer holding the key |
| key_len | size of the key buffer in bytes |
Definition at line 40 of file ffi_mac.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_mac_set_nonce | ( | botan_mac_t | mac, |
| const uint8_t * | nonce, | ||
| size_t | nonce_len ) |
Sets the nonce on the MAC
| Message Authentication Codes | mac object |
| nonce | buffer holding the key |
| nonce_len | size of the key buffer in bytes |
Definition at line 47 of file ffi_mac.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_mac_update | ( | botan_mac_t | mac, |
| const uint8_t * | buf, | ||
| size_t | len ) |
Send more input to the message authentication code
| Message Authentication Codes | mac object |
| buf | input buffer |
| len | number of bytes to read from the input buffer |
Definition at line 66 of file ffi_mac.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and BOTAN_FFI_VISIT.
| int botan_mceies_decrypt | ( | botan_privkey_t | mce_key, |
| const char * | aead, | ||
| const uint8_t | ct[], | ||
| size_t | ct_len, | ||
| const uint8_t | ad[], | ||
| size_t | ad_len, | ||
| uint8_t | pt[], | ||
| size_t * | pt_len ) |
Formerly decrypted a message using McEliece with an AEAD.
Always returns BOTAN_FFI_ERROR_NOT_IMPLEMENTED
| mce_key | ignored |
| AEAD Modes | ignored |
| ct | ignored |
| ct_len | ignored |
| ad | ignored |
| ad_len | ignored |
| pt | ignored |
| pt_len | ignored |
Definition at line 1564 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_mceies_encrypt | ( | botan_pubkey_t | mce_key, |
| botan_rng_t | rng, | ||
| const char * | aead, | ||
| const uint8_t | pt[], | ||
| size_t | pt_len, | ||
| const uint8_t | ad[], | ||
| size_t | ad_len, | ||
| uint8_t | ct[], | ||
| size_t * | ct_len ) |
Formerly encrypted a message using McEliece with an AEAD.
Always returns BOTAN_FFI_ERROR_NOT_IMPLEMENTED
| mce_key | ignored |
| Random Number Generators | ignored |
| AEAD Modes | ignored |
| pt | ignored |
| pt_len | ignored |
| ad | ignored |
| ad_len | ignored |
| ct | ignored |
| ct_len | ignored |
Definition at line 1576 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_mp_add | ( | botan_mp_t | result, |
| botan_mp_t | x, | ||
| botan_mp_t | y ) |
Set result to x + y
| result | set to the sum |
| x | the first addend |
| y | the second addend |
Definition at line 161 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_mp_add_u32 | ( | botan_mp_t | result, |
| botan_mp_t | x, | ||
| uint32_t | y ) |
Set result to x + y
| result | set to the sum |
| x | the first addend |
| y | the second addend |
Definition at line 181 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_mp_clear | ( | botan_mp_t | mp | ) |
| int botan_mp_clear_bit | ( | botan_mp_t | n, |
| size_t | bit ) |
| int botan_mp_cmp | ( | int * | result, |
| botan_mp_t | x, | ||
| botan_mp_t | y ) |
Compare two integers
| result | set to -1 if x < y, 0 if x == y, 1 if x > y |
| x | the first integer |
| y | the second integer |
Definition at line 235 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_mp_destroy | ( | botan_mp_t | mp | ) |
Destroy (deallocate) an MPI
Definition at line 157 of file ffi_mp.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_mp_div | ( | botan_mp_t | quotient, |
| botan_mp_t | remainder, | ||
| botan_mp_t | x, | ||
| botan_mp_t | y ) |
Divide x by y, producing both the quotient and the remainder
| quotient | set to x / y |
| remainder | set to x % y |
| x | the dividend |
| y | the divisor, which must not be zero |
Definition at line 211 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, Botan_FFI::safe_get(), and Botan::vartime_divide().
| int botan_mp_equal | ( | botan_mp_t | x, |
| botan_mp_t | y ) |
Test if two integers are equal
| x | the first integer |
| y | the second integer |
Definition at line 219 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_mp_flip_sign | ( | botan_mp_t | mp | ) |
Negate the MPI, ie replace it by its additive inverse
| Big Integer (Low-Level) | the integer to negate, modified in place |
Definition at line 80 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
| int botan_mp_from_bin | ( | botan_mp_t | mp, |
| const uint8_t | vec[], | ||
| size_t | vec_len ) |
Set an MP to the big-endian binary value
| Big Integer (Low-Level) | the integer to set |
| vec | the big-endian encoding to decode |
| vec_len | length of vec in bytes |
Definition at line 84 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_mp_gcd | ( | botan_mp_t | out, |
| botan_mp_t | x, | ||
| botan_mp_t | y ) |
Set out to the greatest common divisor of x and y
| out | set to gcd(x, y) |
| x | the first integer |
| y | the second integer |
Definition at line 282 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, Botan::gcd(), and Botan_FFI::safe_get().
| int botan_mp_get_bit | ( | botan_mp_t | n, |
| size_t | bit ) |
Returns 0 if specified bit of n is not set Returns 1 if specified bit of n is set Returns negative number on error
Definition at line 290 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
| int botan_mp_init | ( | botan_mp_t * | mp | ) |
Initialize an MPI
Definition at line 24 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_mp_is_even | ( | botan_mp_t | mp | ) |
Return 1 iff mp is even
| Big Integer (Low-Level) | the integer to test |
Definition at line 231 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
| int botan_mp_is_negative | ( | botan_mp_t | mp | ) |
Return 1 iff mp is less than 0
Definition at line 72 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
| int botan_mp_is_odd | ( | botan_mp_t | mp | ) |
Return 1 iff mp is odd
| Big Integer (Low-Level) | the integer to test |
Definition at line 227 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
| int botan_mp_is_positive | ( | botan_mp_t | mp | ) |
This function should have been named mp_is_non_negative. Returns 1 iff mp is greater than or equal to zero. Use botan_mp_is_negative to detect negative numbers, botan_mp_is_zero to check for zero.
Definition at line 76 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
| int botan_mp_is_prime | ( | botan_mp_t | n, |
| botan_rng_t | rng, | ||
| size_t | test_prob ) |
Returns 0 if n is not prime Returns 1 if n is prime Returns negative number on error
Definition at line 286 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, Botan::is_prime(), and Botan_FFI::safe_get().
| int botan_mp_is_zero | ( | botan_mp_t | mp | ) |
Return 1 iff mp is equal to zero
| Big Integer (Low-Level) | the integer to test |
Definition at line 223 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT.
| int botan_mp_lshift | ( | botan_mp_t | out, |
| botan_mp_t | in, | ||
| size_t | shift ) |
Set out to in shifted left by the specified number of bits
| out | set to the shifted value |
| in | the integer to shift |
| shift | the number of bits to shift by |
Definition at line 252 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_mp_mod_inverse | ( | botan_mp_t | out, |
| botan_mp_t | in, | ||
| botan_mp_t | modulus ) |
Set out to the inverse of in modulo the specified modulus. If no inverse exists, out is set to zero.
| out | set to the modular inverse |
| in | the value to invert |
| modulus | the modulus |
Definition at line 260 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, Botan::inverse_mod_general(), Botan_FFI::safe_get(), and Botan::BigInt::zero().
| int botan_mp_mod_mul | ( | botan_mp_t | result, |
| botan_mp_t | x, | ||
| botan_mp_t | y, | ||
| botan_mp_t | mod ) |
Set result to (x * y) % mod
| result | set to the modular product |
| x | the first factor |
| y | the second factor |
| mod | the modulus, which must be positive |
Definition at line 266 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, Botan::Barrett_Reduction::for_secret_modulus(), and Botan_FFI::safe_get().
| int botan_mp_mul | ( | botan_mp_t | result, |
| botan_mp_t | x, | ||
| botan_mp_t | y ) |
Set result to x * y
| result | set to the product |
| x | the first factor |
| y | the second factor |
Definition at line 201 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_mp_num_bits | ( | botan_mp_t | n, |
| size_t * | bits ) |
Return the number of significant bits in the MPI
Definition at line 302 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_mp_num_bytes | ( | botan_mp_t | n, |
| size_t * | bytes ) |
Return the number of significant bytes in the MPI
Definition at line 309 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_mp_powmod | ( | botan_mp_t | out, |
| botan_mp_t | base, | ||
| botan_mp_t | exponent, | ||
| botan_mp_t | modulus ) |
Set out to (base^exponent) % modulus
| out | set to the result of the modular exponentiation |
| Base Types | the base |
| exponent | the exponent |
| modulus | the modulus, which must be positive |
Definition at line 247 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, Botan::power_mod(), and Botan_FFI::safe_get().
| int botan_mp_rand_bits | ( | botan_mp_t | rand_out, |
| botan_rng_t | rng, | ||
| size_t | bits ) |
Set rand_out to a random integer of the specified bit length
| rand_out | set to the random integer |
| Random Number Generators | a random number generator |
| bits | the desired bit length |
Definition at line 273 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_mp_rand_range | ( | botan_mp_t | rand_out, |
| botan_rng_t | rng, | ||
| botan_mp_t | lower_bound, | ||
| botan_mp_t | upper_bound ) |
Set rand_out to a random integer within the half-open range [lower_bound, upper_bound)
| rand_out | set to the random integer |
| Random Number Generators | a random number generator |
| lower_bound | the inclusive lower bound |
| upper_bound | the exclusive upper bound |
Definition at line 277 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, Botan::BigInt::random_integer(), and Botan_FFI::safe_get().
| int botan_mp_rshift | ( | botan_mp_t | out, |
| botan_mp_t | in, | ||
| size_t | shift ) |
Set out to in shifted right by the specified number of bits
| out | set to the shifted value |
| in | the integer to shift |
| shift | the number of bits to shift by |
Definition at line 256 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_mp_set_bit | ( | botan_mp_t | n, |
| size_t | bit ) |
| int botan_mp_set_from_int | ( | botan_mp_t | mp, |
| int | initial_value ) |
Set the MPI value from an int
Definition at line 39 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan::BigInt::from_s32().
| int botan_mp_set_from_mp | ( | botan_mp_t | dest, |
| botan_mp_t | source ) |
Set the MPI value from another MP object
Definition at line 68 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_mp_set_from_radix_str | ( | botan_mp_t | dest, |
| const char * | str, | ||
| size_t | radix ) |
Set the MPI value from a string with arbitrary radix. For arbitrary being 10 or 16.
Definition at line 51 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and Botan::BigInt::from_radix_digits().
| int botan_mp_set_from_str | ( | botan_mp_t | dest, |
| const char * | str ) |
Set the MPI value from a string
Definition at line 43 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_mp_sub | ( | botan_mp_t | result, |
| botan_mp_t | x, | ||
| botan_mp_t | y ) |
Set result to x - y
| result | set to the difference |
| x | the minuend |
| y | the subtrahend |
Definition at line 171 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_mp_sub_u32 | ( | botan_mp_t | result, |
| botan_mp_t | x, | ||
| uint32_t | y ) |
Set result to x - y
| result | set to the difference |
| x | the minuend |
| y | the subtrahend |
Definition at line 191 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_mp_swap | ( | botan_mp_t | x, |
| botan_mp_t | y ) |
Swap the values of two integers
| x | the first integer |
| y | the second integer |
Definition at line 242 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_mp_to_bin | ( | botan_mp_t | mp, |
| uint8_t | vec[] ) |
Convert the MPI to a big-endian binary string. Writes botan_mp_num_bytes to vec
Note that the sign of the integer is ignored here; only the absolute value is copied
| Big Integer (Low-Level) | the integer to encode |
| vec | output buffer of at least botan_mp_num_bytes(mp) bytes |
Definition at line 136 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_mp_to_hex | ( | botan_mp_t | mp, |
| char * | out ) |
Convert the MPI to a hex string. Writes up to botan_mp_num_bytes(mp)*2 + 5 bytes
Prefer botan_mp_view_hex
Definition at line 91 of file ffi_mp.cpp.
References BOTAN_ASSERT_NOMSG, BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_mp_to_str | ( | botan_mp_t | mp, |
| uint8_t | radix, | ||
| char * | out, | ||
| size_t * | out_len ) |
Convert the MPI to a string. Currently radix == 10 and radix == 16 are supported.
Definition at line 112 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_VISIT, and Botan_FFI::write_str_output().
| int botan_mp_to_uint32 | ( | botan_mp_t | mp, |
| uint32_t * | val ) |
Convert the MPI to a uint32_t, if possible. Fails if MPI is negative or too large.
| Big Integer (Low-Level) | the integer to convert |
| val | set to the value of mp |
Definition at line 150 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_mp_view_bin | ( | botan_mp_t | mp, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the big-endian binary string encoding of this integer
Note that the sign of the integer is ignored here; only the absolute value is viewed
| Big Integer (Low-Level) | the integer to encode |
| ctx | an application context passed to the view function |
| view | the view callback which receives the encoding |
Definition at line 143 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
| int botan_mp_view_hex | ( | botan_mp_t | mp, |
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
View the hex string encoding of the MPI.
Definition at line 105 of file ffi_mp.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
| int botan_mp_view_str | ( | botan_mp_t | mp, |
| uint8_t | radix, | ||
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
View the MPI as a radix-N integer. Currently only radix 10 and radix 16 are supported
Definition at line 124 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
| int botan_nist_kw_dec | ( | const char * | cipher_algo, |
| int | padded, | ||
| const uint8_t | wrapped_key[], | ||
| size_t | wrapped_key_len, | ||
| const uint8_t | kek[], | ||
| size_t | kek_len, | ||
| uint8_t | key[], | ||
| size_t * | key_len ) |
Key unwrapping as per NIST SP 800-38F
| cipher_algo | the block cipher to use, eg "AES-256" |
| padded | if non-zero use KWP (the padded variant), otherwise KW |
| wrapped_key | the wrapped key to unwrap |
| wrapped_key_len | length of wrapped_key in bytes |
| kek | the key encryption key |
| kek_len | length of kek in bytes |
| key | output buffer for the unwrapped key |
| key_len | on input the size of key, on output the number of bytes written or required |
Definition at line 57 of file ffi_keywrap.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan::BlockCipher::create_or_throw(), Botan_FFI::ffi_guard_thunk(), Botan::nist_key_unwrap(), Botan::nist_key_unwrap_padded(), and Botan_FFI::write_vec_output().
Referenced by botan_key_unwrap3394().
| int botan_nist_kw_enc | ( | const char * | cipher_algo, |
| int | padded, | ||
| const uint8_t | key[], | ||
| size_t | key_len, | ||
| const uint8_t | kek[], | ||
| size_t | kek_len, | ||
| uint8_t | wrapped_key[], | ||
| size_t * | wrapped_key_len ) |
Key wrapping as per NIST SP 800-38F
| cipher_algo | the block cipher to use, eg "AES-256" |
| padded | if non-zero use KWP (the padded variant), otherwise KW |
| key | the key to wrap |
| key_len | length of key in bytes |
| kek | the key encryption key |
| kek_len | length of kek in bytes |
| wrapped_key | output buffer for the wrapped key |
| wrapped_key_len | on input the size of wrapped_key, on output the number of bytes written or required |
Definition at line 22 of file ffi_keywrap.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan::BlockCipher::create_or_throw(), Botan_FFI::ffi_guard_thunk(), Botan::nist_key_wrap(), Botan::nist_key_wrap_padded(), and Botan_FFI::write_vec_output().
Referenced by botan_key_wrap3394().
| int botan_oid_cmp | ( | int * | result, |
| botan_asn1_oid_t | a, | ||
| botan_asn1_oid_t | b ) |
Sets
| result | to comparison result: -1 if a < b, 0 if a == b, 1 if a > b |
Definition at line 63 of file ffi_oid.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_oid_destroy | ( | botan_asn1_oid_t | oid | ) |
Frees all resources of the OID object
| oid | the OID object to destroy |
Definition at line 18 of file ffi_oid.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_oid_equal | ( | botan_asn1_oid_t | a, |
| botan_asn1_oid_t | b ) |
Test if two OIDs are equal
| a | the first OID |
| b | the second OID |
Definition at line 59 of file ffi_oid.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_oid_from_string | ( | botan_asn1_oid_t * | oid, |
| const char * | oid_str ) |
Create an OID from a string, either dot notation (e.g. '1.2.3.4') or a registered name (e.g. 'RSA')
| oid | handle to the resulting OID |
| oid_str | the name of the OID to create |
Definition at line 22 of file ffi_oid.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::OID::from_string().
| int botan_oid_register | ( | botan_asn1_oid_t | oid, |
| const char * | name ) |
Registers an OID so that it may later be retrieved by name
Definition at line 40 of file ffi_oid.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and Botan::OID::register_oid().
| int botan_oid_view_name | ( | botan_asn1_oid_t | oid, |
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
View an OIDs registered name if it exists, else its dot notation
Definition at line 54 of file ffi_oid.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
| int botan_oid_view_string | ( | botan_asn1_oid_t | oid, |
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
View an OID in dot notation
Definition at line 50 of file ffi_oid.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
| int botan_pbkdf | ( | const char * | pbkdf_algo, |
| uint8_t | out[], | ||
| size_t | out_len, | ||
| const char * | passphrase, | ||
| const uint8_t | salt[], | ||
| size_t | salt_len, | ||
| size_t | iterations ) |
Derive a key from a passphrase for a number of iterations
| pbkdf_algo | PBKDF algorithm, e.g., "PBKDF2(SHA-256)" |
| out | buffer to store the derived key, must be of out_len bytes |
| out_len | the desired length of the key to produce |
| passphrase | the password to derive the key from |
| salt | a randomly chosen salt |
| salt_len | length of salt in bytes |
| iterations | the number of iterations to use (use 10K or more) |
Deprecated: use botan_pwdhash(pbkdf_algo, iterations, 0, 0, out, out_len, passphrase, 0, salt, salt_len);
Definition at line 23 of file ffi_kdf.cpp.
References botan_pwdhash().
| int botan_pbkdf_timed | ( | const char * | pbkdf_algo, |
| uint8_t | out[], | ||
| size_t | out_len, | ||
| const char * | passphrase, | ||
| const uint8_t | salt[], | ||
| size_t | salt_len, | ||
| size_t | milliseconds_to_run, | ||
| size_t * | out_iterations_used ) |
Derive a key from a passphrase, running until msec time has elapsed.
| pbkdf_algo | PBKDF algorithm, e.g., "PBKDF2(SHA-256)" |
| out | buffer to store the derived key, must be of out_len bytes |
| out_len | the desired length of the key to produce |
| passphrase | the password to derive the key from |
| salt | a randomly chosen salt |
| salt_len | length of salt in bytes |
| milliseconds_to_run | if iterations is zero, then instead the PBKDF is run until milliseconds_to_run milliseconds has passed |
| out_iterations_used | set to the number iterations executed |
Deprecated: use
botan_pwdhash_timed(pbkdf_algo, static_cast<uint32_t>(ms_to_run), iterations_used, nullptr, nullptr, out, out_len, password, 0, salt, salt_len);
Definition at line 33 of file ffi_kdf.cpp.
References botan_pwdhash_timed().
| int botan_pk_op_decrypt | ( | botan_pk_op_decrypt_t | op, |
| uint8_t | out[], | ||
| size_t * | out_len, | ||
| const uint8_t | ciphertext[], | ||
| size_t | ciphertext_len ) |
Decrypt a message with a private key
| op | the decryption operation |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
| ciphertext | the message to decrypt |
| ciphertext_len | length of ciphertext in bytes |
Definition at line 105 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::write_vec_output().
| int botan_pk_op_decrypt_create | ( | botan_pk_op_decrypt_t * | op, |
| botan_privkey_t | key, | ||
| const char * | padding, | ||
| uint32_t | flags ) |
Create a public key decryption operation
| op | the new object will be placed here |
| key | the private key to decrypt with |
| padding | the padding/encoding method, eg "OAEP(SHA-256)" |
| flags | should be 0 in current API revision |
Definition at line 74 of file ffi_pk_op.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan_FFI::safe_get(), and Botan::system_rng().
| int botan_pk_op_decrypt_destroy | ( | botan_pk_op_decrypt_t | op | ) |
Frees all resources of the decryption operation object
| op | the operation to destroy |
Definition at line 94 of file ffi_pk_op.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_pk_op_decrypt_output_length | ( | botan_pk_op_decrypt_t | op, |
| size_t | ctext_len, | ||
| size_t * | ptext_len ) |
Return an upper bound on the plaintext length for a given ciphertext length
| op | the decryption operation |
| ctext_len | the ciphertext length in bytes |
| ptext_len | set to the maximum plaintext length in bytes |
Definition at line 98 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_pk_op_encrypt | ( | botan_pk_op_encrypt_t | op, |
| botan_rng_t | rng, | ||
| uint8_t | out[], | ||
| size_t * | out_len, | ||
| const uint8_t | plaintext[], | ||
| size_t | plaintext_len ) |
Encrypt a message with a public key
| op | the encryption operation |
| Random Number Generators | a random number generator |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
| plaintext | the message to encrypt |
| plaintext_len | length of plaintext in bytes |
Definition at line 56 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::safe_get(), and Botan_FFI::write_vec_output().
| int botan_pk_op_encrypt_create | ( | botan_pk_op_encrypt_t * | op, |
| botan_pubkey_t | key, | ||
| const char * | padding, | ||
| uint32_t | flags ) |
Create a public key encryption operation
| op | the new object will be placed here |
| key | the public key to encrypt to |
| padding | the padding/encoding method, eg "OAEP(SHA-256)" |
| flags | should be 0 in current API revision |
Definition at line 28 of file ffi_pk_op.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_PUBKEY_DER_FORMAT_SIGNATURE, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan_FFI::safe_get(), and Botan::system_rng().
| int botan_pk_op_encrypt_destroy | ( | botan_pk_op_encrypt_t | op | ) |
Frees all resources of the encryption operation object
| op | the operation to destroy |
Definition at line 45 of file ffi_pk_op.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_pk_op_encrypt_output_length | ( | botan_pk_op_encrypt_t | op, |
| size_t | ptext_len, | ||
| size_t * | ctext_len ) |
Return the ciphertext length for a given plaintext length
| op | the encryption operation |
| ptext_len | the plaintext length in bytes |
| ctext_len | set to the resulting ciphertext length in bytes |
Definition at line 49 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_pk_op_kem_decrypt_create | ( | botan_pk_op_kem_decrypt_t * | op, |
| botan_privkey_t | key, | ||
| const char * | kdf ) |
Create a key decapsulation operation
| op | the new object will be placed here |
| key | the private key to decapsulate with |
| Key Derivation Functions | the KDF applied to the shared secret, or "Raw" for no KDF |
Definition at line 341 of file ffi_pk_op.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan_FFI::safe_get(), and Botan::system_rng().
| int botan_pk_op_kem_decrypt_destroy | ( | botan_pk_op_kem_decrypt_t | op | ) |
Frees all resources of the key decapsulation operation object
| op | the operation to destroy |
Definition at line 388 of file ffi_pk_op.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_pk_op_kem_decrypt_shared_key | ( | botan_pk_op_kem_decrypt_t | op, |
| const uint8_t | salt[], | ||
| size_t | salt_len, | ||
| const uint8_t | encapsulated_key[], | ||
| size_t | encapsulated_key_len, | ||
| size_t | desired_shared_key_len, | ||
| uint8_t | shared_key[], | ||
| size_t * | shared_key_len ) |
Recover the shared key from an encapsulated key
| op | the decapsulation operation |
| salt | a salt passed to the KDF, may be NULL if salt_len is 0 |
| salt_len | length of salt in bytes |
| encapsulated_key | the encapsulated key from the counterparty |
| encapsulated_key_len | length of encapsulated_key in bytes |
| desired_shared_key_len | the requested shared key length in bytes |
| shared_key | output buffer for the shared key |
| shared_key_len | on input the size of shared_key, on output the number of bytes written |
Definition at line 365 of file ffi_pk_op.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::write_vec_output().
| int botan_pk_op_kem_decrypt_shared_key_length | ( | botan_pk_op_kem_decrypt_t | op, |
| size_t | desired_shared_key_length, | ||
| size_t * | output_shared_key_length ) |
Return the length of the shared key this operation will produce
| op | the decapsulation operation |
| desired_shared_key_length | the requested shared key length in bytes |
| output_shared_key_length | set to the shared key length that will result |
Definition at line 352 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and BOTAN_FFI_VISIT.
| int botan_pk_op_kem_encrypt_create | ( | botan_pk_op_kem_encrypt_t * | op, |
| botan_pubkey_t | key, | ||
| const char * | kdf ) |
Create a key encapsulation operation
| op | the new object will be placed here |
| key | the public key to encapsulate to |
| Key Derivation Functions | the KDF applied to the shared secret, or "Raw" for no KDF |
Definition at line 275 of file ffi_pk_op.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_pk_op_kem_encrypt_create_shared_key | ( | botan_pk_op_kem_encrypt_t | op, |
| botan_rng_t | rng, | ||
| const uint8_t | salt[], | ||
| size_t | salt_len, | ||
| size_t | desired_shared_key_len, | ||
| uint8_t | shared_key[], | ||
| size_t * | shared_key_len, | ||
| uint8_t | encapsulated_key[], | ||
| size_t * | encapsulated_key_len ) |
Generate a shared key along with the encapsulation of it for the counterparty
| op | the encapsulation operation |
| Random Number Generators | a random number generator |
| salt | a salt passed to the KDF, may be NULL if salt_len is 0 |
| salt_len | length of salt in bytes |
| desired_shared_key_len | the requested shared key length in bytes |
| shared_key | output buffer for the shared key |
| shared_key_len | on input the size of shared_key, on output the number of bytes written |
| encapsulated_key | output buffer for the encapsulated key |
| encapsulated_key_len | on input the size of encapsulated_key, on output the number of bytes written |
Definition at line 315 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::safe_get(), and Botan_FFI::write_vec_output().
| int botan_pk_op_kem_encrypt_destroy | ( | botan_pk_op_kem_encrypt_t | op | ) |
Frees all resources of the key encapsulation operation object
| op | the operation to destroy |
Definition at line 286 of file ffi_pk_op.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_pk_op_kem_encrypt_encapsulated_key_length | ( | botan_pk_op_kem_encrypt_t | op, |
| size_t * | output_encapsulated_key_length ) |
Return the length of the encapsulated key this operation produces
| op | the encapsulation operation |
| output_encapsulated_key_length | set to the encapsulated key length in bytes |
Definition at line 303 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and BOTAN_FFI_VISIT.
| int botan_pk_op_kem_encrypt_shared_key_length | ( | botan_pk_op_kem_encrypt_t | op, |
| size_t | desired_shared_key_length, | ||
| size_t * | output_shared_key_length ) |
Return the length of the shared key this operation will produce
| op | the encapsulation operation |
| desired_shared_key_length | the requested shared key length in bytes |
| output_shared_key_length | set to the shared key length that will result |
Definition at line 290 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and BOTAN_FFI_VISIT.
| int botan_pk_op_key_agreement | ( | botan_pk_op_ka_t | op, |
| uint8_t | out[], | ||
| size_t * | out_len, | ||
| const uint8_t | other_key[], | ||
| size_t | other_key_len, | ||
| const uint8_t | salt[], | ||
| size_t | salt_len ) |
Perform key agreement with the counterparty's public value
| op | the key agreement operation |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
| other_key | the counterparty's public value |
| other_key_len | length of other_key in bytes |
| salt | a salt passed to the KDF, may be NULL if salt_len is 0 |
| salt_len | length of salt in bytes |
Definition at line 252 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::write_vec_output().
| int botan_pk_op_key_agreement_create | ( | botan_pk_op_ka_t * | op, |
| botan_privkey_t | key, | ||
| const char * | kdf, | ||
| uint32_t | flags ) |
Create a key agreement operation
| op | the new object will be placed here |
| key | our private key |
| Key Derivation Functions | the KDF applied to the shared secret, or "Raw" for no KDF |
| flags | should be 0 in current API revision |
Definition at line 208 of file ffi_pk_op.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan_FFI::safe_get(), and Botan::system_rng().
| int botan_pk_op_key_agreement_destroy | ( | botan_pk_op_ka_t | op | ) |
Frees all resources of the key agreement operation object
| op | the operation to destroy |
Definition at line 224 of file ffi_pk_op.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_pk_op_key_agreement_export_public | ( | botan_privkey_t | key, |
| uint8_t | out[], | ||
| size_t * | out_len ) |
Export the public value of a key agreement private key, in the format expected by botan_pk_op_key_agreement
| key | the key agreement private key |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
Definition at line 228 of file ffi_pk_op.cpp.
References botan_pk_op_key_agreement_view_public(), and Botan_FFI::copy_view_bin().
| int botan_pk_op_key_agreement_size | ( | botan_pk_op_ka_t | op, |
| size_t * | out_len ) |
Return the length of the shared secret this operation produces
| op | the key agreement operation |
| out_len | set to the output length in bytes |
Definition at line 242 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and BOTAN_FFI_VISIT.
| int botan_pk_op_key_agreement_view_public | ( | botan_privkey_t | key, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the public value of a key agreement private key
| key | the key agreement private key |
| ctx | an application context passed to the view function |
| view | the view callback which receives the encoding |
Definition at line 232 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_INVALID_INPUT, BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
Referenced by botan_pk_op_key_agreement_export_public().
| int botan_pk_op_sign_create | ( | botan_pk_op_sign_t * | op, |
| botan_privkey_t | key, | ||
| const char * | hash_and_padding, | ||
| uint32_t | flags ) |
Create a signature generation operation
| op | the new object will be placed here |
| key | the private key to sign with |
| hash_and_padding | the signature padding and hash, eg "PSS(SHA-256)" |
| flags | 0, or BOTAN_PUBKEY_DER_FORMAT_SIGNATURE to request DER encoded signatures |
Definition at line 118 of file ffi_pk_op.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_PUBKEY_DER_FORMAT_SIGNATURE, Botan::DerSequence, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan_FFI::safe_get(), Botan::Standard, and Botan::system_rng().
| int botan_pk_op_sign_destroy | ( | botan_pk_op_sign_t | op | ) |
Frees all resources of the signature generation operation object
| op | the operation to destroy |
Definition at line 138 of file ffi_pk_op.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_pk_op_sign_finish | ( | botan_pk_op_sign_t | op, |
| botan_rng_t | rng, | ||
| uint8_t | sig[], | ||
| size_t * | sig_len ) |
Produce a signature over the message, then reset for signing another message
| op | the signature operation |
| Random Number Generators | a random number generator |
| sig | output buffer |
| sig_len | on input the size of sig, on output the number of bytes written or required |
Definition at line 158 of file ffi_pk_op.cpp.
References BOTAN_FFI_VISIT, Botan_FFI::safe_get(), and Botan_FFI::write_vec_output().
| int botan_pk_op_sign_output_length | ( | botan_pk_op_sign_t | op, |
| size_t * | olen ) |
Return the length of the signatures this operation produces
| op | the signature operation |
| olen | set to the signature length in bytes |
Definition at line 142 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_pk_op_sign_update | ( | botan_pk_op_sign_t | op, |
| const uint8_t | in[], | ||
| size_t | in_len ) |
Add more data to the message being signed
| op | the signature operation |
| in | input buffer |
| in_len | number of bytes to read from the input buffer |
Definition at line 150 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_pk_op_verify_create | ( | botan_pk_op_verify_t * | op, |
| botan_pubkey_t | key, | ||
| const char * | hash_and_padding, | ||
| uint32_t | flags ) |
Create a signature verification operation
| op | the new object will be placed here |
| key | the public key to verify with |
| hash_and_padding | the signature padding and hash, eg "PSS(SHA-256)" |
| flags | 0, or BOTAN_PUBKEY_DER_FORMAT_SIGNATURE if the signature is DER encoded |
Definition at line 162 of file ffi_pk_op.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_PUBKEY_DER_FORMAT_SIGNATURE, Botan::DerSequence, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan_FFI::safe_get(), and Botan::Standard.
| int botan_pk_op_verify_destroy | ( | botan_pk_op_verify_t | op | ) |
Frees all resources of the signature verification operation object
| op | the operation to destroy |
Definition at line 180 of file ffi_pk_op.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_pk_op_verify_finish | ( | botan_pk_op_verify_t | op, |
| const uint8_t | sig[], | ||
| size_t | sig_len ) |
Check the signature over the message, then reset for verifying another message
| op | the verification operation |
| sig | the signature to check |
| sig_len | length of sig in bytes |
Definition at line 192 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_INVALID_VERIFIER, BOTAN_FFI_SUCCESS, and BOTAN_FFI_VISIT.
| int botan_pk_op_verify_update | ( | botan_pk_op_verify_t | op, |
| const uint8_t | in[], | ||
| size_t | in_len ) |
Add more data to the message being verified
| op | the verification operation |
| in | input buffer |
| in_len | number of bytes to read from the input buffer |
Definition at line 184 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_pkcs_hash_id | ( | const char * | hash_name, |
| uint8_t | pkcs_id[], | ||
| size_t * | pkcs_id_len ) |
Signature Scheme Utility Functions
Definition at line 469 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan::pkcs_hash_id(), and Botan_FFI::write_output().
| int botan_privkey_algo_name | ( | botan_privkey_t | key, |
| char | out[], | ||
| size_t * | out_len ) |
Get the name of the algorithm this private key is for
| key | the private key to query |
| out | output buffer |
| out_len | on input the length of out, on success the number of bytes written |
Definition at line 162 of file ffi_pkey.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::write_str_output().
| int botan_privkey_check_key | ( | botan_privkey_t | key, |
| botan_rng_t | rng, | ||
| uint32_t | flags ) |
Test the consistency of a private key
| key | the private key to check |
| Random Number Generators | a random number generator |
| flags | either 0 or BOTAN_CHECK_KEY_EXPENSIVE_TESTS |
Definition at line 178 of file ffi_pkey.cpp.
References BOTAN_CHECK_KEY_EXPENSIVE_TESTS, BOTAN_FFI_ERROR_INVALID_INPUT, BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_privkey_create | ( | botan_privkey_t * | key, |
| const char * | algo_name, | ||
| const char * | algo_params, | ||
| botan_rng_t | rng ) |
Create a new private key
| key | the new object will be placed here |
| algo_name | something like "RSA" or "ECDSA" |
| algo_params | is specific to the algorithm. For RSA, specifies the modulus bit length. For ECC is the name of the curve. |
| Random Number Generators | a random number generator |
Definition at line 30 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, botan_privkey_create(), Botan::create_private_key(), Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
Referenced by botan_privkey_create(), botan_privkey_create_dh(), botan_privkey_create_ecdh(), botan_privkey_create_ecdsa(), botan_privkey_create_mceliece(), and botan_privkey_create_rsa().
| int botan_privkey_create_dh | ( | botan_privkey_t * | key, |
| botan_rng_t | rng, | ||
| const char * | param ) |
Create a new Diffie-Hellman private key
| key | the new object will be placed here |
| Random Number Generators | a random number generator |
| param | the name of the group, eg "modp/ietf/2048" |
Definition at line 598 of file ffi_pkey_algs.cpp.
References botan_privkey_create().
| int botan_privkey_create_ecdh | ( | botan_privkey_t * | key, |
| botan_rng_t | rng, | ||
| const char * | params ) |
Create a new ECDH private key
| key | the new object will be placed here |
| Random Number Generators | a random number generator |
| params | the name of the curve, eg "secp256r1" |
Definition at line 638 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, and botan_privkey_create().
| int botan_privkey_create_ecdsa | ( | botan_privkey_t * | key, |
| botan_rng_t | rng, | ||
| const char * | params ) |
Create a new ECDSA private key
| key | the new object will be placed here |
| Random Number Generators | a random number generator |
| params | the name of the curve, eg "secp256r1" |
Definition at line 439 of file ffi_pkey_algs.cpp.
References botan_privkey_create().
| int botan_privkey_create_mceliece | ( | botan_privkey_t * | key, |
| botan_rng_t | rng, | ||
| size_t | n, | ||
| size_t | t ) |
Create a new McEliece private key
| key | the new object will be placed here |
| Random Number Generators | a random number generator |
| n | the code length |
| t | the error correction capability |
Definition at line 1559 of file ffi_pkey_algs.cpp.
References botan_privkey_create().
| int botan_privkey_create_rsa | ( | botan_privkey_t * | key, |
| botan_rng_t | rng, | ||
| size_t | n_bits ) |
Create a new RSA private key
| key | the new object will be placed here |
| Random Number Generators | a random number generator |
| n_bits | the bit length of the modulus |
Definition at line 228 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, and botan_privkey_create().
| int botan_privkey_destroy | ( | botan_privkey_t | key | ) |
Frees all resources of the private key object
| key | the private key to destroy |
Definition at line 120 of file ffi_pkey.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_privkey_dsa_get_x | ( | botan_mp_t | n, |
| botan_privkey_t | key ) |
Get the secret value of a DSA private key
| n | set to the value of the private key |
| key | the DSA private key |
Definition at line 419 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
| int botan_privkey_ed25519_get_privkey | ( | botan_privkey_t | key, |
| uint8_t | output[64] ) |
Get the raw encoding of an Ed25519 private key, followed by the public key
| key | the Ed25519 private key |
| output | set to the 64 byte concatenation of the private and public keys |
Definition at line 932 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
| int botan_privkey_ed448_get_privkey | ( | botan_privkey_t | key, |
| uint8_t | output[57] ) |
Get the raw 57 byte encoding of an Ed448 private key
| key | the Ed448 private key |
| output | set to the raw private key |
Definition at line 1012 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
| int botan_privkey_export | ( | botan_privkey_t | key, |
| uint8_t | out[], | ||
| size_t * | out_len, | ||
| uint32_t | flags ) |
Export a private key in DER, PEM or raw encoding
On input *out_len is number of bytes in out[] On output *out_len is number of bytes written (or required) If out is not big enough no output is written, *out_len is set and 1 is returned Returns 0 on success and sets If some other error occurs a negative integer is returned.
| key | the private key to export |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
| flags | one of BOTAN_PRIVKEY_EXPORT_FLAG_DER, _PEM or _RAW |
Definition at line 212 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_PRIVKEY_EXPORT_FLAG_DER, BOTAN_PRIVKEY_EXPORT_FLAG_PEM, BOTAN_PRIVKEY_EXPORT_FLAG_RAW, botan_privkey_view_der(), botan_privkey_view_pem(), botan_privkey_view_raw(), Botan_FFI::copy_view_bin(), and Botan_FFI::copy_view_str().
| int botan_privkey_export_encrypted | ( | botan_privkey_t | key, |
| uint8_t | out[], | ||
| size_t * | out_len, | ||
| botan_rng_t | rng, | ||
| const char * | passphrase, | ||
| const char * | encryption_algo, | ||
| uint32_t | flags ) |
Export a private key encrypted with a passphrase
Set encryption_algo to NULL or "" to have the library choose a default (recommended)
| key | the private key to export |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
| Random Number Generators | a random number generator |
| passphrase | the passphrase to encrypt under |
| encryption_algo | the cipher to use, or NULL for the default |
| flags | either BOTAN_PRIVKEY_EXPORT_FLAG_DER or BOTAN_PRIVKEY_EXPORT_FLAG_PEM |
Definition at line 239 of file ffi_pkey.cpp.
References botan_privkey_export_encrypted_pbkdf_iter().
| int botan_privkey_export_encrypted_pbkdf_iter | ( | botan_privkey_t | key, |
| uint8_t | out[], | ||
| size_t * | out_len, | ||
| botan_rng_t | rng, | ||
| const char * | passphrase, | ||
| size_t | pbkdf_iterations, | ||
| const char * | cipher_algo, | ||
| const char * | pbkdf_algo, | ||
| uint32_t | flags ) |
Export a private key encrypted with a passphrase, using the specified number of PBKDF iterations.
| key | the private key to export |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
| Random Number Generators | a random number generator |
| passphrase | the passphrase to encrypt under |
| pbkdf_iterations | the number of PBKDF iterations to run |
| cipher_algo | the cipher to use, or NULL for the default |
| pbkdf_algo | the password hash to use, or NULL for the default |
| flags | either BOTAN_PRIVKEY_EXPORT_FLAG_DER or BOTAN_PRIVKEY_EXPORT_FLAG_PEM |
Definition at line 326 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_PRIVKEY_EXPORT_FLAG_DER, BOTAN_PRIVKEY_EXPORT_FLAG_PEM, botan_privkey_view_encrypted_der(), botan_privkey_view_encrypted_pem(), Botan_FFI::copy_view_bin(), and Botan_FFI::copy_view_str().
Referenced by botan_privkey_export_encrypted().
| int botan_privkey_export_encrypted_pbkdf_msec | ( | botan_privkey_t | key, |
| uint8_t | out[], | ||
| size_t * | out_len, | ||
| botan_rng_t | rng, | ||
| const char * | passphrase, | ||
| uint32_t | pbkdf_msec_runtime, | ||
| size_t * | pbkdf_iterations_out, | ||
| const char * | cipher_algo, | ||
| const char * | pbkdf_algo, | ||
| uint32_t | flags ) |
Export a private key encrypted with a passphrase, running the PBKDF for a specified amount of time
Note: starting in 3.0, the output iterations count is not provided
| key | the private key to export |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
| Random Number Generators | a random number generator |
| passphrase | the passphrase to encrypt under |
| pbkdf_msec_runtime | desired PBKDF runtime in milliseconds |
| pbkdf_iterations_out | ignored since 3.0 |
| cipher_algo | the cipher to use, or NULL for the default |
| pbkdf_algo | the password hash to use, or NULL for the default |
| flags | either BOTAN_PRIVKEY_EXPORT_FLAG_DER or BOTAN_PRIVKEY_EXPORT_FLAG_PEM |
Definition at line 249 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_PRIVKEY_EXPORT_FLAG_DER, BOTAN_PRIVKEY_EXPORT_FLAG_PEM, botan_privkey_view_encrypted_der_timed(), botan_privkey_view_encrypted_pem_timed(), Botan_FFI::copy_view_bin(), and Botan_FFI::copy_view_str().
| int botan_privkey_export_pubkey | ( | botan_pubkey_t * | out, |
| botan_privkey_t | in ) |
Extract the public key associated with a private key
| out | the new object will be placed here |
| in | the private key to extract the public key from |
Definition at line 152 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_privkey_get_field | ( | botan_mp_t | output, |
| botan_privkey_t | key, | ||
| const char * | field_name ) |
Get an arbitrary named field from a private key, eg "p" or "q" for RSA
| output | set to the value of the requested field |
| key | the private key to query |
| field_name | the name of the field to retrieve |
Definition at line 216 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
Referenced by botan_privkey_dsa_get_x(), botan_privkey_rsa_get_d(), botan_privkey_rsa_get_e(), botan_privkey_rsa_get_n(), botan_privkey_rsa_get_p(), and botan_privkey_rsa_get_q().
| int botan_privkey_load | ( | botan_privkey_t * | key, |
| botan_rng_t | rng, | ||
| const uint8_t | bits[], | ||
| size_t | len, | ||
| const char * | password ) |
Generates DSA key pair. Gives to a caller control over key length and order of a subgroup 'q'.
| key | handler to the resulting key |
| Random Number Generators | initialized PRNG |
| pbits | length of the key in bits. Must be between in range (1024, 3072) and multiple of 64. Bit size of the prime 'p' |
| qbits | order of the subgroup. Must be in range (160, 256) and multiple of 8 |
*/ int botan_privkey_create_dsa(botan_privkey_t* key, botan_rng_t rng, size_t pbits, size_t qbits);
/** Generates ElGamal key pair. Caller has a control over key length and order of a subgroup 'q'. Function is able to use two types of primes:
| key | handler to the resulting key |
| Random Number Generators | initialized PRNG |
| pbits | length of the key in bits. Must be at least 1024 |
| qbits | order of the subgroup. Must be at least 160 |
*/
int botan_privkey_create_elgamal(botan_privkey_t* key, botan_rng_t rng, size_t pbits, size_t qbits);
/** Input currently assumed to be PKCS #8 structure; Set password to NULL to indicate no encryption expected Starting in 2.8.0, the rng parameter is unused and may be set to null
Definition at line 87 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_UNKNOWN_ERROR, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::PKCS8::load_key().
| int botan_privkey_load_classic_mceliece | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[], | ||
| size_t | key_len, | ||
| const char * | cmce_mode ) |
Load a Classic McEliece private key from its raw encoding
| key | the new object will be placed here |
| privkey | the raw private key |
| key_len | length of privkey in bytes |
| cmce_mode | the parameter set, eg "348864" |
Definition at line 1497 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::Classic_McEliece_Parameter_Set::from_string().
| int botan_privkey_load_dsa | ( | botan_privkey_t * | key, |
| botan_mp_t | p, | ||
| botan_mp_t | q, | ||
| botan_mp_t | g, | ||
| botan_mp_t | x ) |
Load a DSA private key from its group parameters and secret value
| key | the new object will be placed here |
| p | the group prime |
| q | the order of the subgroup |
| g | the subgroup generator |
| x | the private key |
Definition at line 383 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_privkey_load_ecdh | ( | botan_privkey_t * | key, |
| botan_mp_t | scalar, | ||
| const char * | curve_name ) |
Load an ECDH private key from its secret scalar
| key | the new object will be placed here |
| scalar | the private scalar |
| curve_name | the name of the curve, eg "secp256r1" |
Definition at line 704 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_privkey_load_ecdsa | ( | botan_privkey_t * | key, |
| botan_mp_t | scalar, | ||
| const char * | curve_name ) |
Load an ECDSA private key from its secret scalar
| key | the new object will be placed here |
| scalar | the private scalar |
| curve_name | the name of the curve, eg "secp256r1" |
Definition at line 514 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_privkey_load_ed25519 | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[32] ) |
Load an Ed25519 private key from its raw 32 byte encoding
| key | the new object will be placed here |
| privkey | the raw private key |
Definition at line 898 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::Ed25519_PrivateKey::from_seed().
| int botan_privkey_load_ed448 | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[57] ) |
Load an Ed448 private key from its raw 57 byte encoding
| key | the new object will be placed here |
| privkey | the raw private key |
Definition at line 980 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_privkey_load_frodokem | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[], | ||
| size_t | key_len, | ||
| const char * | frodo_mode ) |
Load a FrodoKEM private key from its raw encoding
| key | the new object will be placed here |
| privkey | the raw private key |
| key_len | length of privkey in bytes |
| frodo_mode | the parameter set, eg "FrodoKEM-640-SHAKE" |
Definition at line 1455 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_privkey_load_kyber | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[], | ||
| size_t | key_len ) |
Load a Kyber private key from its raw encoding. The parameter set is inferred from the key length.
| key | the new object will be placed here |
| privkey | the raw private key |
| key_len | length of privkey in bytes |
Definition at line 1205 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan::KyberMode::Kyber1024_R3, Botan::KyberMode::Kyber512_R3, and Botan::KyberMode::Kyber768_R3.
| int botan_privkey_load_ml_dsa | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[], | ||
| size_t | key_len, | ||
| const char * | mldsa_mode ) |
Load an ML-DSA private key from its raw encoding
| key | the new object will be placed here |
| privkey | the raw private key |
| key_len | length of privkey in bytes |
| mldsa_mode | the parameter set, eg "ML-DSA-6x5" |
Definition at line 1355 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_privkey_load_ml_kem | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[], | ||
| size_t | key_len, | ||
| const char * | mlkem_mode ) |
Load an ML-KEM private key from its raw encoding
| key | the new object will be placed here |
| privkey | the raw private key |
| key_len | length of privkey in bytes |
| mlkem_mode | the parameter set, eg "ML-KEM-768" |
Definition at line 1305 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_privkey_load_rsa | ( | botan_privkey_t * | key, |
| botan_mp_t | p, | ||
| botan_mp_t | q, | ||
| botan_mp_t | e ) |
Load an RSA private key from its factors and public exponent
| key | the new object will be placed here |
| p | the first prime factor |
| q | the second prime factor |
| e | the public exponent |
Definition at line 238 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_privkey_load_rsa_pkcs1 | ( | botan_privkey_t * | key, |
| const uint8_t | bits[], | ||
| size_t | len ) |
Load an RSA private key from a PKCS #1 RSAPrivateKey structure
| key | the new object will be placed here |
| bits | the DER encoding to load |
| len | length of bits in bytes |
Definition at line 255 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::AlgorithmIdentifier::USE_NULL_PARAM.
| int botan_privkey_load_slh_dsa | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[], | ||
| size_t | key_len, | ||
| const char * | slhdsa_mode ) |
Load an SLH-DSA private key from its raw encoding
| key | the new object will be placed here |
| privkey | the raw private key |
| key_len | length of privkey in bytes |
| slhdsa_mode | the parameter set, eg "SLH-DSA-SHA2-128s" |
Definition at line 1405 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_privkey_load_sm2 | ( | botan_privkey_t * | key, |
| botan_mp_t | scalar, | ||
| const char * | curve_name ) |
Load an SM2 private key from its secret scalar
| key | the new object will be placed here |
| scalar | the private scalar |
| curve_name | the name of the curve, typically "sm2p256v1" |
Definition at line 806 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
Referenced by botan_privkey_load_sm2_enc().
| int botan_privkey_load_sm2_enc | ( | botan_privkey_t * | key, |
| botan_mp_t | scalar, | ||
| const char * | curve_name ) |
Load an SM2 encryption private key; identical to botan_privkey_load_sm2
| key | the new object will be placed here |
| scalar | the private scalar |
| curve_name | the name of the curve, typically "sm2p256v1" |
Definition at line 835 of file ffi_pkey_algs.cpp.
References botan_privkey_load_sm2().
| int botan_privkey_load_x25519 | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[32] ) |
Load an X25519 private key from its raw 32 byte encoding
| key | the new object will be placed here |
| privkey | the raw private key |
Definition at line 1054 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_privkey_load_x448 | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[56] ) |
Load an X448 private key from its raw 56 byte encoding
| key | the new object will be placed here |
| privkey | the raw private key |
Definition at line 1130 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_privkey_oid | ( | botan_asn1_oid_t * | oid, |
| botan_privkey_t | key ) |
Get the object identifier associated with a private key
| oid | the new object will be placed here |
| key | the private key to query |
Definition at line 409 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and Botan_FFI::ffi_new_object().
| int botan_privkey_remaining_operations | ( | botan_privkey_t | key, |
| uint64_t * | out ) |
Gets information on many operations a (stateful) key has remaining and sets
| key | the private key to check |
| out | to that value |
Definition at line 437 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and BOTAN_FFI_VISIT.
| int botan_privkey_rsa_get_d | ( | botan_mp_t | d, |
| botan_privkey_t | rsa_key ) |
Get the private exponent of an RSA private key
| d | set to the value of the private exponent |
| rsa_key | the RSA private key |
Definition at line 323 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
| int botan_privkey_rsa_get_e | ( | botan_mp_t | e, |
| botan_privkey_t | rsa_key ) |
Get the public exponent of an RSA private key
| e | set to the value of the public exponent |
| rsa_key | the RSA private key |
Definition at line 319 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
| int botan_privkey_rsa_get_n | ( | botan_mp_t | n, |
| botan_privkey_t | rsa_key ) |
Get the modulus of an RSA private key
| n | set to the value of the modulus |
| rsa_key | the RSA private key |
Definition at line 315 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
| int botan_privkey_rsa_get_p | ( | botan_mp_t | p, |
| botan_privkey_t | rsa_key ) |
Get the first prime factor of an RSA private key
| p | set to the value of the factor |
| rsa_key | the RSA private key |
Definition at line 307 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
| int botan_privkey_rsa_get_privkey | ( | botan_privkey_t | rsa_key, |
| uint8_t | out[], | ||
| size_t * | out_len, | ||
| uint32_t | flags ) |
Export an RSA private key as a PKCS #1 RSAPrivateKey structure
| rsa_key | the RSA private key |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
| flags | either BOTAN_PRIVKEY_EXPORT_FLAG_DER or BOTAN_PRIVKEY_EXPORT_FLAG_PEM |
Definition at line 335 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_PRIVKEY_EXPORT_FLAG_DER, BOTAN_PRIVKEY_EXPORT_FLAG_PEM, BOTAN_UNUSED, Botan::PEM_Code::encode(), Botan_FFI::write_str_output(), and Botan_FFI::write_vec_output().
| int botan_privkey_rsa_get_q | ( | botan_mp_t | q, |
| botan_privkey_t | rsa_key ) |
Get the second prime factor of an RSA private key
| q | set to the value of the factor |
| rsa_key | the RSA private key |
Definition at line 311 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
| int botan_privkey_stateful_operation | ( | botan_privkey_t | key, |
| int * | out ) |
Checks whether a key is stateful and sets
| key | the private key to check |
| out | to 1 if it is, or 0 if the key is not stateful |
Definition at line 422 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and BOTAN_FFI_VISIT.
| int botan_privkey_view_der | ( | botan_privkey_t | key, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the private key's DER encoding
Definition at line 224 of file ffi_pkey.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
Referenced by botan_privkey_export().
| int botan_privkey_view_encrypted_der | ( | botan_privkey_t | key, |
| botan_rng_t | rng, | ||
| const char * | passphrase, | ||
| const char * | cipher_algo, | ||
| const char * | pbkdf_algo, | ||
| size_t | pbkdf_iterations, | ||
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the encryption of a private key (binary DER encoding)
Set cipher_algo, pbkdf_algo to NULL to use defaults Set pbkdf_iterations to 0 to use defaults
Definition at line 346 of file ffi_pkey.cpp.
References Botan::PKCS8::BER_encode_encrypted_pbkdf_iter(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::invoke_view_callback(), and Botan_FFI::safe_get().
Referenced by botan_privkey_export_encrypted_pbkdf_iter().
| int botan_privkey_view_encrypted_der_timed | ( | botan_privkey_t | key, |
| botan_rng_t | rng, | ||
| const char * | passphrase, | ||
| const char * | cipher_algo, | ||
| const char * | pbkdf_algo, | ||
| size_t | pbkdf_runtime_msec, | ||
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the encryption of a private key (binary DER encoding)
Set cipher_algo, pbkdf_algo to NULL to use defaults
Definition at line 274 of file ffi_pkey.cpp.
References Botan::PKCS8::BER_encode_encrypted_pbkdf_msec(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::invoke_view_callback(), and Botan_FFI::safe_get().
Referenced by botan_privkey_export_encrypted_pbkdf_msec().
| int botan_privkey_view_encrypted_pem | ( | botan_privkey_t | key, |
| botan_rng_t | rng, | ||
| const char * | passphrase, | ||
| const char * | cipher_algo, | ||
| const char * | pbkdf_algo, | ||
| size_t | pbkdf_iterations, | ||
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
View the encryption of a private key (PEM encoding)
Set cipher_algo, pbkdf_algo to NULL to use defaults Set pbkdf_iterations to 0 to use defaults
Definition at line 371 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::invoke_view_callback(), Botan::PKCS8::PEM_encode_encrypted_pbkdf_iter(), and Botan_FFI::safe_get().
Referenced by botan_privkey_export_encrypted_pbkdf_iter().
| int botan_privkey_view_encrypted_pem_timed | ( | botan_privkey_t | key, |
| botan_rng_t | rng, | ||
| const char * | passphrase, | ||
| const char * | cipher_algo, | ||
| const char * | pbkdf_algo, | ||
| size_t | pbkdf_runtime_msec, | ||
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
View the encryption of a private key (PEM encoding)
Set cipher_algo, pbkdf_algo to NULL to use defaults
Definition at line 300 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan_FFI::invoke_view_callback(), Botan::PKCS8::PEM_encode_encrypted_pbkdf_msec(), and Botan_FFI::safe_get().
Referenced by botan_privkey_export_encrypted_pbkdf_msec().
| int botan_privkey_view_kyber_raw_key | ( | botan_privkey_t | key, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the raw encoding of a Kyber private key
| key | the Kyber private key |
| ctx | an application context passed to the view function |
| view | the view callback which receives the encoding |
Definition at line 1271 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
| int botan_privkey_view_pem | ( | botan_privkey_t | key, |
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
View the private key's PEM encoding
Definition at line 229 of file ffi_pkey.cpp.
References BOTAN_FFI_VISIT, Botan_FFI::invoke_view_callback(), and Botan::PKCS8::PEM_encode().
Referenced by botan_privkey_export().
| int botan_privkey_view_raw | ( | botan_privkey_t | key, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the private key's raw encoding
Definition at line 234 of file ffi_pkey.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
Referenced by botan_privkey_export().
| int botan_privkey_x25519_get_privkey | ( | botan_privkey_t | key, |
| uint8_t | output[32] ) |
Get the raw 32 byte encoding of an X25519 private key
| key | the X25519 private key |
| output | set to the raw private key |
Definition at line 1086 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
| int botan_privkey_x448_get_privkey | ( | botan_privkey_t | key, |
| uint8_t | output[56] ) |
Get the raw 56 byte encoding of an X448 private key
| key | the X448 private key |
| output | set to the raw private key |
Definition at line 1162 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
| int botan_pubkey_algo_name | ( | botan_pubkey_t | key, |
| char | out[], | ||
| size_t * | out_len ) |
Get the name of the algorithm this public key is for
| key | the public key to query |
| out | output buffer |
| out_len | on input the length of out, on success the number of bytes written |
Definition at line 166 of file ffi_pkey.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::write_str_output().
| int botan_pubkey_check_key | ( | botan_pubkey_t | key, |
| botan_rng_t | rng, | ||
| uint32_t | flags ) |
Returns 0 if key is valid, negative if invalid key or some other error
Definition at line 170 of file ffi_pkey.cpp.
References BOTAN_CHECK_KEY_EXPENSIVE_TESTS, BOTAN_FFI_ERROR_INVALID_INPUT, BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_pubkey_destroy | ( | botan_pubkey_t | key | ) |
Frees all resources of the public key object
| key | the public key to destroy |
Definition at line 148 of file ffi_pkey.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_pubkey_dsa_get_g | ( | botan_mp_t | d, |
| botan_pubkey_t | key ) |
Get the subgroup generator of a DSA public key
| d | set to the value of the generator |
| key | the DSA public key |
Definition at line 431 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
| int botan_pubkey_dsa_get_p | ( | botan_mp_t | p, |
| botan_pubkey_t | key ) |
Get the group prime of a DSA public key
| p | set to the value of the group prime |
| key | the DSA public key |
Definition at line 423 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
| int botan_pubkey_dsa_get_q | ( | botan_mp_t | q, |
| botan_pubkey_t | key ) |
Get the subgroup order of a DSA public key
| q | set to the value of the subgroup order |
| key | the DSA public key |
Definition at line 427 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
| int botan_pubkey_dsa_get_y | ( | botan_mp_t | y, |
| botan_pubkey_t | key ) |
Get the public value of a DSA public key
| y | set to the value of the public key |
| key | the DSA public key |
Definition at line 435 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
| int botan_pubkey_ecc_key_used_explicit_encoding | ( | botan_pubkey_t | key | ) |
Check if the group of this EC key was encoded using explicit curve parameters rather than a named curve OID
| key | the EC public key to examine |
Definition at line 445 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, Botan::EC_PublicKey::domain(), Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan::EC_Group::used_explicit_encoding().
| int botan_pubkey_ed25519_get_pubkey | ( | botan_pubkey_t | key, |
| uint8_t | pubkey[32] ) |
Get the raw 32 byte encoding of an Ed25519 public key
| key | the Ed25519 public key |
| Public Key Algorithms | set to the raw public key |
Definition at line 955 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
| int botan_pubkey_ed448_get_pubkey | ( | botan_pubkey_t | key, |
| uint8_t | pubkey[57] ) |
Get the raw 57 byte encoding of an Ed448 public key
| key | the Ed448 public key |
| Public Key Algorithms | set to the raw public key |
Definition at line 1032 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
| int botan_pubkey_estimated_strength | ( | botan_pubkey_t | key, |
| size_t * | estimate ) |
Estimate the strength of this key, in bits, against the best known attack
| key | the public key to query |
| estimate | set to the estimated strength in bits |
Definition at line 452 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_pubkey_export | ( | botan_pubkey_t | key, |
| uint8_t | out[], | ||
| size_t * | out_len, | ||
| uint32_t | flags ) |
Export a public key in DER, PEM or raw encoding
| key | the public key to export |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
| flags | one of BOTAN_PRIVKEY_EXPORT_FLAG_DER, _PEM or _RAW |
Definition at line 185 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_PRIVKEY_EXPORT_FLAG_DER, BOTAN_PRIVKEY_EXPORT_FLAG_PEM, BOTAN_PRIVKEY_EXPORT_FLAG_RAW, botan_pubkey_view_der(), botan_pubkey_view_pem(), botan_pubkey_view_raw(), Botan_FFI::copy_view_bin(), and Botan_FFI::copy_view_str().
| int botan_pubkey_fingerprint | ( | botan_pubkey_t | key, |
| const char * | hash, | ||
| uint8_t | out[], | ||
| size_t * | out_len ) |
Compute a fingerprint (hash of the public key encoding)
| key | the public key to fingerprint |
| Hashes | the name of the hash to use, eg "SHA-256" |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
Definition at line 459 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, Botan::HashFunction::create_or_throw(), and Botan_FFI::write_vec_output().
| int botan_pubkey_get_field | ( | botan_mp_t | output, |
| botan_pubkey_t | key, | ||
| const char * | field_name ) |
Get an arbitrary named field from a public key, eg "n" or "e" for RSA
| output | set to the value of the requested field |
| key | the public key to query |
| field_name | the name of the field to retrieve |
Definition at line 206 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
Referenced by botan_pubkey_dsa_get_g(), botan_pubkey_dsa_get_p(), botan_pubkey_dsa_get_q(), botan_pubkey_dsa_get_y(), botan_pubkey_rsa_get_e(), and botan_pubkey_rsa_get_n().
| int botan_pubkey_load | ( | botan_pubkey_t * | key, |
| const uint8_t | bits[], | ||
| size_t | len ) |
Load a public key from an X.509 SubjectPublicKeyInfo structure
| key | the new object will be placed here |
| bits | the DER encoding to load |
| len | length of bits in bytes |
Definition at line 124 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_UNKNOWN_ERROR, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::X509::load_key().
| int botan_pubkey_load_classic_mceliece | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[], | ||
| size_t | key_len, | ||
| const char * | cmce_mode ) |
Load a Classic McEliece public key from its raw encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
| key_len | length of pubkey in bytes |
| cmce_mode | the parameter set, eg "348864" |
Definition at line 1519 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::Classic_McEliece_Parameter_Set::from_string().
| int botan_pubkey_load_dsa | ( | botan_pubkey_t * | key, |
| botan_mp_t | p, | ||
| botan_mp_t | q, | ||
| botan_mp_t | g, | ||
| botan_mp_t | y ) |
Load a DSA public key from its group parameters and public value
| key | the new object will be placed here |
| p | the group prime |
| q | the order of the subgroup |
| g | the subgroup generator |
| y | the public key |
Definition at line 401 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_pubkey_load_ecdh | ( | botan_pubkey_t * | key, |
| botan_mp_t | public_x, | ||
| botan_mp_t | public_y, | ||
| const char * | curve_name ) |
Load an ECDH public key from the affine coordinates of the public point
| key | the new object will be placed here |
| public_x | the x coordinate of the public point |
| public_y | the y coordinate of the public point |
| curve_name | the name of the curve, eg "secp256r1" |
Definition at line 657 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_pubkey_load_ecdh_sec1 | ( | botan_pubkey_t * | key, |
| const uint8_t | sec1[], | ||
| size_t | sec1_len, | ||
| const char * | curve_name ) |
Load an ECDH public key from the SEC1 encoding of the public point
| key | the new object will be placed here |
| sec1 | the SEC1 compressed or uncompressed point encoding |
| sec1_len | length of sec1 in bytes |
| curve_name | the name of the curve, eg "secp256r1" |
Definition at line 681 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_ecdsa | ( | botan_pubkey_t * | key, |
| botan_mp_t | public_x, | ||
| botan_mp_t | public_y, | ||
| const char * | curve_name ) |
Load an ECDSA public key from the affine coordinates of the public point
| key | the new object will be placed here |
| public_x | the x coordinate of the public point |
| public_y | the y coordinate of the public point |
| curve_name | the name of the curve, eg "secp256r1" |
Definition at line 465 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_pubkey_load_ecdsa_sec1 | ( | botan_pubkey_t * | key, |
| const uint8_t | sec1[], | ||
| size_t | sec1_len, | ||
| const char * | curve_name ) |
Load an ECDSA public key from the SEC1 encoding of the public point
| key | the new object will be placed here |
| sec1 | the SEC1 compressed or uncompressed point encoding |
| sec1_len | length of sec1 in bytes |
| curve_name | the name of the curve, eg "secp256r1" |
Definition at line 491 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_ed25519 | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[32] ) |
Load an Ed25519 public key from its raw 32 byte encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
Definition at line 915 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_ed448 | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[57] ) |
Load an Ed448 public key from its raw 57 byte encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
Definition at line 996 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_frodokem | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[], | ||
| size_t | key_len, | ||
| const char * | frodo_mode ) |
Load a FrodoKEM public key from its raw encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
| key_len | length of pubkey in bytes |
| frodo_mode | the parameter set, eg "FrodoKEM-640-SHAKE" |
Definition at line 1474 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_kyber | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[], | ||
| size_t | key_len ) |
Load a Kyber public key from its raw encoding. The parameter set is inferred from the key length.
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
| key_len | length of pubkey in bytes |
Definition at line 1238 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan::KyberMode::Kyber1024_R3, Botan::KyberMode::Kyber512_R3, and Botan::KyberMode::Kyber768_R3.
| int botan_pubkey_load_ml_dsa | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[], | ||
| size_t | key_len, | ||
| const char * | mldsa_mode ) |
Load an ML-DSA public key from its raw encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
| key_len | length of pubkey in bytes |
| mldsa_mode | the parameter set, eg "ML-DSA-6x5" |
Definition at line 1378 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_ml_kem | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[], | ||
| size_t | key_len, | ||
| const char * | mlkem_mode ) |
Load an ML-KEM public key from its raw encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
| key_len | length of pubkey in bytes |
| mlkem_mode | the parameter set, eg "ML-KEM-768" |
Definition at line 1328 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_rsa | ( | botan_pubkey_t * | key, |
| botan_mp_t | n, | ||
| botan_mp_t | e ) |
Load an RSA public key from its modulus and public exponent
| key | the new object will be placed here |
| n | the modulus |
| e | the public exponent |
Definition at line 273 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_pubkey_load_rsa_pkcs1 | ( | botan_pubkey_t * | key, |
| const uint8_t | bits[], | ||
| size_t | len ) |
Load an RSA public key from a PKCS #1 RSAPublicKey structure
| key | the new object will be placed here |
| bits | the DER encoding to load |
| len | length of bits in bytes |
Definition at line 289 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::AlgorithmIdentifier::USE_NULL_PARAM.
| int botan_pubkey_load_slh_dsa | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[], | ||
| size_t | key_len, | ||
| const char * | slhdsa_mode ) |
Load an SLH-DSA public key from its raw encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
| key_len | length of pubkey in bytes |
| slhdsa_mode | the parameter set, eg "SLH-DSA-SHA2-128s" |
Definition at line 1428 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_sm2 | ( | botan_pubkey_t * | key, |
| botan_mp_t | public_x, | ||
| botan_mp_t | public_y, | ||
| const char * | curve_name ) |
Load an SM2 public key from the affine coordinates of the public point
| key | the new object will be placed here |
| public_x | the x coordinate of the public point |
| public_y | the y coordinate of the public point |
| curve_name | the name of the curve, typically "sm2p256v1" |
Definition at line 759 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_UNKNOWN_ERROR, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
Referenced by botan_pubkey_load_sm2_enc().
| int botan_pubkey_load_sm2_enc | ( | botan_pubkey_t * | key, |
| botan_mp_t | public_x, | ||
| botan_mp_t | public_y, | ||
| const char * | curve_name ) |
Load an SM2 encryption public key; identical to botan_pubkey_load_sm2
| key | the new object will be placed here |
| public_x | the x coordinate of the public point |
| public_y | the y coordinate of the public point |
| curve_name | the name of the curve, typically "sm2p256v1" |
Definition at line 828 of file ffi_pkey_algs.cpp.
References botan_pubkey_load_sm2().
| int botan_pubkey_load_sm2_sec1 | ( | botan_pubkey_t * | key, |
| const uint8_t | sec1[], | ||
| size_t | sec1_len, | ||
| const char * | curve_name ) |
Load an SM2 public key from the SEC1 encoding of the public point
| key | the new object will be placed here |
| sec1 | the SEC1 compressed or uncompressed point encoding |
| sec1_len | length of sec1 in bytes |
| curve_name | the name of the curve, typically "sm2p256v1" |
Definition at line 783 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_x25519 | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[32] ) |
Load an X25519 public key from its raw 32 byte encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
Definition at line 1070 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_x448 | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[56] ) |
Load an X448 public key from its raw 56 byte encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
Definition at line 1146 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_oid | ( | botan_asn1_oid_t * | oid, |
| botan_pubkey_t | key ) |
Get the object identifier associated with a public key
| oid | the new object will be placed here |
| key | the public key to query |
Definition at line 396 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and Botan_FFI::ffi_new_object().
| int botan_pubkey_rsa_get_e | ( | botan_mp_t | e, |
| botan_pubkey_t | rsa_key ) |
Get the public exponent of an RSA public key
| e | set to the value of the public exponent |
| rsa_key | the RSA public key |
Definition at line 327 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
| int botan_pubkey_rsa_get_n | ( | botan_mp_t | n, |
| botan_pubkey_t | rsa_key ) |
Get the modulus of an RSA public key
| n | set to the value of the modulus |
| rsa_key | the RSA public key |
Definition at line 331 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
| int botan_pubkey_sm2_compute_za | ( | uint8_t | out[], |
| size_t * | out_len, | ||
| const char * | ident, | ||
| const char * | hash_algo, | ||
| botan_pubkey_t | key ) |
Compute the SM2 ZA value, the hash of the user identity and public key which is prefixed to the message before signing
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
| ident | the user identifier |
| hash_algo | the hash to use, typically "SM3" |
| key | the SM2 public key |
Definition at line 726 of file ffi_pkey_algs.cpp.
References Botan::EC_PublicKey::_public_ec_point(), Botan::Asymmetric_Key::algo_name(), Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, Botan::HashFunction::create_or_throw(), Botan::EC_PublicKey::domain(), Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), Botan::sm2_compute_za(), and Botan_FFI::write_vec_output().
| int botan_pubkey_view_der | ( | botan_pubkey_t | key, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the public key's DER encoding
Definition at line 197 of file ffi_pkey.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
Referenced by botan_pubkey_export().
| int botan_pubkey_view_ec_public_point | ( | botan_pubkey_t | key, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the uncompressed public point associated with the key
Definition at line 1541 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
| int botan_pubkey_view_kyber_raw_key | ( | botan_pubkey_t | key, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the raw encoding of a Kyber public key
| key | the Kyber public key |
| ctx | an application context passed to the view function |
| view | the view callback which receives the encoding |
Definition at line 1286 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
| int botan_pubkey_view_pem | ( | botan_pubkey_t | key, |
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
View the public key's PEM encoding
Definition at line 202 of file ffi_pkey.cpp.
References BOTAN_FFI_VISIT, Botan_FFI::invoke_view_callback(), and Botan::X509::PEM_encode().
Referenced by botan_pubkey_export().
| int botan_pubkey_view_raw | ( | botan_pubkey_t | key, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the public key's raw encoding
Definition at line 207 of file ffi_pkey.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::invoke_view_callback().
Referenced by botan_pubkey_export().
| int botan_pubkey_x25519_get_pubkey | ( | botan_pubkey_t | key, |
| uint8_t | pubkey[32] ) |
Get the raw 32 byte encoding of an X25519 public key
| key | the X25519 public key |
| Public Key Algorithms | set to the raw public key |
Definition at line 1109 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
| int botan_pubkey_x448_get_pubkey | ( | botan_pubkey_t | key, |
| uint8_t | pubkey[56] ) |
Get the raw 56 byte encoding of an X448 public key
| key | the X448 public key |
| Public Key Algorithms | set to the raw public key |
Definition at line 1182 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
| int botan_pwdhash | ( | const char * | algo, |
| size_t | param1, | ||
| size_t | param2, | ||
| size_t | param3, | ||
| uint8_t | out[], | ||
| size_t | out_len, | ||
| const char * | passphrase, | ||
| size_t | passphrase_len, | ||
| const uint8_t | salt[], | ||
| size_t | salt_len ) |
Derive a key from a passphrase
| algo | PBKDF algorithm, e.g., "PBKDF2(SHA-256)" or "Scrypt" |
| param1 | the first PBKDF algorithm parameter |
| param2 | the second PBKDF algorithm parameter (may be zero if unneeded) |
| param3 | the third PBKDF algorithm parameter (may be zero if unneeded) |
| out | buffer to store the derived key, must be of out_len bytes |
| out_len | the desired length of the key to produce |
| passphrase | the password to derive the key from |
| passphrase_len | if > 0, specifies length of password. If len == 0, then strlen will be called on passphrase to compute the length. |
| salt | a randomly chosen salt |
| salt_len | length of salt in bytes |
Definition at line 54 of file ffi_kdf.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::PasswordHashFamily::create(), and Botan_FFI::ffi_guard_thunk().
Referenced by botan_pbkdf(), and botan_scrypt().
| int botan_pwdhash_timed | ( | const char * | algo, |
| uint32_t | msec, | ||
| size_t * | param1, | ||
| size_t * | param2, | ||
| size_t * | param3, | ||
| uint8_t | out[], | ||
| size_t | out_len, | ||
| const char * | passphrase, | ||
| size_t | passphrase_len, | ||
| const uint8_t | salt[], | ||
| size_t | salt_len ) |
Derive a key from a passphrase, choosing parameters to hit a target runtime
| algo | PBKDF algorithm, e.g., "Scrypt" or "PBKDF2(SHA-256)" |
| msec | the desired runtime in milliseconds |
| param1 | will be set to the first password hash parameter |
| param2 | will be set to the second password hash parameter |
| param3 | will be set to the third password hash parameter |
| out | buffer to store the derived key, must be of out_len bytes |
| out_len | the desired length of the key to produce |
| passphrase | the password to derive the key from |
| passphrase_len | if > 0, specifies length of password. If len == 0, then strlen will be called on passphrase to compute the length. |
| salt | a randomly chosen salt |
| salt_len | length of salt in bytes |
Definition at line 93 of file ffi_kdf.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::PasswordHashFamily::create(), and Botan_FFI::ffi_guard_thunk().
Referenced by botan_pbkdf_timed().
| int botan_rng_add_entropy | ( | botan_rng_t | rng, |
| const uint8_t * | entropy, | ||
| size_t | entropy_len ) |
Add some seed material to a random number generator
| Random Number Generators | rng object |
| Entropy Collection | the data to add |
| entropy_len | length of entropy buffer |
Definition at line 189 of file ffi_rng.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_rng_destroy | ( | botan_rng_t | rng | ) |
Frees all resources of the random number generator object
| Random Number Generators | rng object |
Definition at line 164 of file ffi_rng.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_rng_generate_with_input | ( | botan_rng_t | rng, |
| uint8_t * | out, | ||
| size_t | out_len, | ||
| const uint8_t * | addl_input, | ||
| size_t | addl_len ) |
Generate random bytes from an RNG with additional input.
For a DRBG, the additional input is mixed in before generating. Many other RNG types (eg RDRAND or system RNG) will ignore the input.
| Random Number Generators | the RNG object |
| out | output buffer |
| out_len | number of bytes to generate |
| addl_input | additional input to mix in (may be NULL if addl_len is 0) |
| addl_len | length of additional input |
Definition at line 230 of file ffi_rng.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_rng_get | ( | botan_rng_t | rng, |
| uint8_t * | out, | ||
| size_t | out_len ) |
Get random bytes from a random number generator
| Random Number Generators | rng object |
| out | output buffer of size out_len |
| out_len | number of requested bytes |
Definition at line 168 of file ffi_rng.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_rng_init | ( | botan_rng_t * | rng, |
| const char * | rng_type ) |
Initialize a random number generator object
| Random Number Generators | rng object |
| rng_type | type of the rng, possible values: "system": system RNG "esdm-full": ESDM RNG (fully seeded) "esdm-pr": ESDM RNG (w. prediction resistance) "user": userspace RNG "user-threadsafe": userspace RNG, with internal locking "rdrand": directly read RDRAND Set rng_type to null to let the library choose some default. |
Definition at line 38 of file ffi_rng.cpp.
References Botan::Processor_RNG::available(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_rng_init_custom | ( | botan_rng_t * | rng_out, |
| const char * | rng_name, | ||
| void * | context, | ||
| int(* | get_cb )(void *context, uint8_t *out, size_t out_len), | ||
| int(* | add_entropy_cb )(void *context, const uint8_t input[], size_t length), | ||
| void(* | destroy_cb )(void *context) ) |
Initialize a custom random number generator from a set of callback functions
| rng_out | rng object to create |
| rng_name | name of the rng |
| context | An application-specific context passed to the callback functions |
| get_cb | Callback for getting random bytes from the rng, return 0 for success |
| add_entropy_cb | Callback for adding entropy to the rng, return 0 for success, may be NULL |
| destroy_cb | Callback called when rng is destroyed, may be NULL |
Definition at line 81 of file ffi_rng.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_rng_init_drbg | ( | botan_rng_t * | rng_out, |
| const char * | drbg_name, | ||
| const uint8_t * | seed, | ||
| size_t | seed_len ) |
Create and seed a DRBG
| rng_out | the new DRBG object |
| drbg_name | the name of the DRBG (e.g. "HMAC_DRBG(SHA-256)") |
| SEED | the seed material (entropy || nonce || personalization_string) |
| seed_len | length of seed in bytes |
Definition at line 200 of file ffi_rng.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_rng_reseed | ( | botan_rng_t | rng, |
| size_t | bits ) |
Reseed a random number generator Uses the System_RNG as a seed generator.
| Random Number Generators | rng object |
| bits | number of bits to reseed with |
Definition at line 185 of file ffi_rng.cpp.
References BOTAN_FFI_VISIT, and Botan::system_rng().
| int botan_rng_reseed_from_rng | ( | botan_rng_t | rng, |
| botan_rng_t | source_rng, | ||
| size_t | bits ) |
Reseed a random number generator
| Random Number Generators | rng object |
| source_rng | the rng that will be read from |
| bits | number of bits to reseed with |
Definition at line 196 of file ffi_rng.cpp.
References BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
| int botan_same_mem | ( | const uint8_t * | x, |
| const uint8_t * | y, | ||
| size_t | len ) |
Deprecated equivalent to botan_constant_time_compare
Definition at line 336 of file ffi.cpp.
References botan_constant_time_compare().
| int botan_scrub_mem | ( | void * | mem, |
| size_t | bytes ) |
Clear out memory using a system specific approach to bypass elision by the compiler (currently using RtlSecureZeroMemory or tricks with volatile pointers).
Definition at line 340 of file ffi.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and Botan::secure_scrub_memory().
| int botan_scrypt | ( | uint8_t | out[], |
| size_t | out_len, | ||
| const char * | passphrase, | ||
| const uint8_t | salt[], | ||
| size_t | salt_len, | ||
| size_t | N, | ||
| size_t | r, | ||
| size_t | p ) |
Derive a key using scrypt Deprecated; use botan_pwdhash("Scrypt", N, r, p, out, out_len, password, 0, salt, salt_len);
Definition at line 166 of file ffi_kdf.cpp.
References botan_pwdhash().
| int botan_spake2p_derive_secret | ( | botan_spake2p_params_t | params, |
| const char * | password, | ||
| const uint8_t | prover_id[], | ||
| size_t | prover_id_len, | ||
| const uint8_t | verifier_id[], | ||
| size_t | verifier_id_len, | ||
| const uint8_t | salt[], | ||
| size_t | salt_len, | ||
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
Derive a SPAKE2+ prover secret (w0 and w1) from a password, using Argon2id
The view callback is invoked with the serialized prover secret, which is password equivalent and must be protected accordingly. It is used with botan_spake2p_registration_record and botan_spake2p_prover_init.
| params | the SPAKE2+ system parameters |
| password | the (null terminated) password |
| prover_id | the identity of the prover |
| prover_id_len | length of prover_id in bytes |
| verifier_id | the identity of the verifier |
| verifier_id_len | length of verifier_id in bytes |
| salt | a salt value, ideally random and stored with the registration record |
| salt_len | length of salt in bytes |
| ctx | a context pointer passed to the view callback |
| view | a view callback which is invoked with the serialized prover secret |
Definition at line 137 of file ffi_spake2p.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan::SPAKE2p::ProverSecret::from_password(), Botan_FFI::invoke_view_callback(), and Botan_FFI::safe_get().
| int botan_spake2p_params_confirmation_size | ( | botan_spake2p_params_t | params, |
| size_t * | confirmation_size ) |
Return the size in bytes of a SPAKE2+ key confirmation message (confirmP or confirmV)
| params | the SPAKE2+ system parameters |
| confirmation_size | output parameter for the key confirmation size |
Definition at line 121 of file ffi_spake2p.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_spake2p_params_destroy | ( | botan_spake2p_params_t | params | ) |
Frees all resources of SPAKE2+ system parameters
Definition at line 102 of file ffi_spake2p.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_spake2p_params_init | ( | botan_spake2p_params_t * | params, |
| const char * | ciphersuite ) |
Create SPAKE2+ system parameters from an RFC 9383 ciphersuite name
Objects created from the system parameters hold their own copy, so the parameters may be destroyed at any time.
| params | output parameter for the created system parameters |
| ciphersuite | the SPAKE2+ ciphersuite name |
Definition at line 68 of file ffi_spake2p.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_spake2p_params_init_custom | ( | botan_spake2p_params_t * | params, |
| botan_ec_group_t | group, | ||
| const uint8_t | seed[], | ||
| size_t | seed_len, | ||
| const char * | hash_fn ) |
Create custom SPAKE2+ system parameters for an arbitrary group
The M/N group elements are derived from the seed using hash to curve; returns BOTAN_FFI_ERROR_NOT_IMPLEMENTED if the group does not support hash to curve. Both peers must use the same group, seed, and hash.
If the seed includes the identities of the participants, this additionally makes the scheme "quantum annoying", in that an attacker with a discrete logarithm oracle must compute a new discrete log for each (prover, verifier) pair they wish to attack.
| params | output parameter for the created system parameters |
| group | the elliptic curve group to use |
| SEED | the seed bytes used to derive the M/N group elements |
| seed_len | length of seed in bytes |
| hash_fn | the hash function to use (eg "SHA-256") |
Definition at line 84 of file ffi_spake2p.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan::SPAKE2p::SystemParameters::custom(), Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_spake2p_params_share_size | ( | botan_spake2p_params_t | params, |
| size_t * | share_size ) |
Return the size in bytes of a SPAKE2+ key share (shareP or shareV)
| params | the SPAKE2+ system parameters |
| share_size | output parameter for the key share size |
Definition at line 106 of file ffi_spake2p.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_spake2p_prover_destroy | ( | botan_spake2p_prover_t | prover | ) |
Frees all resources of a SPAKE2+ prover
Definition at line 221 of file ffi_spake2p.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_spake2p_prover_generate_message | ( | botan_spake2p_prover_t | prover, |
| botan_rng_t | rng, | ||
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
Generate the prover's key share (shareP), which is sent to the verifier
This can be called only once per prover object.
| prover | the prover object |
| Random Number Generators | a random number generator |
| ctx | a context pointer passed to the view callback |
| view | a view callback which is invoked with the key share |
Definition at line 225 of file ffi_spake2p.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan_FFI::invoke_view_callback(), and Botan_FFI::safe_get().
| int botan_spake2p_prover_init | ( | botan_spake2p_prover_t * | prover, |
| botan_spake2p_params_t | params, | ||
| const uint8_t | secret[], | ||
| size_t | secret_len, | ||
| const uint8_t | prover_id[], | ||
| size_t | prover_id_len, | ||
| const uint8_t | verifier_id[], | ||
| size_t | verifier_id_len, | ||
| const uint8_t | context[], | ||
| size_t | context_len ) |
Initialize a SPAKE2+ prover
The identities and context must be agreed upon by both parties; the identities must additionally match the values used when deriving the prover secret.
| prover | output parameter for the created prover object |
| params | the SPAKE2+ system parameters |
| secret | the serialized prover secret |
| secret_len | length of secret in bytes |
| prover_id | the identity of the prover |
| prover_id_len | length of prover_id in bytes |
| verifier_id | the identity of the verifier |
| verifier_id_len | length of verifier_id in bytes |
| context | an application specific context string |
| context_len | length of context in bytes |
Definition at line 188 of file ffi_spake2p.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan::SPAKE2p::ProverSecret::deserialize(), Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_spake2p_prover_process_message | ( | botan_spake2p_prover_t | prover, |
| botan_rng_t | rng, | ||
| const uint8_t | peer_message[], | ||
| size_t | peer_message_len, | ||
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
Consume the verifier's response (shareV followed by confirmV) and produce the prover's key confirmation (confirmP), which is sent to the verifier.
Returns BOTAN_FFI_ERROR_BAD_MAC if the verifier's key confirmation is wrong, typically meaning the passwords do not match.
| prover | the prover object |
| Random Number Generators | a random number generator |
| peer_message | the verifier's response |
| peer_message_len | length of peer_message in bytes |
| ctx | a context pointer passed to the view callback |
| view | a view callback which is invoked with the prover's key confirmation |
Definition at line 238 of file ffi_spake2p.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan_FFI::invoke_view_callback(), and Botan_FFI::safe_get().
| int botan_spake2p_prover_shared_secret | ( | botan_spake2p_prover_t | prover, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
Return the prover's shared secret (K_shared)
This may be called only after botan_spake2p_prover_process_message has succeeded.
| prover | the prover object |
| ctx | a context pointer passed to the view callback |
| view | a view callback which is invoked with the shared secret |
Definition at line 257 of file ffi_spake2p.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
| int botan_spake2p_registration_record | ( | botan_spake2p_params_t | params, |
| botan_rng_t | rng, | ||
| const uint8_t | secret[], | ||
| size_t | secret_len, | ||
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
Compute a SPAKE2+ registration record (w0 and L) from a prover secret
The registration record is provided to the verifier during registration. While it does not allow directly impersonating the prover, it does allow offline password guessing attacks, so it should be protected.
| params | the SPAKE2+ system parameters |
| Random Number Generators | a random number generator |
| secret | the serialized prover secret |
| secret_len | length of secret in bytes |
| ctx | a context pointer passed to the view callback |
| view | a view callback which is invoked with the serialized registration record |
Definition at line 167 of file ffi_spake2p.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan::SPAKE2p::ProverSecret::deserialize(), Botan_FFI::ffi_guard_thunk(), Botan_FFI::invoke_view_callback(), and Botan_FFI::safe_get().
| int botan_spake2p_verifier_destroy | ( | botan_spake2p_verifier_t | verifier | ) |
Frees all resources of a SPAKE2+ verifier
Definition at line 299 of file ffi_spake2p.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_spake2p_verifier_init | ( | botan_spake2p_verifier_t * | verifier, |
| botan_spake2p_params_t | params, | ||
| const uint8_t | record[], | ||
| size_t | record_len, | ||
| const uint8_t | prover_id[], | ||
| size_t | prover_id_len, | ||
| const uint8_t | verifier_id[], | ||
| size_t | verifier_id_len, | ||
| const uint8_t | context[], | ||
| size_t | context_len ) |
Initialize a SPAKE2+ verifier
The identities and context must be agreed upon by both parties; the identities must additionally match the values used when deriving the prover secret.
| verifier | output parameter for the created verifier object |
| params | the SPAKE2+ system parameters |
| record | the serialized registration record |
| record_len | length of record in bytes |
| prover_id | the identity of the prover |
| prover_id_len | length of prover_id in bytes |
| verifier_id | the identity of the verifier |
| verifier_id_len | length of verifier_id in bytes |
| context | an application specific context string |
| context_len | length of context in bytes |
Definition at line 266 of file ffi_spake2p.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan::SPAKE2p::RegistrationRecord::deserialize(), Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_spake2p_verifier_process_message | ( | botan_spake2p_verifier_t | verifier, |
| botan_rng_t | rng, | ||
| const uint8_t | peer_message[], | ||
| size_t | peer_message_len, | ||
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
Consume the prover's key share (shareP) and produce the verifier's response (shareV followed by confirmV), which is sent to the prover.
This can be called only once per verifier object.
| verifier | the verifier object |
| Random Number Generators | a random number generator |
| peer_message | the prover's key share |
| peer_message_len | length of peer_message in bytes |
| ctx | a context pointer passed to the view callback |
| view | a view callback which is invoked with the verifier's response |
Definition at line 303 of file ffi_spake2p.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan_FFI::invoke_view_callback(), and Botan_FFI::safe_get().
| int botan_spake2p_verifier_shared_secret | ( | botan_spake2p_verifier_t | verifier, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
Return the verifier's shared secret (K_shared)
This may be called only after botan_spake2p_verifier_verify_confirmation has succeeded, or after botan_spake2p_verifier_skip_confirmation.
| verifier | the verifier object |
| ctx | a context pointer passed to the view callback |
| view | a view callback which is invoked with the shared secret |
Definition at line 353 of file ffi_spake2p.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
| int botan_spake2p_verifier_skip_confirmation | ( | botan_spake2p_verifier_t | verifier | ) |
Skip checking the prover's key confirmation (confirmP)
This can be called after botan_spake2p_verifier_process_message, in place of botan_spake2p_verifier_verify_confirmation, to allow extracting the shared secret without having checked the prover's key confirmation.
Warning: after calling this, nothing is known about the peer; only a prover which knows the password can compute the same shared secret, but no evidence of this has been received. It is intended solely for protocols which embed SPAKE2+ and perform the prover's key confirmation themselves, for example the proposed TLS PAKE extension, where the TLS handshake takes the place of confirmP. Anywhere else, use botan_spake2p_verifier_verify_confirmation.
| verifier | the verifier object |
Definition at line 341 of file ffi_spake2p.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_spake2p_verifier_verify_confirmation | ( | botan_spake2p_verifier_t | verifier, |
| const uint8_t | confirmation[], | ||
| size_t | confirmation_len ) |
Check the prover's key confirmation (confirmP)
Returns BOTAN_FFI_ERROR_BAD_MAC if the confirmation is wrong, meaning the prover does not know the password.
| verifier | the verifier object |
| confirmation | the prover's key confirmation |
| confirmation_len | length of confirmation in bytes |
Definition at line 323 of file ffi_spake2p.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_srp6_client_agree | ( | const char * | username, |
| const char * | password, | ||
| const char * | group_id, | ||
| const char * | hash_id, | ||
| const uint8_t | salt[], | ||
| size_t | salt_len, | ||
| const uint8_t | B[], | ||
| size_t | B_len, | ||
| botan_rng_t | rng_obj, | ||
| uint8_t | A[], | ||
| size_t * | A_len, | ||
| uint8_t | K[], | ||
| size_t * | K_len ) |
SRP6a Client side
| username | the username we are attempting login for |
| password | the password we are attempting to use |
| group_id | specifies the shared SRP group |
| Hash Function Identification | specifies a secure hash function |
| salt | is the salt value sent by the server |
| salt_len | the length of salt |
| B | is the server's public value |
| B_len | is the server's public value length |
| rng_obj | is a random number generator object |
| A | out buffer to store the SRP-6 A value |
| A_len | SRP-6 A verifier value length |
| K | out buffer to store the symmetric value |
| K_len | symmetric key length |
Definition at line 153 of file ffi_srp6.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan::BigInt::from_bytes(), Botan::DL_Group::from_name(), Botan_FFI::safe_get(), Botan::srp6_client_agree(), and Botan_FFI::write_vec_output().
Referenced by botan_srp6_server_session_step1().
| int botan_srp6_generate_verifier | ( | const char * | identifier, |
| const char * | password, | ||
| const uint8_t | salt[], | ||
| size_t | salt_len, | ||
| const char * | group_id, | ||
| const char * | hash_id, | ||
| uint8_t | verifier[], | ||
| size_t * | verifier_len ) |
Generate a new SRP-6 verifier
| identifier | a username or other client identifier |
| password | the secret used to authenticate user |
| salt | a randomly chosen value, at least 128 bits long |
| salt_len | the length of salt |
| group_id | specifies the shared SRP group |
| Hash Function Identification | specifies a secure hash function |
| verifier | out buffer to store the SRP-6 verifier value |
| verifier_len | SRP-6 verifier value length |
Definition at line 123 of file ffi_srp6.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan::DL_Group::from_name(), Botan::srp6_generate_verifier(), and Botan_FFI::write_vec_output().
Referenced by botan_srp6_server_session_step1().
| int botan_srp6_group_size | ( | const char * | group_id, |
| size_t * | group_p_bytes ) |
Return the size, in bytes, of the prime associated with group_id
Definition at line 49 of file ffi_srp6.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan::DL_Group::from_name().
Referenced by botan_srp6_server_session_step1().
| int botan_srp6_server_session_destroy | ( | botan_srp6_server_session_t | srp6 | ) |
Frees all resources of the SRP-6 server session object
| SRP-6a | SRP-6 server session object |
Definition at line 45 of file ffi_srp6.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_srp6_server_session_init | ( | botan_srp6_server_session_t * | srp6 | ) |
Initialize an SRP-6 server session object
| SRP-6a | SRP-6 server session object |
Definition at line 32 of file ffi_srp6.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_srp6_server_session_step1 | ( | botan_srp6_server_session_t | srp6, |
| const uint8_t | verifier[], | ||
| size_t | verifier_len, | ||
| const char * | group_id, | ||
| const char * | hash_id, | ||
| botan_rng_t | rng_obj, | ||
| uint8_t | B_pub[], | ||
| size_t * | B_pub_len ) |
SRP-6 Server side step 1
| SRP-6a | SRP-6 server session object |
| verifier | the verification value saved from client registration |
| verifier_len | SRP-6 verifier value length |
| group_id | the SRP group id |
| Hash Function Identification | the SRP hash in use |
| rng_obj | a random number generator object |
| B_pub | out buffer to store the SRP-6 B value |
| B_pub_len | SRP-6 B value length |
References BOTAN_FFI_EXPORT, botan_srp6_client_agree(), botan_srp6_generate_verifier(), botan_srp6_group_size(), botan_srp6_server_session_step1(), and botan_srp6_server_session_step2().
Referenced by botan_srp6_server_session_step1().
| int botan_srp6_server_session_step2 | ( | botan_srp6_server_session_t | srp6, |
| const uint8_t | A[], | ||
| size_t | A_len, | ||
| uint8_t | key[], | ||
| size_t * | key_len ) |
SRP-6 Server side step 2
| SRP-6a | SRP-6 server session object |
| A | the client's value |
| A_len | the client's value length |
| key | out buffer to store the symmetric key value |
| key_len | symmetric key length |
Definition at line 102 of file ffi_srp6.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan::BigInt::from_bytes(), and Botan_FFI::write_vec_output().
Referenced by botan_srp6_server_session_step1().
| int botan_system_rng_get | ( | uint8_t * | out, |
| size_t | out_len ) |
Get random bytes from system random number generator
| out | output buffer of size out_len |
| out_len | number of requested bytes |
Definition at line 175 of file ffi_rng.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), Botan::RandomNumberGenerator::randomize(), and Botan::system_rng().
| int botan_totp_check | ( | botan_totp_t | totp, |
| uint32_t | totp_code, | ||
| uint64_t | timestamp, | ||
| size_t | acceptable_clock_drift ) |
Verify a TOTP code
| totp | the TOTP object |
| totp_code | the presented OTP |
| timestamp | the current local timestamp |
| acceptable_clock_drift | specifies the acceptable amount of clock drift (in terms of time steps) between the two hosts. |
Definition at line 68 of file ffi_totp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_INVALID_VERIFIER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_totp_destroy | ( | botan_totp_t | totp | ) |
Destroy a TOTP instance
Definition at line 45 of file ffi_totp.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_totp_generate | ( | botan_totp_t | totp, |
| uint32_t * | totp_code, | ||
| uint64_t | timestamp ) |
Generate a TOTP code for the provided timestamp
| totp | the TOTP object |
| totp_code | the OTP code will be written here |
| timestamp | the current local timestamp |
Definition at line 54 of file ffi_totp.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_totp_init | ( | botan_totp_t * | totp, |
| const uint8_t | key[], | ||
| size_t | key_len, | ||
| const char * | hash_algo, | ||
| size_t | digits, | ||
| size_t | time_step ) |
Initialize a TOTP instance
Definition at line 26 of file ffi_totp.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_tpm2_crypto_backend_state_destroy | ( | botan_tpm2_crypto_backend_state_t | cbs | ) |
Frees all resources of a TPM2 Crypto Callback State Note that this does not attempt to de-register the crypto backend, it just frees the resource pointed to by cbs. Use the ESAPI function Esys_SetCryptoCallbacks(ctx, nullptr) to deregister manually.
| cbs | TPM2 Crypto Callback State |
Definition at line 203 of file ffi_tpm2.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_tpm2_ctx_destroy | ( | botan_tpm2_ctx_t | ctx | ) |
Frees all resources of a TPM2 context
| ctx | TPM2 context |
Definition at line 172 of file ffi_tpm2.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_tpm2_ctx_enable_crypto_backend | ( | botan_tpm2_ctx_t | ctx, |
| botan_rng_t | rng ) |
Enable Botan's TSS2 crypto backend that replaces the cryptographic functions required for the communication with the TPM with implementations provided by Botan instead of using TSS' defaults OpenSSL or mbedTLS. Note that the provided rng should not be dependent on the TPM and the caller must ensure that it remains usable for the lifetime of the ctx.
| ctx | TPM2 context |
| Random Number Generators | random number generator to be used by the crypto backend |
Definition at line 150 of file ffi_tpm2.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::safe_get().
| int botan_tpm2_ctx_from_esys | ( | botan_tpm2_ctx_t * | ctx_out, |
| struct ESYS_CONTEXT * | esys_ctx ) |
Wrap an existing ESYS_CONTEXT for use in Botan. Note that destroying the created botan_tpm2_ctx_t won't finalize esys_ctx
| ctx_out | output TPM2 context |
| esys_ctx | ESYS_CONTEXT to wrap |
Definition at line 133 of file ffi_tpm2.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan::TPM2::Context::create(), Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_tpm2_ctx_init | ( | botan_tpm2_ctx_t * | ctx_out, |
| const char * | tcti_nameconf ) |
Initialize a TPM2 context
| ctx_out | output TPM2 context |
| tcti_nameconf | TCTI config (may be nullptr) |
Definition at line 75 of file ffi_tpm2.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan::TPM2::Context::create(), Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_tpm2_ctx_init_ex | ( | botan_tpm2_ctx_t * | ctx_out, |
| const char * | tcti_name, | ||
| const char * | tcti_conf ) |
Initialize a TPM2 context
| ctx_out | output TPM2 context |
| tcti_name | TCTI name (may be nullptr) |
| tcti_conf | TCTI config (may be nullptr) |
Definition at line 100 of file ffi_tpm2.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan::TPM2::Context::create(), Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_tpm2_enable_crypto_backend | ( | botan_tpm2_crypto_backend_state_t * | cbs_out, |
| struct ESYS_CONTEXT * | esys_ctx, | ||
| botan_rng_t | rng ) |
Use this if you just need Botan's crypto backend but do not want to wrap any other ESYS functionality using Botan's TPM2 wrapper. A Crypto Backend State is created that the user needs to keep alive for as long as the crypto backend is used and needs to be destroyed after. Note that the provided rng should not be dependent on the TPM and the caller must ensure that it remains usable for the lifetime of the esys_ctx.
| cbs_out | To be created Crypto Backend State |
| esys_ctx | TPM2 context |
| Random Number Generators | random number generator to be used by the crypto backend |
Definition at line 181 of file ffi_tpm2.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan_FFI::safe_get(), and Botan::TPM2::use_botan_crypto_backend().
| int botan_tpm2_rng_init | ( | botan_rng_t * | rng_out, |
| botan_tpm2_ctx_t | ctx, | ||
| botan_tpm2_session_t | s1, | ||
| botan_tpm2_session_t | s2, | ||
| botan_tpm2_session_t | s3 ) |
Initialize a random number generator object via TPM2
| rng_out | rng object to create |
| ctx | TPM2 context |
| s1 | the first session to use (optional, may be nullptr) |
| s2 | the second session to use (optional, may be nullptr) |
| s3 | the third session to use (optional, may be nullptr) |
Definition at line 212 of file ffi_tpm2.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::ffi_new_object().
| int botan_tpm2_session_destroy | ( | botan_tpm2_session_t | session | ) |
Create an unauthenticated session for use with TPM2
| session | the session object to destroy |
Definition at line 249 of file ffi_tpm2.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_tpm2_supports_crypto_backend | ( | void | ) |
Checks if Botan's TSS2 crypto backend can be used in this build
Definition at line 67 of file ffi_tpm2.cpp.
References Botan::TPM2::Context::supports_botan_crypto_backend().
| int botan_tpm2_unauthenticated_session_init | ( | botan_tpm2_session_t * | session_out, |
| botan_tpm2_ctx_t | ctx ) |
Create an unauthenticated session for use with TPM2
| session_out | the session object to create |
| ctx | TPM2 context |
Definition at line 232 of file ffi_tpm2.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan_FFI::ffi_new_object(), and Botan::TPM2::Session::unauthenticated_session().
| uint32_t botan_version_datestamp | ( | void | ) |
Return the date this version was released as an integer.
Returns 0 if the library was not built from an official release
Definition at line 323 of file ffi.cpp.
References Botan::version_datestamp().
| uint32_t botan_version_major | ( | void | ) |
Return the major version of the library
Definition at line 311 of file ffi.cpp.
References Botan::version_major().
| uint32_t botan_version_minor | ( | void | ) |
Return the minor version of the library
Definition at line 315 of file ffi.cpp.
References Botan::version_minor().
| uint32_t botan_version_patch | ( | void | ) |
Return the patch version of the library
Definition at line 319 of file ffi.cpp.
References Botan::version_patch().
| const char * botan_version_string | ( | void | ) |
Return a free-form version string, e.g., 2.0.0
Definition at line 307 of file ffi.cpp.
References Botan::version_cstr().
| int botan_x509_cert_allowed_extended_usage_oid | ( | botan_x509_cert_t | cert, |
| botan_asn1_oid_t | oid ) |
Check if the certificate allows the specified extended usage OID. See RFC 5280 Section 4.2.1.12 for OIDs to query for this. If no extended key usage extension is found in the certificate, this always returns "not success".
This is similar to botan_x509_cert_allowed_extended_usage_str but takes an OID object instead of a string describing the OID.
Definition at line 574 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::safe_get().
| int botan_x509_cert_allowed_extended_usage_str | ( | botan_x509_cert_t | cert, |
| const char * | oid ) |
Check if the certificate allows the specified extended usage OID. See RFC 5280 Section 4.2.1.12 for OIDs to query for this. If no extended key usage extension is found in the certificate, this always returns "not success".
Typical OIDs to check for:
The oid parameter can be either a canonical OID string or identifiers as indicated in the examples above.
Definition at line 559 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_allowed_usage | ( | botan_x509_cert_t | cert, |
| unsigned int | key_usage ) |
Check if the certificate allows the specified key usage. If no key usage extension is found in the certificate, this always returns success.
| cert | the certificate to inspect |
| key_usage | one or more values from botan_x509_cert_key_constraints, ORed together |
Definition at line 544 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_destroy | ( | botan_x509_cert_t | cert | ) |
Frees all resources of the certificate object
| cert | the certificate to destroy |
Definition at line 583 of file ffi_cert.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_x509_cert_dup | ( | botan_x509_cert_t * | new_cert, |
| botan_x509_cert_t | cert ) |
Create a new handle referring to the same certificate
| new_cert | the new object will be placed here |
| cert | the certificate to duplicate |
Definition at line 193 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_x509_cert_excluded_name_constraints | ( | botan_x509_cert_t | cert, |
| size_t | index, | ||
| botan_x509_general_name_t * | constraint ) |
Extracts "excluded" name constraints from a given cert one-by-one. Returns BOTAN_FFI_ERROR_OUT_OF_RANGE if the given index is larger than the available number of "excluded" name constraints.
Definition at line 823 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan::NameConstraints::excluded(), Botan_FFI::ffi_new_object(), and Botan::X509_Certificate::name_constraints().
| int botan_x509_cert_excluded_name_constraints_count | ( | botan_x509_cert_t | cert, |
| size_t * | count ) |
Count the "excluded" name constraints of a given cert.
| cert | the certificate to inspect |
| count | set to the number of available entries |
Definition at line 845 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_get_authority_key_id | ( | botan_x509_cert_t | cert, |
| uint8_t | out[], | ||
| size_t * | out_len ) |
Get the key identifier from the authority key identifier extension
| cert | the certificate to inspect |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
Definition at line 677 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_vec_output().
| int botan_x509_cert_get_fingerprint | ( | botan_x509_cert_t | cert, |
| const char * | hash, | ||
| uint8_t | out[], | ||
| size_t * | out_len ) |
Compute the fingerprint of the certificate, formatted as a hex string with colons between the bytes
| cert | the certificate to inspect |
| Hashes | the name of the hash to use, eg "SHA-256" |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
TODO(Botan4) this should use char for the out param
Definition at line 661 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_str_output().
| int botan_x509_cert_get_issuer_dn | ( | botan_x509_cert_t | cert, |
| const char * | key, | ||
| size_t | index, | ||
| uint8_t | out[], | ||
| size_t * | out_len ) |
Enumerates the names of the given key in the issuer DN. If index is out of bounds, BOTAN_FFI_ERROR_BAD_PARAMETER is returned.
TODO(Botan4) use BOTAN_FFI_ERROR_OUT_OF_RANGE instead of BAD_PARAMETER TODO(Botan4) this should use char for the out param
Definition at line 457 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_str_output().
| int botan_x509_cert_get_issuer_dn_count | ( | botan_x509_cert_t | cert, |
| const char * | key, | ||
| size_t * | count ) |
Count the names of the given key present in the issuer DN.
| cert | the certificate to inspect |
| key | the DN component to count, eg "Name" |
| count | set to the number of available entries |
Definition at line 478 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_get_path_length_constraint | ( | botan_x509_cert_t | cert, |
| size_t * | path_limit ) |
Retrieves the path length constraint from the certificate. If no such constraint is present, BOTAN_FFI_ERROR_NO_VALUE is returned.
Definition at line 419 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_get_public_key | ( | botan_x509_cert_t | cert, |
| botan_pubkey_t * | key ) |
Get the public key of the certificate
| cert | the certificate to inspect |
| key | the new object will be placed here |
Definition at line 439 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_x509_cert_get_public_key_bits | ( | botan_x509_cert_t | cert, |
| uint8_t | out[], | ||
| size_t * | out_len ) |
Get the DER encoded SubjectPublicKeyInfo of the certificate
| cert | the certificate to inspect |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
Definition at line 695 of file ffi_cert.cpp.
References botan_x509_cert_view_public_key_bits(), and Botan_FFI::copy_view_bin().
| int botan_x509_cert_get_serial_number | ( | botan_x509_cert_t | cert, |
| uint8_t | out[], | ||
| size_t * | out_len ) |
Get the serial number of the certificate as a big-endian binary string
| cert | the certificate to inspect |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
Definition at line 636 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_vec_output().
| int botan_x509_cert_get_subject_dn | ( | botan_x509_cert_t | cert, |
| const char * | key, | ||
| size_t | index, | ||
| uint8_t | out[], | ||
| size_t * | out_len ) |
Enumerates the names of the given key in the subject DN. If index is out of bounds, BOTAN_FFI_ERROR_BAD_PARAMETER is returned.
TODO(Botan4) use BOTAN_FFI_ERROR_OUT_OF_RANGE instead of BAD_PARAMETER TODO(Botan4) this should use char for the out param
Definition at line 494 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_str_output().
| int botan_x509_cert_get_subject_dn_count | ( | botan_x509_cert_t | cert, |
| const char * | key, | ||
| size_t * | count ) |
Count the names of the given key present in the subject DN.
| cert | the certificate to inspect |
| key | the DN component to count, eg "Name" |
| count | set to the number of available entries |
Definition at line 515 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_get_subject_key_id | ( | botan_x509_cert_t | cert, |
| uint8_t | out[], | ||
| size_t * | out_len ) |
Get the subject key identifier extension
| cert | the certificate to inspect |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
Definition at line 686 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_vec_output().
| int botan_x509_cert_get_time_expires | ( | botan_x509_cert_t | cert, |
| char | out[], | ||
| size_t * | out_len ) |
Get the end of the validity period as a string
Prefer botan_x509_cert_not_after
| cert | the certificate to inspect |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
Definition at line 602 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_str_output().
| int botan_x509_cert_get_time_starts | ( | botan_x509_cert_t | cert, |
| char | out[], | ||
| size_t * | out_len ) |
Get the start of the validity period as a string
Prefer botan_x509_cert_not_before
| cert | the certificate to inspect |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
Definition at line 592 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_str_output().
| int botan_x509_cert_hostname_match | ( | botan_x509_cert_t | cert, |
| const char * | hostname ) |
Check if the certificate matches the specified hostname via alternative name or CN match. RFC 5280 wildcards also supported.
Definition at line 936 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_is_ca | ( | botan_x509_cert_t | cert | ) |
Returns 1 iff the cert is a CA certificate
Definition at line 410 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_issuer_alternative_names | ( | botan_x509_cert_t | cert, |
| size_t | index, | ||
| botan_x509_general_name_t * | alt_name ) |
Provides access to all "issuer alternative names", where each entry is returned as a botan_x509_general_name_t. If the given index is not within range of the available entries, BOTAN_FFI_ERROR_OUT_OF_RANGE is returned. If cert does not contain an IssuerAlternativeNames extension, BOTAN_FFI_ERROR_NO_VALUE is returned.
Definition at line 897 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan::Extensions::extension_set(), Botan_FFI::ffi_new_object(), Botan::OID::from_string(), Botan::X509_Certificate::issuer_alt_name(), and Botan::X509_Certificate::v3_extensions().
| int botan_x509_cert_issuer_alternative_names_count | ( | botan_x509_cert_t | cert, |
| size_t * | count ) |
Count the "issuer alternative names" of a given cert.
| cert | the certificate to inspect |
| count | set to the number of available entries |
Definition at line 922 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::X509_Certificate::issuer_alt_name().
| int botan_x509_cert_load | ( | botan_x509_cert_t * | cert_obj, |
| const uint8_t | cert[], | ||
| size_t | cert_len ) |
Load a certificate from a DER or PEM encoding
| cert_obj | the new object will be placed here |
| cert | the encoding to load |
| cert_len | length of cert in bytes |
Definition at line 211 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_x509_cert_load_file | ( | botan_x509_cert_t * | cert_obj, |
| const char * | filename ) |
Load a certificate from a file containing a DER or PEM encoding
| cert_obj | the new object will be placed here |
| filename | path of the file to read |
Definition at line 176 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_x509_cert_not_after | ( | botan_x509_cert_t | cert, |
| uint64_t * | time_since_epoch ) |
Get the end of the validity period as seconds since the Unix epoch
| cert | the certificate to inspect |
| time_since_epoch | set to the notAfter time |
Definition at line 624 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_not_before | ( | botan_x509_cert_t | cert, |
| uint64_t * | time_since_epoch ) |
Get the start of the validity period as seconds since the Unix epoch
| cert | the certificate to inspect |
| time_since_epoch | set to the notBefore time |
Definition at line 612 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_permitted_name_constraints | ( | botan_x509_cert_t | cert, |
| size_t | index, | ||
| botan_x509_general_name_t * | constraint ) |
Extracts "permitted" name constraints from a given cert one-by-one. Returns BOTAN_FFI_ERROR_OUT_OF_RANGE if the given index is larger than the available number of "permitted" name constraints.
Definition at line 788 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan_FFI::ffi_new_object(), Botan::X509_Certificate::name_constraints(), and Botan::NameConstraints::permitted().
| int botan_x509_cert_permitted_name_constraints_count | ( | botan_x509_cert_t | cert, |
| size_t * | count ) |
Count the "permitted" name constraints of a given cert.
| cert | the certificate to inspect |
| count | set to the number of available entries |
Definition at line 810 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_serial_number | ( | botan_x509_cert_t | cert, |
| botan_mp_t * | serial_number ) |
Get the serial number of the certificate as an integer
| cert | the certificate to inspect |
| serial_number | the new object will be placed here |
Definition at line 645 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan_FFI::ffi_new_object(), Botan::X509_Certificate::serial(), and Botan::X509_Serial_Number::to_bigint().
| int botan_x509_cert_subject_alternative_names | ( | botan_x509_cert_t | cert, |
| size_t | index, | ||
| botan_x509_general_name_t * | alt_name ) |
Provides access to all "subject alternative names", where each entry is returned as a botan_x509_general_name_t. If the given index is not within range of the available entries, BOTAN_FFI_ERROR_OUT_OF_RANGE is returned. If cert does not contain a SubjectAlternativeNames extension, BOTAN_FFI_ERROR_NO_VALUE is returned.
Definition at line 858 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan::Extensions::extension_set(), Botan_FFI::ffi_new_object(), Botan::OID::from_string(), Botan::X509_Certificate::subject_alt_name(), and Botan::X509_Certificate::v3_extensions().
| int botan_x509_cert_subject_alternative_names_count | ( | botan_x509_cert_t | cert, |
| size_t * | count ) |
Count the "subject alternative names" of a given cert.
| cert | the certificate to inspect |
| count | set to the number of available entries |
Definition at line 883 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::X509_Certificate::subject_alt_name().
| int botan_x509_cert_to_string | ( | botan_x509_cert_t | cert, |
| char | out[], | ||
| size_t * | out_len ) |
Format the certificate as a human readable string
| cert | the certificate to format |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
Definition at line 531 of file ffi_cert.cpp.
References botan_x509_cert_view_as_string(), and Botan_FFI::copy_view_str().
| const char * botan_x509_cert_validation_status | ( | int | code | ) |
Returns a pointer to a static character string explaining the status code, or else NULL if unknown.
Definition at line 1023 of file ffi_cert.cpp.
References Botan::to_string().
| int botan_x509_cert_verify | ( | int * | validation_result, |
| botan_x509_cert_t | cert, | ||
| const botan_x509_cert_t * | intermediates, | ||
| size_t | intermediates_len, | ||
| const botan_x509_cert_t * | trusted, | ||
| size_t | trusted_len, | ||
| const char * | trusted_path, | ||
| size_t | required_strength, | ||
| const char * | hostname, | ||
| uint64_t | reference_time ) |
Returns 0 if the validation was successful, 1 if validation failed, and negative on error. A status code with details is written to *validation_result
Intermediates or trusted lists can be null Trusted path can be null
Definition at line 949 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), Botan::UNSPECIFIED, and Botan::x509_path_validate().
| int botan_x509_cert_verify_with_crl | ( | int * | validation_result, |
| botan_x509_cert_t | cert, | ||
| const botan_x509_cert_t * | intermediates, | ||
| size_t | intermediates_len, | ||
| const botan_x509_cert_t * | trusted, | ||
| size_t | trusted_len, | ||
| const botan_x509_crl_t * | crls, | ||
| size_t | crls_len, | ||
| const char * | trusted_path, | ||
| size_t | required_strength, | ||
| const char * | hostname, | ||
| uint64_t | reference_time ) |
Different flavor of botan_x509_cert_verify, supports revocation lists. CRLs are passed as an array, same as intermediates and trusted CAs
Definition at line 1433 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), Botan::UNSPECIFIED, and Botan::x509_path_validate().
| int botan_x509_cert_view_as_string | ( | botan_x509_cert_t | cert, |
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
View the certificate formatted as a human readable string
| cert | the certificate to format |
| ctx | an application context passed to the view function |
| view | the view callback which receives the string |
Definition at line 535 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
Referenced by botan_x509_cert_to_string().
| int botan_x509_cert_view_binary_values | ( | botan_x509_cert_t | cert, |
| botan_x509_value_type | value_type, | ||
| size_t | index, | ||
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
Retrieve a specific binary value from an X.509 certificate.
For multi-values index allows enumerating the available entries, until BOTAN_FFI_ERROR_OUT_OF_RANGE is returned. For singleton values, an index of value "0" is expected.
cert does not provide the requested value_type at all or not in binary format. Definition at line 285 of file ffi_cert.cpp.
References Botan::X509_Certificate::authority_key_id(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, BOTAN_X509_AUTHORITY_KEY_IDENTIFIER, BOTAN_X509_CA_ISSUERS_URLS, BOTAN_X509_CRL_DISTRIBUTION_URLS, BOTAN_X509_DER_ENCODING, BOTAN_X509_ISSUER_DN_BITS, BOTAN_X509_OCSP_RESPONDER_URLS, BOTAN_X509_PEM_ENCODING, BOTAN_X509_PUBLIC_KEY_PKCS8_BITS, BOTAN_X509_SERIAL_NUMBER, BOTAN_X509_SIGNATURE_BITS, BOTAN_X509_SIGNATURE_SCHEME_BITS, BOTAN_X509_SUBJECT_DN_BITS, BOTAN_X509_SUBJECT_KEY_IDENTIFIER, BOTAN_X509_TBS_DATA_BITS, Botan_FFI::invoke_view_callback(), Botan::X509_Certificate::raw_issuer_dn(), Botan::X509_Certificate::raw_subject_dn(), Botan::X509_Certificate::serial_number(), Botan::X509_Certificate::subject_key_id(), and Botan::X509_Certificate::subject_public_key_info().
Referenced by botan_x509_cert_view_binary_values_count().
| int botan_x509_cert_view_binary_values_count | ( | botan_x509_cert_t | cert, |
| botan_x509_value_type | value_type, | ||
| size_t * | count ) |
Count the binary values of the given type available in an X.509 certificate.
| cert | the certificate to inspect |
| value_type | the value type to count |
| count | set to the number of available entries |
Definition at line 340 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and botan_x509_cert_view_binary_values().
| int botan_x509_cert_view_public_key_bits | ( | botan_x509_cert_t | cert, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the DER encoded SubjectPublicKeyInfo of the certificate
| cert | the certificate to inspect |
| ctx | an application context passed to the view function |
| view | the view callback which receives the encoding |
Definition at line 699 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
Referenced by botan_x509_cert_get_public_key_bits().
| int botan_x509_cert_view_string_values | ( | botan_x509_cert_t | cert, |
| botan_x509_value_type | value_type, | ||
| size_t | index, | ||
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
Retrieve a specific string value from an X.509 certificate.
For multi-values index allows enumerating the available entries, until BOTAN_FFI_ERROR_OUT_OF_RANGE is returned. For singleton values, an index of value "0" is expected.
cert does not provide the requested value_type at all or not in string format. Definition at line 352 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, BOTAN_X509_AUTHORITY_KEY_IDENTIFIER, BOTAN_X509_CA_ISSUERS_URLS, BOTAN_X509_CRL_DISTRIBUTION_URLS, BOTAN_X509_DER_ENCODING, BOTAN_X509_ISSUER_DN_BITS, BOTAN_X509_OCSP_RESPONDER_URLS, BOTAN_X509_PEM_ENCODING, BOTAN_X509_PUBLIC_KEY_PKCS8_BITS, BOTAN_X509_SERIAL_NUMBER, BOTAN_X509_SIGNATURE_BITS, BOTAN_X509_SIGNATURE_SCHEME_BITS, BOTAN_X509_SUBJECT_DN_BITS, BOTAN_X509_SUBJECT_KEY_IDENTIFIER, BOTAN_X509_TBS_DATA_BITS, Botan::X509_Certificate::ca_issuer_uris(), Botan::X509_Certificate::crl_distribution_point_uris(), Botan_FFI::invoke_view_callback(), and Botan::X509_Certificate::ocsp_responder_uris().
Referenced by botan_x509_cert_view_string_values_count().
| int botan_x509_cert_view_string_values_count | ( | botan_x509_cert_t | cert, |
| botan_x509_value_type | value_type, | ||
| size_t * | count ) |
Count the string values of the given type available in an X.509 certificate.
| cert | the certificate to inspect |
| value_type | the value type to count |
| count | set to the number of available entries |
Definition at line 398 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and botan_x509_cert_view_string_values().
| int botan_x509_crl_create | ( | botan_x509_crl_t * | crl_obj, |
| botan_rng_t | rng, | ||
| botan_x509_cert_t | ca_cert, | ||
| botan_privkey_t | ca_key, | ||
| uint64_t | issue_time, | ||
| uint32_t | next_update, | ||
| const char * | hash_fn, | ||
| const char * | padding ) |
Create a new CRL
| crl_obj | The newly created CRL |
| Random Number Generators | a random number generator object |
| ca_cert | The CA Certificate the CRL belongs to |
| ca_key | The private key of that CA |
| issue_time | The time when the CRL becomes valid |
| next_update | The number of seconds after issue_time until the CRL expires |
| hash_fn | The hash function to use, may be null |
| padding | The padding to use, may be null |
Definition at line 1106 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_x509_crl_destroy | ( | botan_x509_crl_t | crl | ) |
Frees all resources of the CRL object
| crl | the CRL to destroy |
Definition at line 1196 of file ffi_cert.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_x509_crl_entries | ( | botan_x509_crl_t | crl, |
| size_t | index, | ||
| botan_x509_crl_entry_t * | entry ) |
Allows iterating all entries of the CRL.
| crl | the CRL whose entries should be listed |
| index | the index of the CRL entry to return |
| entry | an object handle containing the CRL entry data |
index is out of range of the CRL entry list. Definition at line 1333 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan_FFI::ffi_new_object(), and Botan::X509_CRL::get_revoked().
| int botan_x509_crl_entries_count | ( | botan_x509_crl_t | crl, |
| size_t * | count ) |
Count the entries of the CRL.
| crl | the CRL whose entries should be counted |
| count | set to the number of available entries |
Definition at line 1353 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::X509_CRL::get_revoked().
| int botan_x509_crl_entry_create | ( | botan_x509_crl_entry_t * | entry, |
| botan_x509_cert_t | cert, | ||
| int | reason_code ) |
Create a new CRL entry that marks cert as revoked
| entry | The newly created CRL entry |
| cert | The certificate to mark as revoked |
| reason_code | The reason code for revocation |
Definition at line 1132 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_x509_crl_entry_destroy | ( | botan_x509_crl_entry_t | entry | ) |
Frees all resources of the CRL entry object
| entry | the CRL entry to destroy |
Definition at line 1366 of file ffi_cert.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_x509_crl_entry_reason | ( | botan_x509_crl_entry_t | entry, |
| int * | reason_code ) |
Return the revocation reason code for the given CRL entry. See botan_x509_crl_reason_code and RFC 5280 - 5.3.1 for possible reason codes.
Definition at line 1375 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::CRL_Entry::reason_code().
| int botan_x509_crl_entry_revocation_date | ( | botan_x509_crl_entry_t | entry, |
| uint64_t * | time_since_epoch ) |
Return the revocation date for the given CRL entry as time since epoch in seconds.
Definition at line 1417 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan::CRL_Entry::expire_time(), and Botan::ASN1_Time::time_since_epoch().
| int botan_x509_crl_entry_serial_number | ( | botan_x509_crl_entry_t | entry, |
| botan_mp_t * | serial_number ) |
Return the serial number associated with the given CRL entry.
Definition at line 1391 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan_FFI::ffi_new_object(), Botan::CRL_Entry::serial(), and Botan::X509_Serial_Number::to_bigint().
| int botan_x509_crl_entry_view_serial_number | ( | botan_x509_crl_entry_t | entry, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the serial number associated with the given CRL entry.
Definition at line 1407 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan_FFI::invoke_view_callback(), and Botan::CRL_Entry::serial_number().
| int botan_x509_crl_load | ( | botan_x509_crl_t * | crl_obj, |
| const uint8_t | crl_bits[], | ||
| size_t | crl_bits_len ) |
Load a CRL from a DER or PEM encoding
| crl_obj | the new object will be placed here |
| crl_bits | the encoding to load |
| crl_bits_len | length of crl_bits in bytes |
Definition at line 1053 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_x509_crl_load_file | ( | botan_x509_crl_t * | crl_obj, |
| const char * | crl_path ) |
Load a CRL from a file containing a DER or PEM encoding
| crl_obj | the new object will be placed here |
| crl_path | path of the file to read |
Definition at line 1036 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_x509_crl_next_update | ( | botan_x509_crl_t | crl, |
| uint64_t * | time_since_epoch ) |
Get the nextUpdate field of the CRL as seconds since the Unix epoch
| crl | the CRL to inspect |
| time_since_epoch | set to the nextUpdate time |
Definition at line 1085 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_crl_this_update | ( | botan_x509_crl_t | crl, |
| uint64_t * | time_since_epoch ) |
Get the thisUpdate field of the CRL as seconds since the Unix epoch
| crl | the CRL to inspect |
| time_since_epoch | set to the thisUpdate time |
Definition at line 1070 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_crl_update | ( | botan_x509_crl_t * | crl_obj, |
| botan_x509_crl_t | last_crl, | ||
| botan_rng_t | rng, | ||
| botan_x509_cert_t | ca_cert, | ||
| botan_privkey_t | ca_key, | ||
| uint64_t | issue_time, | ||
| uint32_t | next_update, | ||
| const botan_x509_crl_entry_t * | new_entries, | ||
| size_t | new_entries_len, | ||
| const char * | hash_fn, | ||
| const char * | padding ) |
Update a CRL with new revoked entries. This does not modify the old crl, and instead creates a new one.
| crl_obj | The newly created CRL |
| last_crl | The CRL to update |
| Random Number Generators | a random number generator object |
| ca_cert | The CA Certificate the CRL belongs to |
| ca_key | The private key of that CA |
| issue_time | The time when the CRL becomes valid |
| next_update | The number of seconds after issue_time until the CRL expires |
| new_entries | The entries to add to the CRL |
| new_entries_len | The number of entries |
| hash_fn | The hash function to use, may be null |
| padding | The padding to use, may be null |
Definition at line 1147 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_x509_crl_verify_signature | ( | botan_x509_crl_t | crl, |
| botan_pubkey_t | key ) |
Check the signature on a CRL against the issuer's public key
| crl | the CRL to verify |
| key | the public key of the issuing CA |
Definition at line 1187 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::safe_get().
| int botan_x509_crl_view_binary_values | ( | botan_x509_crl_t | crl_obj, |
| botan_x509_value_type | value_type, | ||
| size_t | index, | ||
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
Retrieve a specific binary value from an X.509 certificate revocation list.
For multi-values index allows enumerating the available entries, until BOTAN_FFI_ERROR_OUT_OF_RANGE is returned. For singleton values, an index of value "0" is expected.
crl_obj does not provide the requested value_type at all or not in binary format. Definition at line 1205 of file ffi_cert.cpp.
References Botan::X509_CRL::authority_key_id(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, BOTAN_X509_AUTHORITY_KEY_IDENTIFIER, BOTAN_X509_CA_ISSUERS_URLS, BOTAN_X509_CRL_DISTRIBUTION_URLS, BOTAN_X509_DER_ENCODING, BOTAN_X509_ISSUER_DN_BITS, BOTAN_X509_OCSP_RESPONDER_URLS, BOTAN_X509_PEM_ENCODING, BOTAN_X509_PUBLIC_KEY_PKCS8_BITS, BOTAN_X509_SERIAL_NUMBER, BOTAN_X509_SIGNATURE_BITS, BOTAN_X509_SIGNATURE_SCHEME_BITS, BOTAN_X509_SUBJECT_DN_BITS, BOTAN_X509_SUBJECT_KEY_IDENTIFIER, BOTAN_X509_TBS_DATA_BITS, Botan::X509_CRL::crl_number_bigint(), Botan::X509_DN::get_bits(), Botan_FFI::invoke_view_callback(), Botan::X509_CRL::issuer_dn(), and Botan::ASN1::put_in_sequence().
Referenced by botan_x509_crl_view_binary_values_count().
| int botan_x509_crl_view_binary_values_count | ( | botan_x509_crl_t | crl_obj, |
| botan_x509_value_type | value_type, | ||
| size_t * | count ) |
Count the binary values of the given type available in a CRL.
| crl_obj | the CRL to inspect |
| value_type | the value type to count |
| count | set to the number of available entries |
Definition at line 1264 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and botan_x509_crl_view_binary_values().
| int botan_x509_crl_view_string_values | ( | botan_x509_crl_t | crl_obj, |
| botan_x509_value_type | value_type, | ||
| size_t | index, | ||
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
Retrieve a specific string value from an X.509 certificate revocation list.
For multi-values index allows enumerating the available entries, until BOTAN_FFI_ERROR_OUT_OF_RANGE is returned. For singleton values, an index of value "0" is expected.
crl_obj does not provide the requested value_type at all or not in string format. Definition at line 1276 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, BOTAN_X509_AUTHORITY_KEY_IDENTIFIER, BOTAN_X509_CA_ISSUERS_URLS, BOTAN_X509_CRL_DISTRIBUTION_URLS, BOTAN_X509_DER_ENCODING, BOTAN_X509_ISSUER_DN_BITS, BOTAN_X509_OCSP_RESPONDER_URLS, BOTAN_X509_PEM_ENCODING, BOTAN_X509_PUBLIC_KEY_PKCS8_BITS, BOTAN_X509_SERIAL_NUMBER, BOTAN_X509_SIGNATURE_BITS, BOTAN_X509_SIGNATURE_SCHEME_BITS, BOTAN_X509_SUBJECT_DN_BITS, BOTAN_X509_SUBJECT_KEY_IDENTIFIER, and BOTAN_X509_TBS_DATA_BITS.
Referenced by botan_x509_crl_view_string_values_count().
| int botan_x509_crl_view_string_values_count | ( | botan_x509_crl_t | crl_obj, |
| botan_x509_value_type | value_type, | ||
| size_t * | count ) |
Count the string values of the given type available in a CRL.
| crl_obj | the CRL to inspect |
| value_type | the value type to count |
| count | set to the number of available entries |
Definition at line 1311 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and botan_x509_crl_view_string_values().
| int botan_x509_ext_as_blocks_get_entry_at | ( | botan_x509_cert_t | cert, |
| int | asnum, | ||
| size_t | i, | ||
| uint32_t * | min, | ||
| uint32_t * | max ) |
Get a specific entry in the AS Blocks extension from RFC 3779
| cert | the certificate to inspect |
| asnum | Set to 1 to get info about AS numbers, 0 for RDIs (the type) |
| i | The index of the entry to get |
| min | is set to the min value of the range |
| max | is set to the max value of the range |
If the extension is not present or an error occurs, min and max are not modified
Definition at line 222 of file ffi_cert_ext.cpp.
References Botan::any_null_pointers(), Botan::Cert_Extension::ASBlocks::as_identifiers(), Botan::Cert_Extension::ASBlocks::ASIdentifiers::asnum(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
| int botan_x509_ext_as_blocks_get_info | ( | botan_x509_cert_t | cert, |
| int | asnum, | ||
| int * | present, | ||
| size_t * | count ) |
Get basic info about the AS Blocks extension from RFC 3779
| cert | the certificate to inspect |
| asnum | must be set to 1 to get info about AS numbers, 0 for RDIs (the type) |
| present | is set to 1 if the extension contains entries for the type, 0 if it is marked as "inherit" |
| count | is set to number of entries for this type, if it was present, otherwise count is not modified |
If the extension is not present or an error occurs, present and count are not modified
Definition at line 183 of file ffi_cert_ext.cpp.
References Botan::any_null_pointers(), Botan::Cert_Extension::ASBlocks::as_identifiers(), Botan::Cert_Extension::ASBlocks::ASIdentifiers::asnum(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
| int botan_x509_ext_ip_addr_blocks_get_address | ( | botan_x509_cert_t | cert, |
| int | ipv6, | ||
| size_t | i, | ||
| size_t | entry, | ||
| uint8_t | min_out[], | ||
| uint8_t | max_out[], | ||
| size_t * | out_len ) |
Get info about a specific range in the IP Address Blocks extension from RFC 3779
| cert | the certificate to inspect |
| ipv6 | must be set to 1 if the family is an IPv6 family, 0 for IPv4 families |
| i | is the (local) index of the family, see botan_x509_ext_ip_addr_blocks_get_family |
| entry | is the index of the range |
| min_out | is set to the lower address of the range |
| max_out | is set to the upper address of the range |
| out_len | is set to the length of the addresses (4 for IPv4, 16 for IPv6) |
The output parameters min_out, max_out and out_len may be modified even if the extension is not present or some other error occurs. In this event, the value of each output parameter after the call returns is undefined.
Definition at line 142 of file ffi_cert_ext.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan::Cert_Extension::IPAddressBlocks::v4_count().
| int botan_x509_ext_ip_addr_blocks_get_counts | ( | botan_x509_cert_t | cert, |
| size_t * | v4_count, | ||
| size_t * | v6_count ) |
Get info about the IP Address Blocks extension from RFC 3779
| cert | the certificate to inspect |
| v4_count | is set to the number of v4 families contained in the extension |
| v6_count | is set to the number of v6 families |
If the extension is not present or an error occurs, v4_count and v6_count are not modified
Definition at line 73 of file ffi_cert_ext.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan::Cert_Extension::IPAddressBlocks::v4_count().
| int botan_x509_ext_ip_addr_blocks_get_family | ( | botan_x509_cert_t | cert, |
| int | ipv6, | ||
| size_t | i, | ||
| int * | has_safi, | ||
| uint8_t * | safi, | ||
| int * | present, | ||
| size_t * | count ) |
Get info about a specific family in the IP Address Blocks extension from RFC 3779
| cert | the certificate to inspect |
| ipv6 | must be set to 1 if the family is an IPv6 family, 0 for IPv4 families |
| i | is the (local) index for this family kind (the first v4 family is at i = 0, ipv6 = 0; the first v6 family is at i = 0, ipv6 = 1) |
| has_safi | will be set to 1 if the family has an associated SAFI |
| safi | will be set to the families' SAFI, if it has one, otherwise safi is not modified |
| present | is set to 1 if the family contains values (ranges), 0 if it is marked as "inherit" |
| count | is set to the number of values (ranges), if they were present, otherwise count is not modified |
The output parameters has_safi, safi, present and count may be modified even if the extension is not present or some other error occurs. In this event, the value of each output parameter after the call returns is undefined.
Definition at line 96 of file ffi_cert_ext.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), Botan::Cert_Extension::IPAddressBlocks::IPAddressFamily::safi(), and Botan::Cert_Extension::IPAddressBlocks::v4_count().
| int botan_x509_general_name_destroy | ( | botan_x509_general_name_t | alt_names | ) |
Frees all resources of the GeneralName object
| alt_names | the GeneralName to destroy |
Definition at line 779 of file ffi_cert.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_x509_general_name_get_type | ( | botan_x509_general_name_t | name, |
| unsigned int * | type ) |
Provides the contained type of the name and returns BOTAN_FFI_SUCCESS if that type is supported and may be retrieved via the view functions below. Otherwise BOTAN_FFI_ERROR_INVALID_OBJECT_STATE is returned.
Definition at line 709 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_INVALID_OBJECT_STATE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, BOTAN_X509_OTHER_NAME, and Botan::GeneralName::type_code().
| int botan_x509_general_name_view_binary_value | ( | botan_x509_general_name_t | name, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
Views the name as a bit string or returns BOTAN_FFI_ERROR_INVALID_OBJECT_STATE if the contained GeneralName value cannot be represented as a binary string.
The types BOTAN_X509_DIRECTORY_NAME, BOTAN_X509_IP_ADDRESS may be viewed as "binary".
Definition at line 757 of file ffi_cert.cpp.
References Botan::GeneralName::binary_name(), BOTAN_FFI_ERROR_INVALID_OBJECT_STATE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, BOTAN_X509_DIRECTORY_NAME, BOTAN_X509_IP_ADDRESS, Botan_FFI::invoke_view_callback(), and Botan::GeneralName::type_code().
| int botan_x509_general_name_view_string_value | ( | botan_x509_general_name_t | name, |
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
Views the name as a string or returns BOTAN_FFI_ERROR_INVALID_OBJECT_STATE if the contained GeneralName value cannot be represented as a string.
The types BOTAN_X509_EMAIL_ADDRESS, BOTAN_X509_DNS_NAME, BOTAN_X509_URI, BOTAN_X509_IP_ADDRESS may be viewed as "string".
Definition at line 734 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_INVALID_OBJECT_STATE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, BOTAN_X509_DNS_NAME, BOTAN_X509_EMAIL_ADDRESS, BOTAN_X509_IP_ADDRESS, BOTAN_X509_URI, Botan_FFI::invoke_view_callback(), Botan::GeneralName::name(), and Botan::GeneralName::type_code().
| int botan_x509_is_revoked | ( | botan_x509_crl_t | crl, |
| botan_x509_cert_t | cert ) |
Given a CRL and a certificate, check if the certificate is revoked on that particular CRL
Definition at line 1323 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::safe_get().
| int botan_xof_accepts_input | ( | botan_xof_t | xof | ) |
Get the input/output state of this eXtendable Output Function Typically, XOFs don't accept input as soon as the first output bytes were requested.
| eXtendable Output Function | the object to read |
Definition at line 61 of file ffi_xof.cpp.
References BOTAN_FFI_VISIT.
| int botan_xof_block_size | ( | botan_xof_t | xof, |
| size_t * | block_size ) |
Writes the block size of the eXtendable Output Function to *block_size
| eXtendable Output Function | XOF object |
| block_size | variable to hold the XOF's block size |
Definition at line 46 of file ffi_xof.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_xof_clear | ( | botan_xof_t | xof | ) |
Reinitializes the state of the eXtendable Output Function.
| eXtendable Output Function | XOF object |
Definition at line 65 of file ffi_xof.cpp.
References BOTAN_FFI_VISIT.
| int botan_xof_copy_state | ( | botan_xof_t * | dest, |
| botan_xof_t | source ) |
Copy the state of an eXtendable Output Function
| dest | destination XOF object |
| source | source XOF object |
Definition at line 39 of file ffi_xof.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::ffi_new_object().
| int botan_xof_destroy | ( | botan_xof_t | xof | ) |
Frees all resources of the eXtendable Output Function object
| eXtendable Output Function | xof object |
Definition at line 93 of file ffi_xof.cpp.
References BOTAN_FFI_CHECKED_DELETE.
| int botan_xof_init | ( | botan_xof_t * | xof, |
| const char * | xof_name, | ||
| uint32_t | flags ) |
Initialize an eXtendable Output Function
| eXtendable Output Function | XOF object |
| xof_name | name of the XOF, e.g., "SHAKE-128" |
| flags | should be 0 in current API revision, all other uses are reserved and return BOTAN_FFI_ERROR_BAD_FLAG |
Definition at line 19 of file ffi_xof.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::XOF::create(), Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_xof_name | ( | botan_xof_t | xof, |
| char * | name, | ||
| size_t * | name_len ) |
Get the name of this eXtendable Output Function
| eXtendable Output Function | the object to read |
| name | output buffer |
| name_len | on input, the length of buffer, on success the number of bytes written |
Definition at line 53 of file ffi_xof.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::write_str_output().
| int botan_xof_output | ( | botan_xof_t | xof, |
| uint8_t * | out, | ||
| size_t | out_len ) |
Generate output bytes from the eXtendable Output Function
| eXtendable Output Function | XOF object |
| out | output buffer |
| out_len | number of bytes to write into the output buffer |
Definition at line 81 of file ffi_xof.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_xof_update | ( | botan_xof_t | xof, |
| const uint8_t * | in, | ||
| size_t | in_len ) |
Send more input to the eXtendable Output Function
| eXtendable Output Function | XOF object |
| in | input buffer |
| in_len | number of bytes to read from the input buffer |
Definition at line 69 of file ffi_xof.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
| int botan_zfec_decode | ( | size_t | K, |
| size_t | N, | ||
| const size_t * | indexes, | ||
| uint8_t *const * | inputs, | ||
| size_t | shareSize, | ||
| uint8_t ** | outputs ) |
Decode some previously encoded shares using certain ZFEC parameters.
| K | the number of shares needed for recovery |
| N | the total number of shares |
| indexes | The index into the encoder's outputs for the corresponding element of the inputs array. Must be of length K. |
| inputs | K previously encoded shares to decode |
| shareSize | the length in bytes of each input |
| outputs | An out parameter pointing to a fully allocated array of size [K][shareSize]. For all k in range, a decoded block will written to the memory starting at outputs[k][0]. |
Definition at line 35 of file ffi_zfec.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan::ZFEC::decode_shares(), and Botan_FFI::ffi_guard_thunk().
| int botan_zfec_encode | ( | size_t | K, |
| size_t | N, | ||
| const uint8_t * | input, | ||
| size_t | size, | ||
| uint8_t ** | outputs ) |
ZFEC Encode some bytes with certain ZFEC parameters.
| K | the number of shares needed for recovery |
| N | the number of shares generated |
| input | the data to FEC |
| size | the length in bytes of input, which must be a multiple of K |
| outputs | An out parameter pointing to a fully allocated array of size [N][size / K]. For all n in range, an encoded block will be written to the memory starting at outputs[n][0]. |
Definition at line 18 of file ffi_zfec.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan::ZFEC::encode(), and Botan_FFI::ffi_guard_thunk().