Botan 2.19.3
Crypto and TLS for C&
|
#include <botan/build.h>
#include <stdint.h>
#include <stddef.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_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_PUBKEY_DER_FORMAT_SIGNATURE 1 |
Typedefs | |
typedef struct botan_block_cipher_struct * | botan_block_cipher_t |
typedef struct botan_cipher_struct * | botan_cipher_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_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_totp_struct * | botan_totp_t |
typedef struct botan_x509_cert_struct * | botan_x509_cert_t |
typedef struct botan_x509_crl_struct * | botan_x509_crl_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_keyspec (botan_cipher_t, 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_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, size_t *out_minimum_keylength, size_t *out_maximum_keylength) |
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) |
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) |
const char * | botan_error_description (int err) |
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, const 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_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_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, const botan_mp_t x, const botan_mp_t y) |
int | botan_mp_add_u32 (botan_mp_t result, const 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, const botan_mp_t x, const botan_mp_t y) |
int | botan_mp_destroy (botan_mp_t mp) |
int | botan_mp_div (botan_mp_t quotient, botan_mp_t remainder, const botan_mp_t x, const botan_mp_t y) |
int | botan_mp_equal (const botan_mp_t x, const botan_mp_t y) |
int | botan_mp_flip_sign (botan_mp_t mp) |
int | botan_mp_from_bin (const botan_mp_t mp, const uint8_t vec[], size_t vec_len) |
int | botan_mp_gcd (botan_mp_t out, const botan_mp_t x, const botan_mp_t y) |
int | botan_mp_get_bit (const botan_mp_t n, size_t bit) |
int | botan_mp_init (botan_mp_t *mp) |
int | botan_mp_is_even (const botan_mp_t mp) |
int | botan_mp_is_negative (const botan_mp_t mp) |
int | botan_mp_is_odd (const botan_mp_t mp) |
int | botan_mp_is_positive (const botan_mp_t mp) |
int | botan_mp_is_prime (const botan_mp_t n, botan_rng_t rng, size_t test_prob) |
int | botan_mp_is_zero (const botan_mp_t mp) |
int | botan_mp_lshift (botan_mp_t out, const botan_mp_t in, size_t shift) |
int | botan_mp_mod_inverse (botan_mp_t out, const botan_mp_t in, const botan_mp_t modulus) |
int | botan_mp_mod_mul (botan_mp_t result, const botan_mp_t x, const botan_mp_t y, const botan_mp_t mod) |
int | botan_mp_mul (botan_mp_t result, const botan_mp_t x, const botan_mp_t y) |
int | botan_mp_num_bits (const botan_mp_t n, size_t *bits) |
int | botan_mp_num_bytes (const botan_mp_t n, size_t *bytes) |
int | botan_mp_powmod (botan_mp_t out, const botan_mp_t base, const botan_mp_t exponent, const 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, const botan_mp_t lower_bound, const botan_mp_t upper_bound) |
int | botan_mp_rshift (botan_mp_t out, const 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, const 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, const botan_mp_t x, const botan_mp_t y) |
int | botan_mp_sub_u32 (botan_mp_t result, const botan_mp_t x, uint32_t y) |
int | botan_mp_swap (botan_mp_t x, botan_mp_t y) |
int | botan_mp_to_bin (const botan_mp_t mp, uint8_t vec[]) |
int | botan_mp_to_hex (const botan_mp_t mp, char *out) |
int | botan_mp_to_str (const botan_mp_t mp, uint8_t base, char *out, size_t *out_len) |
int | botan_mp_to_uint32 (const botan_mp_t mp, uint32_t *val) |
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_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_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_dsa (botan_privkey_t *key, botan_rng_t rng, size_t pbits, size_t qbits) |
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_elgamal (botan_privkey_t *key, botan_rng_t rng, size_t pbits, size_t qbits) |
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_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_dh (botan_privkey_t *key, botan_mp_t p, botan_mp_t g, botan_mp_t x) |
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, const botan_mp_t scalar, const char *curve_name) |
int | botan_privkey_load_ecdsa (botan_privkey_t *key, const 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_elgamal (botan_privkey_t *key, botan_mp_t p, botan_mp_t g, botan_mp_t x) |
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_sm2 (botan_privkey_t *key, const botan_mp_t scalar, const char *curve_name) |
int | botan_privkey_load_sm2_enc (botan_privkey_t *key, const 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_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_x25519_get_privkey (botan_privkey_t key, uint8_t output[32]) |
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_ed25519_get_pubkey (botan_pubkey_t key, uint8_t pubkey[32]) |
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_dh (botan_pubkey_t *key, botan_mp_t p, botan_mp_t g, botan_mp_t y) |
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, const botan_mp_t public_x, const botan_mp_t public_y, const char *curve_name) |
int | botan_pubkey_load_ecdsa (botan_pubkey_t *key, const botan_mp_t public_x, const botan_mp_t public_y, const char *curve_name) |
int | botan_pubkey_load_ed25519 (botan_pubkey_t *key, const uint8_t pubkey[32]) |
int | botan_pubkey_load_elgamal (botan_pubkey_t *key, botan_mp_t p, botan_mp_t g, botan_mp_t y) |
int | botan_pubkey_load_rsa (botan_pubkey_t *key, botan_mp_t n, botan_mp_t e) |
int | botan_pubkey_load_sm2 (botan_pubkey_t *key, const botan_mp_t public_x, const botan_mp_t public_y, const char *curve_name) |
int | botan_pubkey_load_sm2_enc (botan_pubkey_t *key, const botan_mp_t public_x, const botan_mp_t public_y, const char *curve_name) |
int | botan_pubkey_load_x25519 (botan_pubkey_t *key, const uint8_t pubkey[32]) |
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, const botan_pubkey_t key) |
int | botan_pubkey_x25519_get_pubkey (botan_pubkey_t key, uint8_t pubkey[32]) |
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_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_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_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) |
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_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_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_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_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_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_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_crl_destroy (botan_x509_crl_t crl) |
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_is_revoked (botan_x509_crl_t crl, botan_x509_cert_t cert) |
typedef struct botan_block_cipher_struct* botan_block_cipher_t |
typedef struct botan_cipher_struct* botan_cipher_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_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_totp_struct* botan_totp_t |
typedef struct botan_x509_cert_struct* botan_x509_cert_t |
typedef struct botan_x509_crl_struct* botan_x509_crl_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 62 of file ffi.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 1564 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 282 of file ffi.cpp.
References Botan::base64_decode(), Botan::base64_decode_max_output(), BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, 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
Definition at line 274 of file ffi.cpp.
References Botan::base64_encode(), 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 |
rng | 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$...
Definition at line 153 of file ffi_kdf.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, 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 |
hash | the stored hash to check against |
Definition at line 178 of file ffi_kdf.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_INVALID_VERIFIER, BOTAN_FFI_SUCCESS, Botan::check_bcrypt(), Botan_FFI::ffi_guard_thunk(), and hash.
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 62 of file ffi_block.cpp.
References BOTAN_FFI_RETURNING.
int botan_block_cipher_clear | ( | botan_block_cipher_t | bc | ) |
Reinitializes the block cipher
Definition at line 42 of file ffi_block.cpp.
References BOTAN_FFI_DO, and Botan::SymmetricAlgorithm::clear().
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 78 of file ffi_block.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NULL_POINTER, and Botan::BlockCipher::decrypt_n().
int botan_block_cipher_destroy | ( | botan_block_cipher_t | bc | ) |
Destroy a block cipher object
Destroy a block cipher object
Definition at line 37 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 68 of file ffi_block.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NULL_POINTER, and Botan::BlockCipher::encrypt_n().
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 97 of file ffi_block.cpp.
References BOTAN_FFI_DO, and Botan::SymmetricAlgorithm::minimum_keylength().
int botan_block_cipher_init | ( | botan_block_cipher_t * | bc, |
const char * | cipher_name | ||
) |
Initialize a block cipher object
Definition at line 17 of file ffi_block.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::BlockCipher::create(), and Botan_FFI::ffi_guard_thunk().
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 88 of file ffi_block.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NULL_POINTER, name, 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_DO, BOTAN_FFI_ERROR_NULL_POINTER, and Botan::SymmetricAlgorithm::set_key().
int botan_cipher_clear | ( | botan_cipher_t | hash | ) |
Reset the key, nonce, AD and all other state on this cipher object
Definition at line 39 of file ffi_cipher.cpp.
References BOTAN_FFI_DO, and Botan::SymmetricAlgorithm::clear().
int botan_cipher_destroy | ( | botan_cipher_t | cipher | ) |
Destroy the cipher object
Definition at line 34 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 212 of file ffi_cipher.cpp.
References BOTAN_FFI_DO, and Botan::Cipher_Mode::default_nonce_length().
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 67 of file ffi_cipher.cpp.
References BOTAN_FFI_DO, Botan::SymmetricAlgorithm::key_spec(), and Botan::Key_Length_Specification::minimum_keylength().
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 222 of file ffi_cipher.cpp.
References BOTAN_FFI_DO, and Botan::Cipher_Mode::tag_size().
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 217 of file ffi_cipher.cpp.
References BOTAN_FFI_DO, and Botan::Cipher_Mode::update_granularity().
int botan_cipher_init | ( | botan_cipher_t * | cipher, |
const char * | name, | ||
uint32_t | flags | ||
) |
Initialize a cipher object
Definition at line 21 of file ffi_cipher.cpp.
References BOTAN_CIPHER_INIT_FLAG_ENCRYPT, BOTAN_CIPHER_INIT_FLAG_MASK_DIRECTION, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, Botan::Cipher_Mode::create(), Botan::DECRYPTION, Botan::ENCRYPTION, and Botan_FFI::ffi_guard_thunk().
int botan_cipher_name | ( | botan_cipher_t | cipher, |
char * | name, | ||
size_t * | name_len | ||
) |
Return the name of the cipher object
Definition at line 227 of file ffi_cipher.cpp.
References BOTAN_FFI_DO, name, 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 49 of file ffi_cipher.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NULL_POINTER, and Botan::Cipher_Mode::output_length().
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 57 of file ffi_cipher.cpp.
References BOTAN_FFI_DO, and Botan::SymmetricAlgorithm::key_spec().
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 44 of file ffi_cipher.cpp.
References BOTAN_FFI_DO, and Botan::Cipher_Mode::reset().
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 191 of file ffi_cipher.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_RETURNING, and BOTAN_FFI_SUCCESS.
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 82 of file ffi_cipher.cpp.
References BOTAN_FFI_DO, and Botan::SymmetricAlgorithm::set_key().
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 88 of file ffi_cipher.cpp.
References BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), Botan::Cipher_Mode::start(), and Botan::Cipher_Mode::update_granularity().
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 some data
Definition at line 99 of file ffi_cipher.cpp.
References BOTAN_ASSERT, BOTAN_CIPHER_UPDATE_FLAG_FINAL, BOTAN_FFI_ERROR_BAD_MAC, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), Botan::Cipher_Mode::finish(), Botan::Cipher_Mode::minimum_final_size(), Botan_FFI::safe_get(), Botan::Cipher_Mode::update(), and Botan::Cipher_Mode::update_granularity().
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 205 of file ffi_cipher.cpp.
References BOTAN_FFI_RETURNING, and Botan::Cipher_Mode::valid_nonce_length().
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 241 of file ffi.cpp.
References Botan::constant_time_compare().
Referenced by botan_same_mem().
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 125 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_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_MEMORY, BOTAN_FFI_ERROR_SYSTEM_ERROR, BOTAN_FFI_ERROR_TLS_ERROR, BOTAN_FFI_ERROR_UNKNOWN_ERROR, BOTAN_FFI_INVALID_VERIFIER, and BOTAN_FFI_SUCCESS.
uint32_t botan_ffi_api_version | ( | void | ) |
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 201 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 | ||
) |
Definition at line 80 of file ffi_fpe.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_fpe_destroy | ( | botan_fpe_t | fpe | ) |
Definition at line 58 of file ffi_fpe.cpp.
References BOTAN_FFI_CHECKED_DELETE, and BOTAN_FFI_ERROR_NOT_IMPLEMENTED.
int botan_fpe_encrypt | ( | botan_fpe_t | fpe, |
botan_mp_t | x, | ||
const uint8_t | tweak[], | ||
size_t | tweak_len | ||
) |
Definition at line 67 of file ffi_fpe.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, 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 | ||
) |
Definition at line 26 of file ffi_fpe.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FPE_FLAG_FE1_COMPAT_MODE, Botan_FFI::ffi_guard_thunk(), 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
hash | hash object |
block_size | output buffer to hold the hash function output length |
Definition at line 46 of file ffi_hash.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NULL_POINTER, hash, and Botan::HashFunction::hash_block_size().
int botan_hash_clear | ( | botan_hash_t | hash | ) |
Reinitializes the state of the hash computation. A hash can be computed (with update/final) immediately.
hash | hash object |
Definition at line 53 of file ffi_hash.cpp.
References BOTAN_FFI_DO, Botan::HashFunction::clear(), and hash.
int botan_hash_copy_state | ( | botan_hash_t * | dest, |
const botan_hash_t | source | ||
) |
Copy the state of a hash function object
dest | destination hash object |
source | source hash object |
Definition at line 76 of file ffi_hash.cpp.
References BOTAN_FFI_DO.
int botan_hash_destroy | ( | botan_hash_t | hash | ) |
Frees all resources of the hash object
hash | hash object |
Definition at line 34 of file ffi_hash.cpp.
References BOTAN_FFI_CHECKED_DELETE, and hash.
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.
hash | hash object |
out | output buffer |
Definition at line 69 of file ffi_hash.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NULL_POINTER, Botan::Buffered_Computation::final(), and hash.
int botan_hash_init | ( | botan_hash_t * | hash, |
const char * | hash_name, | ||
uint32_t | flags | ||
) |
Initialize a hash function object
hash | 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 17 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 hash.
int botan_hash_name | ( | botan_hash_t | hash, |
char * | name, | ||
size_t * | name_len | ||
) |
Get the name of this hash function
hash | 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 82 of file ffi_hash.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NULL_POINTER, hash, name, 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
hash | hash object |
output_length | output buffer to hold the hash function output length |
Definition at line 39 of file ffi_hash.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NULL_POINTER, hash, and Botan::Buffered_Computation::output_length().
int botan_hash_update | ( | botan_hash_t | hash, |
const uint8_t * | in, | ||
size_t | in_len | ||
) |
Send more input to the hash function
hash | hash object |
in | input buffer |
in_len | number of bytes to read from the input buffer |
Definition at line 58 of file ffi_hash.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NULL_POINTER, hash, and Botan::Buffered_Computation::update().
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 out |
Definition at line 266 of file ffi.cpp.
References 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 257 of file ffi.cpp.
References 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 76 of file ffi_hotp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_INVALID_VERIFIER, BOTAN_FFI_RETURNING, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan::HOTP::verify_hotp().
int botan_hotp_destroy | ( | botan_hotp_t | hotp | ) |
Destroy a HOTP instance
Definition at line 48 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 58 of file ffi_hotp.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, and Botan::HOTP::generate_hotp().
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 24 of file ffi_hotp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and hash_algo.
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 129 of file ffi_kdf.cpp.
References BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), Botan::get_kdf(), and salt_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 | ||
) |
Definition at line 34 of file ffi_keywrap.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, Botan_FFI::ffi_guard_thunk(), Botan::rfc3394_keyunwrap(), and Botan_FFI::write_vec_output().
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 18 of file ffi_keywrap.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, Botan_FFI::ffi_guard_thunk(), Botan::rfc3394_keywrap(), and Botan_FFI::write_vec_output().
int botan_mac_clear | ( | botan_mac_t | mac | ) |
Reinitializes the state of the MAC computation. A MAC can be computed (with update/final) immediately.
mac | mac object |
Definition at line 49 of file ffi_mac.cpp.
References BOTAN_FFI_DO, and Botan::SymmetricAlgorithm::clear().
int botan_mac_destroy | ( | botan_mac_t | mac | ) |
Frees all resources of the MAC object
mac | mac object |
Definition at line 34 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.
mac | mac object |
out | output buffer |
Definition at line 59 of file ffi_mac.cpp.
References BOTAN_FFI_DO, and Botan::Buffered_Computation::final().
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
mac | 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 70 of file ffi_mac.cpp.
References BOTAN_FFI_DO, and Botan::SymmetricAlgorithm::minimum_keylength().
int botan_mac_init | ( | botan_mac_t * | mac, |
const char * | mac_name, | ||
uint32_t | flags | ||
) |
Initialize a message authentication code object
mac | 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 17 of file ffi_mac.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::MessageAuthenticationCode::create(), and Botan_FFI::ffi_guard_thunk().
int botan_mac_name | ( | botan_mac_t | mac, |
char * | name, | ||
size_t * | name_len | ||
) |
Get the name of this MAC
mac | 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 64 of file ffi_mac.cpp.
References BOTAN_FFI_DO, name, 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
mac | mac object |
output_length | output buffer to hold the MAC output length |
Definition at line 44 of file ffi_mac.cpp.
References BOTAN_FFI_DO, and Botan::Buffered_Computation::output_length().
int botan_mac_set_key | ( | botan_mac_t | mac, |
const uint8_t * | key, | ||
size_t | key_len | ||
) |
Sets the key on the MAC
mac | mac object |
key | buffer holding the key |
key_len | size of the key buffer in bytes |
Definition at line 39 of file ffi_mac.cpp.
References BOTAN_FFI_DO, and Botan::SymmetricAlgorithm::set_key().
int botan_mac_update | ( | botan_mac_t | mac, |
const uint8_t * | buf, | ||
size_t | len | ||
) |
Send more input to the message authentication code
mac | mac object |
buf | input buffer |
len | number of bytes to read from the input buffer |
Definition at line 54 of file ffi_mac.cpp.
References BOTAN_FFI_DO, and Botan::Buffered_Computation::update().
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 | ||
) |
Definition at line 934 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan_FFI::write_vec_output().
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 | ||
) |
Definition at line 956 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan_FFI::write_vec_output().
int botan_mp_add | ( | botan_mp_t | result, |
const botan_mp_t | x, | ||
const botan_mp_t | y | ||
) |
Definition at line 139 of file ffi_mp.cpp.
References BOTAN_FFI_DO, and Botan_FFI::safe_get().
int botan_mp_add_u32 | ( | botan_mp_t | result, |
const botan_mp_t | x, | ||
uint32_t | y | ||
) |
Definition at line 159 of file ffi_mp.cpp.
References BOTAN_FFI_DO, and Botan_FFI::safe_get().
int botan_mp_clear | ( | botan_mp_t | mp | ) |
Set the MPI to zero
Definition at line 31 of file ffi_mp.cpp.
References BOTAN_FFI_DO, and Botan::BigInt::clear().
int botan_mp_clear_bit | ( | botan_mp_t | n, |
size_t | bit | ||
) |
Clear the specified bit
Definition at line 297 of file ffi_mp.cpp.
References BOTAN_FFI_DO, and Botan::BigInt::clear_bit().
int botan_mp_cmp | ( | int * | result, |
const botan_mp_t | x, | ||
const botan_mp_t | y | ||
) |
Definition at line 220 of file ffi_mp.cpp.
References BOTAN_FFI_DO, Botan::BigInt::cmp(), and Botan_FFI::safe_get().
int botan_mp_destroy | ( | botan_mp_t | mp | ) |
Destroy (deallocate) an MPI
Definition at line 134 of file ffi_mp.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_mp_div | ( | botan_mp_t | quotient, |
botan_mp_t | remainder, | ||
const botan_mp_t | x, | ||
const botan_mp_t | y | ||
) |
Definition at line 189 of file ffi_mp.cpp.
References BOTAN_FFI_DO, Botan_FFI::safe_get(), and Botan::vartime_divide().
int botan_mp_equal | ( | const botan_mp_t | x, |
const botan_mp_t | y | ||
) |
Definition at line 200 of file ffi_mp.cpp.
References BOTAN_FFI_RETURNING, and Botan_FFI::safe_get().
int botan_mp_flip_sign | ( | botan_mp_t | mp | ) |
Definition at line 89 of file ffi_mp.cpp.
References BOTAN_FFI_DO, and Botan::BigInt::flip_sign().
int botan_mp_from_bin | ( | const botan_mp_t | mp, |
const uint8_t | vec[], | ||
size_t | vec_len | ||
) |
Definition at line 94 of file ffi_mp.cpp.
References Botan::BigInt::binary_decode(), and BOTAN_FFI_DO.
int botan_mp_gcd | ( | botan_mp_t | out, |
const botan_mp_t | x, | ||
const botan_mp_t | y | ||
) |
Definition at line 275 of file ffi_mp.cpp.
References BOTAN_FFI_DO, Botan::gcd(), and Botan_FFI::safe_get().
int botan_mp_get_bit | ( | const 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 287 of file ffi_mp.cpp.
References BOTAN_FFI_RETURNING.
int botan_mp_init | ( | botan_mp_t * | mp | ) |
Initialize an MPI
Definition at line 20 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and Botan_FFI::ffi_guard_thunk().
int botan_mp_is_even | ( | const botan_mp_t | mp | ) |
Definition at line 215 of file ffi_mp.cpp.
References BOTAN_FFI_RETURNING, and Botan::BigInt::is_even().
int botan_mp_is_negative | ( | const botan_mp_t | mp | ) |
Return 1 iff mp is less than 0
Definition at line 79 of file ffi_mp.cpp.
References BOTAN_FFI_DO, and Botan::BigInt::is_negative().
int botan_mp_is_odd | ( | const botan_mp_t | mp | ) |
Definition at line 210 of file ffi_mp.cpp.
References BOTAN_FFI_RETURNING, and Botan::BigInt::is_odd().
int botan_mp_is_positive | ( | const 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 84 of file ffi_mp.cpp.
References BOTAN_FFI_DO, and Botan::BigInt::is_positive().
int botan_mp_is_prime | ( | const 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 281 of file ffi_mp.cpp.
References BOTAN_FFI_RETURNING, Botan::is_prime(), and Botan_FFI::safe_get().
int botan_mp_is_zero | ( | const botan_mp_t | mp | ) |
Definition at line 205 of file ffi_mp.cpp.
References BOTAN_FFI_RETURNING, and Botan::BigInt::is_zero().
int botan_mp_lshift | ( | botan_mp_t | out, |
const botan_mp_t | in, | ||
size_t | shift | ||
) |
Definition at line 237 of file ffi_mp.cpp.
References BOTAN_FFI_DO, and Botan_FFI::safe_get().
int botan_mp_mod_inverse | ( | botan_mp_t | out, |
const botan_mp_t | in, | ||
const botan_mp_t | modulus | ||
) |
Definition at line 247 of file ffi_mp.cpp.
References BOTAN_FFI_DO, Botan::inverse_mod(), and Botan_FFI::safe_get().
int botan_mp_mod_mul | ( | botan_mp_t | result, |
const botan_mp_t | x, | ||
const botan_mp_t | y, | ||
const botan_mp_t | mod | ||
) |
Definition at line 252 of file ffi_mp.cpp.
References BOTAN_FFI_DO, Botan::Modular_Reducer::multiply(), and Botan_FFI::safe_get().
int botan_mp_mul | ( | botan_mp_t | result, |
const botan_mp_t | x, | ||
const botan_mp_t | y | ||
) |
Definition at line 179 of file ffi_mp.cpp.
References BOTAN_FFI_DO, and Botan_FFI::safe_get().
int botan_mp_num_bits | ( | const 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::BigInt::bits(), and BOTAN_FFI_DO.
int botan_mp_num_bytes | ( | const botan_mp_t | n, |
size_t * | bytes | ||
) |
Return the number of significant bytes in the MPI
Definition at line 307 of file ffi_mp.cpp.
References BOTAN_FFI_DO, and Botan::BigInt::bytes().
int botan_mp_powmod | ( | botan_mp_t | out, |
const botan_mp_t | base, | ||
const botan_mp_t | exponent, | ||
const botan_mp_t | modulus | ||
) |
Definition at line 231 of file ffi_mp.cpp.
References BOTAN_FFI_DO, 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 | ||
) |
Definition at line 260 of file ffi_mp.cpp.
References BOTAN_FFI_DO, Botan::RandomNumberGenerator::randomize(), and Botan_FFI::safe_get().
int botan_mp_rand_range | ( | botan_mp_t | rand_out, |
botan_rng_t | rng, | ||
const botan_mp_t | lower_bound, | ||
const botan_mp_t | upper_bound | ||
) |
Definition at line 266 of file ffi_mp.cpp.
References BOTAN_FFI_DO, Botan::BigInt::random_integer(), and Botan_FFI::safe_get().
int botan_mp_rshift | ( | botan_mp_t | out, |
const botan_mp_t | in, | ||
size_t | shift | ||
) |
Definition at line 242 of file ffi_mp.cpp.
References BOTAN_FFI_DO, and Botan_FFI::safe_get().
int botan_mp_set_bit | ( | botan_mp_t | n, |
size_t | bit | ||
) |
Set the specified bit
Definition at line 292 of file ffi_mp.cpp.
References BOTAN_FFI_DO, and Botan::BigInt::set_bit().
int botan_mp_set_from_int | ( | botan_mp_t | mp, |
int | initial_value | ||
) |
Set the MPI value from an int
Definition at line 36 of file ffi_mp.cpp.
References BOTAN_FFI_DO.
int botan_mp_set_from_mp | ( | botan_mp_t | dest, |
const botan_mp_t | source | ||
) |
Set the MPI value from another MP object
Definition at line 74 of file ffi_mp.cpp.
References BOTAN_FFI_DO, 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 56 of file ffi_mp.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, Botan::cast_char_ptr_to_uint8(), Botan::BigInt::Decimal, and Botan::BigInt::Hexadecimal.
int botan_mp_set_from_str | ( | botan_mp_t | dest, |
const char * | str | ||
) |
int botan_mp_sub | ( | botan_mp_t | result, |
const botan_mp_t | x, | ||
const botan_mp_t | y | ||
) |
Definition at line 149 of file ffi_mp.cpp.
References BOTAN_FFI_DO, and Botan_FFI::safe_get().
int botan_mp_sub_u32 | ( | botan_mp_t | result, |
const botan_mp_t | x, | ||
uint32_t | y | ||
) |
Definition at line 169 of file ffi_mp.cpp.
References BOTAN_FFI_DO, and Botan_FFI::safe_get().
int botan_mp_swap | ( | botan_mp_t | x, |
botan_mp_t | y | ||
) |
Definition at line 225 of file ffi_mp.cpp.
References BOTAN_FFI_DO, Botan_FFI::safe_get(), and Botan::BigInt::swap().
int botan_mp_to_bin | ( | const botan_mp_t | mp, |
uint8_t | vec[] | ||
) |
Definition at line 120 of file ffi_mp.cpp.
References Botan::BigInt::binary_encode(), and BOTAN_FFI_DO.
int botan_mp_to_hex | ( | const botan_mp_t | mp, |
char * | out | ||
) |
Convert the MPI to a hex string. Writes botan_mp_num_bytes(mp)*2 + 1 bytes
Definition at line 99 of file ffi_mp.cpp.
References BOTAN_FFI_DO, and Botan::BigInt::to_hex_string().
int botan_mp_to_str | ( | const botan_mp_t | mp, |
uint8_t | base, | ||
char * | out, | ||
size_t * | out_len | ||
) |
Convert the MPI to a string. Currently base == 10 and base == 16 are supported.
Definition at line 107 of file ffi_mp.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_RETURNING, and Botan_FFI::write_str_output().
int botan_mp_to_uint32 | ( | const botan_mp_t | mp, |
uint32_t * | val | ||
) |
Definition at line 125 of file ffi_mp.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NULL_POINTER, and Botan::BigInt::to_u32bit().
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 | ||
) |
Definition at line 22 of file ffi_kdf.cpp.
References botan_pwdhash(), and salt_len.
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 35 of file ffi_kdf.cpp.
References botan_pwdhash_timed(), and salt_len.
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 | ||
) |
Definition at line 100 of file ffi_pk_op.cpp.
References BOTAN_FFI_DO, 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 | ||
) |
Definition at line 68 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan::system_rng().
int botan_pk_op_decrypt_destroy | ( | botan_pk_op_decrypt_t | op | ) |
Definition at line 88 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 | ||
) |
Definition at line 93 of file ffi_pk_op.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NULL_POINTER, and Botan::PK_Decryptor::plaintext_length().
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 | ||
) |
Definition at line 55 of file ffi_pk_op.cpp.
References BOTAN_FFI_DO, 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 | ||
) |
Definition at line 23 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_PUBKEY_DER_FORMAT_SIGNATURE, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan::system_rng().
int botan_pk_op_encrypt_destroy | ( | botan_pk_op_encrypt_t | op | ) |
Definition at line 43 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 | ||
) |
Definition at line 48 of file ffi_pk_op.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NULL_POINTER, and Botan::PK_Encryptor::ciphertext_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 | ||
) |
Definition at line 244 of file ffi_pk_op.cpp.
References BOTAN_FFI_DO, Botan::PK_Key_Agreement::derive_key(), salt_len, 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 | ||
) |
Definition at line 201 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan::system_rng().
int botan_pk_op_key_agreement_destroy | ( | botan_pk_op_ka_t | op | ) |
Definition at line 220 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 | ||
) |
Definition at line 225 of file ffi_pk_op.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_BAD_FLAG, and Botan_FFI::write_vec_output().
int botan_pk_op_key_agreement_size | ( | botan_pk_op_ka_t | op, |
size_t * | out_len | ||
) |
Definition at line 235 of file ffi_pk_op.cpp.
References Botan::PK_Key_Agreement::agreed_value_size(), BOTAN_FFI_DO, and BOTAN_FFI_ERROR_NULL_POINTER.
int botan_pk_op_sign_create | ( | botan_pk_op_sign_t * | op, |
botan_privkey_t | key, | ||
const char * | hash_and_padding, | ||
uint32_t | flags | ||
) |
Definition at line 112 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_PUBKEY_DER_FORMAT_SIGNATURE, Botan::DER_SEQUENCE, Botan_FFI::ffi_guard_thunk(), hash, Botan::IEEE_1363, Botan_FFI::safe_get(), and Botan::system_rng().
int botan_pk_op_sign_destroy | ( | botan_pk_op_sign_t | op | ) |
Definition at line 134 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 | ||
) |
Definition at line 152 of file ffi_pk_op.cpp.
References BOTAN_FFI_DO, 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 | ||
) |
Definition at line 139 of file ffi_pk_op.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NULL_POINTER, and Botan::PK_Signer::signature_length().
int botan_pk_op_sign_update | ( | botan_pk_op_sign_t | op, |
const uint8_t | in[], | ||
size_t | in_len | ||
) |
Definition at line 147 of file ffi_pk_op.cpp.
References BOTAN_FFI_DO, and Botan::PK_Signer::update().
int botan_pk_op_verify_create | ( | botan_pk_op_verify_t * | op, |
botan_pubkey_t | key, | ||
const char * | hash_and_padding, | ||
uint32_t | flags | ||
) |
Definition at line 159 of file ffi_pk_op.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_PUBKEY_DER_FORMAT_SIGNATURE, Botan::DER_SEQUENCE, Botan_FFI::ffi_guard_thunk(), hash, Botan::IEEE_1363, and Botan_FFI::safe_get().
int botan_pk_op_verify_destroy | ( | botan_pk_op_verify_t | op | ) |
Definition at line 179 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 | ||
) |
Definition at line 189 of file ffi_pk_op.cpp.
References BOTAN_FFI_INVALID_VERIFIER, BOTAN_FFI_RETURNING, BOTAN_FFI_SUCCESS, and Botan::PK_Verifier::check_signature().
int botan_pk_op_verify_update | ( | botan_pk_op_verify_t | op, |
const uint8_t | in[], | ||
size_t | in_len | ||
) |
Definition at line 184 of file ffi_pk_op.cpp.
References BOTAN_FFI_DO, and Botan::PK_Verifier::update().
int botan_pkcs_hash_id | ( | const char * | hash_name, |
uint8_t | pkcs_id[], | ||
size_t * | pkcs_id_len | ||
) |
Definition at line 267 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, 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 | ||
) |
Definition at line 126 of file ffi_pkey.cpp.
References BOTAN_FFI_DO, and Botan_FFI::write_str_output().
int botan_privkey_check_key | ( | botan_privkey_t | key, |
botan_rng_t | rng, | ||
uint32_t | flags | ||
) |
Definition at line 145 of file ffi_pkey.cpp.
References BOTAN_CHECK_KEY_EXPENSIVE_TESTS, BOTAN_FFI_ERROR_INVALID_INPUT, BOTAN_FFI_RETURNING, 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. |
rng | a random number generator |
Definition at line 26 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::create_private_key(), Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
Referenced by 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 | ||
) |
Definition at line 580 of file ffi_pkey_algs.cpp.
References botan_privkey_create().
int botan_privkey_create_dsa | ( | botan_privkey_t * | key, |
botan_rng_t | rng, | ||
size_t | pbits, | ||
size_t | qbits | ||
) |
Generates DSA key pair. Gives to a caller control over key length and order of a subgroup 'q'.
key | handler to the resulting key |
rng | 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 |
Definition at line 383 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_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan::DL_Group::Prime_Subgroup, and Botan_FFI::safe_get().
int botan_privkey_create_ecdh | ( | botan_privkey_t * | key, |
botan_rng_t | rng, | ||
const char * | params | ||
) |
Definition at line 620 of file ffi_pkey_algs.cpp.
References 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 | ||
) |
Definition at line 468 of file ffi_pkey_algs.cpp.
References botan_privkey_create().
int botan_privkey_create_elgamal | ( | 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 |
rng | initialized PRNG |
pbits | length of the key in bits. Must be at least 1024 |
qbits | order of the subgroup. Must be at least 160 |
Definition at line 515 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_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan::DL_Group::Prime_Subgroup, Botan_FFI::safe_get(), and Botan::DL_Group::Strong.
int botan_privkey_create_mceliece | ( | botan_privkey_t * | key, |
botan_rng_t | rng, | ||
size_t | n, | ||
size_t | t | ||
) |
Definition at line 928 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 | ||
) |
Definition at line 258 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, and botan_privkey_create().
int botan_privkey_destroy | ( | botan_privkey_t | key | ) |
Definition at line 88 of file ffi_pkey.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_privkey_dsa_get_x | ( | botan_mp_t | n, |
botan_privkey_t | key | ||
) |
Definition at line 443 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] | ||
) |
Definition at line 798 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan::copy_mem().
int botan_privkey_export | ( | botan_privkey_t | key, |
uint8_t | out[], | ||
size_t * | out_len, | ||
uint32_t | flags | ||
) |
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.
Definition at line 165 of file ffi_pkey.cpp.
References Botan::PKCS8::BER_encode(), BOTAN_FFI_DO, BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_PRIVKEY_EXPORT_FLAG_DER, BOTAN_PRIVKEY_EXPORT_FLAG_PEM, Botan::PKCS8::PEM_encode(), Botan_FFI::write_str_output(), and Botan_FFI::write_vec_output().
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 | ||
) |
Set encryption_algo to NULL or "" to have the library choose a default (recommended)
Definition at line 177 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 using the specified number of iterations.
Definition at line 221 of file ffi_pkey.cpp.
References Botan::PKCS8::BER_encode_encrypted_pbkdf_iter(), BOTAN_FFI_DO, BOTAN_PRIVKEY_EXPORT_FLAG_DER, BOTAN_PRIVKEY_EXPORT_FLAG_PEM, Botan::PKCS8::PEM_encode_encrypted_pbkdf_iter(), Botan_FFI::safe_get(), Botan_FFI::write_str_output(), and Botan_FFI::write_vec_output().
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 | ||
) |
Definition at line 187 of file ffi_pkey.cpp.
References Botan::PKCS8::BER_encode_encrypted_pbkdf_msec(), BOTAN_FFI_DO, BOTAN_PRIVKEY_EXPORT_FLAG_DER, BOTAN_PRIVKEY_EXPORT_FLAG_PEM, Botan::PKCS8::PEM_encode_encrypted_pbkdf_msec(), Botan_FFI::safe_get(), Botan_FFI::write_str_output(), and Botan_FFI::write_vec_output().
int botan_privkey_export_pubkey | ( | botan_pubkey_t * | out, |
botan_privkey_t | in | ||
) |
Definition at line 115 of file ffi_pkey.cpp.
References Botan::X509::BER_encode(), BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), Botan::X509::load_key(), and Botan_FFI::safe_get().
int botan_privkey_get_field | ( | botan_mp_t | output, |
botan_privkey_t | key, | ||
const char * | field_name | ||
) |
Definition at line 242 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NULL_POINTER, 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 | ||
) |
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 57 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_UNKNOWN_ERROR, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan::PKCS8::load_key().
int botan_privkey_load_dh | ( | botan_privkey_t * | key, |
botan_mp_t | p, | ||
botan_mp_t | g, | ||
botan_mp_t | x | ||
) |
Definition at line 585 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
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 | ||
) |
Definition at line 408 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_privkey_load_ecdh | ( | botan_privkey_t * | key, |
const botan_mp_t | scalar, | ||
const char * | curve_name | ||
) |
Definition at line 653 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_privkey_load_ecdsa | ( | botan_privkey_t * | key, |
const botan_mp_t | scalar, | ||
const char * | curve_name | ||
) |
Definition at line 496 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_privkey_load_ed25519 | ( | botan_privkey_t * | key, |
const uint8_t | privkey[32] | ||
) |
Definition at line 766 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_privkey_load_elgamal | ( | botan_privkey_t * | key, |
botan_mp_t | p, | ||
botan_mp_t | g, | ||
botan_mp_t | x | ||
) |
Loads ElGamal private key
key | variable populated with key material |
p | prime order of a Z_p group |
g | group generator |
x | private key |
Definition at line 561 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_privkey_load_rsa | ( | botan_privkey_t * | key, |
botan_mp_t | p, | ||
botan_mp_t | q, | ||
botan_mp_t | e | ||
) |
Definition at line 268 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_privkey_load_rsa_pkcs1 | ( | botan_privkey_t * | key, |
const uint8_t | bits[], | ||
size_t | len | ||
) |
Definition at line 286 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan::AlgorithmIdentifier::USE_NULL_PARAM.
int botan_privkey_load_sm2 | ( | botan_privkey_t * | key, |
const botan_mp_t | scalar, | ||
const char * | curve_name | ||
) |
Definition at line 730 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
Referenced by botan_privkey_load_sm2_enc().
int botan_privkey_load_sm2_enc | ( | botan_privkey_t * | key, |
const botan_mp_t | scalar, | ||
const char * | curve_name | ||
) |
Definition at line 757 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] | ||
) |
Definition at line 848 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_privkey_rsa_get_d | ( | botan_mp_t | d, |
botan_privkey_t | rsa_key | ||
) |
Definition at line 340 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 | ||
) |
Definition at line 335 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 | ||
) |
Definition at line 330 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 | ||
) |
Definition at line 320 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 | ||
) |
Definition at line 355 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, 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 | ||
) |
Definition at line 325 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
int botan_privkey_x25519_get_privkey | ( | botan_privkey_t | key, |
uint8_t | output[32] | ||
) |
Definition at line 880 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan::copy_mem().
int botan_pubkey_algo_name | ( | botan_pubkey_t | key, |
char | out[], | ||
size_t * | out_len | ||
) |
Definition at line 131 of file ffi_pkey.cpp.
References BOTAN_FFI_DO, 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 136 of file ffi_pkey.cpp.
References BOTAN_CHECK_KEY_EXPENSIVE_TESTS, BOTAN_FFI_ERROR_INVALID_INPUT, BOTAN_FFI_RETURNING, and Botan_FFI::safe_get().
int botan_pubkey_destroy | ( | botan_pubkey_t | key | ) |
Definition at line 110 of file ffi_pkey.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_pubkey_dsa_get_g | ( | botan_mp_t | d, |
botan_pubkey_t | key | ||
) |
Definition at line 458 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 | ||
) |
Definition at line 448 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 | ||
) |
Definition at line 453 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 | ||
) |
Definition at line 463 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
int botan_pubkey_ed25519_get_pubkey | ( | botan_pubkey_t | key, |
uint8_t | pubkey[32] | ||
) |
Definition at line 822 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan::copy_mem().
int botan_pubkey_estimated_strength | ( | botan_pubkey_t | key, |
size_t * | estimate | ||
) |
Definition at line 253 of file ffi_pkey.cpp.
References BOTAN_FFI_DO, and Botan::Public_Key::estimated_strength().
int botan_pubkey_export | ( | botan_pubkey_t | key, |
uint8_t | out[], | ||
size_t * | out_len, | ||
uint32_t | flags | ||
) |
Definition at line 153 of file ffi_pkey.cpp.
References Botan::X509::BER_encode(), BOTAN_FFI_DO, BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_PRIVKEY_EXPORT_FLAG_DER, BOTAN_PRIVKEY_EXPORT_FLAG_PEM, Botan::X509::PEM_encode(), Botan_FFI::write_str_output(), and Botan_FFI::write_vec_output().
int botan_pubkey_fingerprint | ( | botan_pubkey_t | key, |
const char * | hash, | ||
uint8_t | out[], | ||
size_t * | out_len | ||
) |
Definition at line 258 of file ffi_pkey.cpp.
References BOTAN_FFI_DO, Botan::HashFunction::create(), and Botan_FFI::write_vec_output().
int botan_pubkey_get_field | ( | botan_mp_t | output, |
botan_pubkey_t | key, | ||
const char * | field_name | ||
) |
Definition at line 228 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NULL_POINTER, 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 | ||
) |
Definition at line 93 of file ffi_pkey.cpp.
References BOTAN_FFI_ERROR_UNKNOWN_ERROR, BOTAN_FFI_SUCCESS, Botan_FFI::ffi_guard_thunk(), and Botan::X509::load_key().
int botan_pubkey_load_dh | ( | botan_pubkey_t * | key, |
botan_mp_t | p, | ||
botan_mp_t | g, | ||
botan_mp_t | y | ||
) |
Loads Diffie Hellman public key
key | variable populated with key material |
p | prime order of a Z_p group |
g | group generator |
y | public key |
Definition at line 602 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
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 | ||
) |
Definition at line 426 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_pubkey_load_ecdh | ( | botan_pubkey_t * | key, |
const botan_mp_t | public_x, | ||
const botan_mp_t | public_y, | ||
const char * | curve_name | ||
) |
Definition at line 633 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_pubkey_load_ecdsa | ( | botan_pubkey_t * | key, |
const botan_mp_t | public_x, | ||
const botan_mp_t | public_y, | ||
const char * | curve_name | ||
) |
Definition at line 475 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_pubkey_load_ed25519 | ( | botan_pubkey_t * | key, |
const uint8_t | pubkey[32] | ||
) |
Definition at line 782 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_pubkey_load_elgamal | ( | botan_pubkey_t * | key, |
botan_mp_t | p, | ||
botan_mp_t | g, | ||
botan_mp_t | y | ||
) |
Loads ElGamal public key
key | variable populated with key material |
p | prime order of a Z_p group |
g | group generator |
y | public key |
Definition at line 545 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_pubkey_load_rsa | ( | botan_pubkey_t * | key, |
botan_mp_t | n, | ||
botan_mp_t | e | ||
) |
Definition at line 305 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
int botan_pubkey_load_sm2 | ( | botan_pubkey_t * | key, |
const botan_mp_t | public_x, | ||
const botan_mp_t | public_y, | ||
const char * | curve_name | ||
) |
Definition at line 709 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_UNKNOWN_ERROR, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::safe_get().
Referenced by botan_pubkey_load_sm2_enc().
int botan_pubkey_load_sm2_enc | ( | botan_pubkey_t * | key, |
const botan_mp_t | public_x, | ||
const botan_mp_t | public_y, | ||
const char * | curve_name | ||
) |
Definition at line 749 of file ffi_pkey_algs.cpp.
References botan_pubkey_load_sm2().
int botan_pubkey_load_x25519 | ( | botan_pubkey_t * | key, |
const uint8_t | pubkey[32] | ||
) |
Definition at line 864 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_pubkey_rsa_get_e | ( | botan_mp_t | e, |
botan_pubkey_t | rsa_key | ||
) |
Definition at line 345 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 | ||
) |
Definition at line 350 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, | ||
const botan_pubkey_t | key | ||
) |
Definition at line 673 of file ffi_pkey_algs.cpp.
References Botan::Public_Key::algo_name(), 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(), hash, hash_algo, Botan::EC_PublicKey::public_point(), Botan_FFI::safe_get(), Botan::sm2_compute_za(), and Botan_FFI::write_vec_output().
int botan_pubkey_x25519_get_pubkey | ( | botan_pubkey_t | key, |
uint8_t | pubkey[32] | ||
) |
Definition at line 904 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, 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 | ||
) |
Definition at line 52 of file ffi_kdf.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::PasswordHashFamily::create(), Botan_FFI::ffi_guard_thunk(), and salt_len.
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 | ||
) |
Definition at line 86 of file ffi_kdf.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::PasswordHashFamily::create(), Botan_FFI::ffi_guard_thunk(), and salt_len.
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
rng | rng object |
entropy | the data to add |
entropy_len | length of entropy buffer |
Definition at line 173 of file ffi_rng.cpp.
References Botan::RandomNumberGenerator::add_entropy(), and BOTAN_FFI_DO.
int botan_rng_destroy | ( | botan_rng_t | rng | ) |
Frees all resources of the random number generator object
rng | rng object |
Definition at line 158 of file ffi_rng.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_rng_get | ( | botan_rng_t | rng, |
uint8_t * | out, | ||
size_t | out_len | ||
) |
Get random bytes from a random number generator
rng | rng object |
out | output buffer of size out_len |
out_len | number of requested bytes |
Definition at line 163 of file ffi_rng.cpp.
References BOTAN_FFI_DO, and Botan::RandomNumberGenerator::randomize().
int botan_rng_init | ( | botan_rng_t * | rng, |
const char * | rng_type | ||
) |
Initialize a random number generator object
rng | rng object |
rng_type | type of the rng, possible values: "system": system RNG "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 24 of file ffi_rng.cpp.
References Botan::Processor_RNG::available(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and Botan_FFI::ffi_guard_thunk().
int botan_rng_init_custom | ( | botan_rng_t * | rng_out, |
const char * | rng_name, | ||
void * | context, | ||
int(*)(void *context, uint8_t *out, size_t out_len) | get_cb, | ||
int(*)(void *context, const uint8_t input[], size_t length) | add_entropy_cb, | ||
void(*)(void *context) | destroy_cb | ||
) |
Initialize a custom random number generator from a set of callback functions
rng_out | rng object that will be created |
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 63 of file ffi_rng.cpp.
References Botan::RandomNumberGenerator::accepts_input(), Botan::RandomNumberGenerator::add_entropy(), BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::RandomNumberGenerator::clear(), Botan_FFI::ffi_guard_thunk(), Botan::RandomNumberGenerator::is_seeded(), name, Botan::RandomNumberGenerator::name(), and Botan::RandomNumberGenerator::randomize().
int botan_rng_reseed | ( | botan_rng_t | rng, |
size_t | bits | ||
) |
Reseed a random number generator Uses the System_RNG as a seed generator.
rng | rng object |
bits | number of bits to to reseed with |
Definition at line 168 of file ffi_rng.cpp.
References BOTAN_FFI_DO, Botan::RandomNumberGenerator::reseed_from_rng(), 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
rng | rng object |
source_rng | the rng that will be read from |
bits | number of bits to to reseed with |
Definition at line 178 of file ffi_rng.cpp.
References BOTAN_FFI_DO, Botan::RandomNumberGenerator::reseed_from_rng(), 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 246 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 251 of file ffi.cpp.
References 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 142 of file ffi_kdf.cpp.
References botan_pwdhash(), and salt_len.
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 77 of file ffi_totp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_INVALID_VERIFIER, BOTAN_FFI_RETURNING, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan::TOTP::verify_totp().
int botan_totp_destroy | ( | botan_totp_t | totp | ) |
Destroy a TOTP instance
Definition at line 49 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 59 of file ffi_totp.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, and Botan::TOTP::generate_totp().
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 24 of file ffi_totp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and hash_algo.
uint32_t botan_version_datestamp | ( | void | ) |
Return the date this version was released as an integer, or 0 if an unreleased version
Definition at line 239 of file ffi.cpp.
References Botan::version_datestamp().
uint32_t botan_version_major | ( | void | ) |
Return the major version of the library
Definition at line 236 of file ffi.cpp.
References Botan::version_major().
uint32_t botan_version_minor | ( | void | ) |
Return the minor version of the library
Definition at line 237 of file ffi.cpp.
References Botan::version_minor().
uint32_t botan_version_patch | ( | void | ) |
Return the patch version of the library
Definition at line 238 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 231 of file ffi.cpp.
References Botan::version_cstr().
int botan_x509_cert_allowed_usage | ( | botan_x509_cert_t | cert, |
unsigned int | key_usage | ||
) |
Definition at line 136 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_RETURNING, BOTAN_FFI_SUCCESS, and BOTAN_UNUSED.
int botan_x509_cert_destroy | ( | botan_x509_cert_t | cert | ) |
Definition at line 151 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 | ||
) |
Definition at line 46 of file ffi_cert.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_x509_cert_get_authority_key_id | ( | botan_x509_cert_t | cert, |
uint8_t | out[], | ||
size_t * | out_len | ||
) |
Definition at line 225 of file ffi_cert.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, 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 | ||
) |
Definition at line 215 of file ffi_cert.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, hash, 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 | ||
) |
Definition at line 102 of file ffi_cert.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, and Botan_FFI::write_str_output().
int botan_x509_cert_get_public_key | ( | botan_x509_cert_t | cert, |
botan_pubkey_t * | key | ||
) |
Definition at line 83 of file ffi_cert.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_x509_cert_get_public_key_bits | ( | botan_x509_cert_t | cert, |
uint8_t | out[], | ||
size_t * | out_len | ||
) |
Definition at line 245 of file ffi_cert.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, and Botan_FFI::write_vec_output().
int botan_x509_cert_get_serial_number | ( | botan_x509_cert_t | cert, |
uint8_t | out[], | ||
size_t * | out_len | ||
) |
Definition at line 205 of file ffi_cert.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, 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 | ||
) |
Definition at line 114 of file ffi_cert.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, and Botan_FFI::write_str_output().
int botan_x509_cert_get_subject_key_id | ( | botan_x509_cert_t | cert, |
uint8_t | out[], | ||
size_t * | out_len | ||
) |
Definition at line 235 of file ffi_cert.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, 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 | ||
) |
Definition at line 171 of file ffi_cert.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, 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 | ||
) |
Definition at line 161 of file ffi_cert.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, 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 255 of file ffi_cert.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, and Botan::X509_Certificate::matches_dns_name().
int botan_x509_cert_load | ( | botan_x509_cert_t * | cert_obj, |
const uint8_t | cert[], | ||
size_t | cert_len | ||
) |
Definition at line 65 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_x509_cert_load_file | ( | botan_x509_cert_t * | cert_obj, |
const char * | filename | ||
) |
Definition at line 28 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and Botan_FFI::ffi_guard_thunk().
int botan_x509_cert_not_after | ( | botan_x509_cert_t | cert, |
uint64_t * | time_since_epoch | ||
) |
Definition at line 193 of file ffi_cert.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, and Botan::X509_Certificate::not_after().
int botan_x509_cert_not_before | ( | botan_x509_cert_t | cert, |
uint64_t * | time_since_epoch | ||
) |
Definition at line 181 of file ffi_cert.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, and Botan::X509_Certificate::not_before().
int botan_x509_cert_to_string | ( | botan_x509_cert_t | cert, |
char | out[], | ||
size_t * | out_len | ||
) |
Definition at line 126 of file ffi_cert.cpp.
References BOTAN_FFI_DO, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, and Botan_FFI::write_str_output().
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 340 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 269 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, 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 418 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), Botan::UNSPECIFIED, and Botan::x509_path_validate().
int botan_x509_crl_destroy | ( | botan_x509_crl_t | crl | ) |
Definition at line 395 of file ffi_cert.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
int botan_x509_crl_load | ( | botan_x509_crl_t * | crl_obj, |
const uint8_t | crl_bits[], | ||
size_t | crl_bits_len | ||
) |
Definition at line 377 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().
int botan_x509_crl_load_file | ( | botan_x509_crl_t * | crl_obj, |
const char * | crl_path | ||
) |
Definition at line 359 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and Botan_FFI::ffi_guard_thunk().
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 405 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_RETURNING, BOTAN_UNUSED, Botan::X509_CRL::is_revoked(), and Botan_FFI::safe_get().