|
Botan 3.13.0
Crypto and TLS for C&
|
#include <botan/ffi.h>#include <botan/assert.h>#include <botan/ec_group.h>#include <botan/hash.h>#include <botan/mem_ops.h>#include <botan/pem.h>#include <botan/internal/ffi_ec.h>#include <botan/internal/ffi_mp.h>#include <botan/internal/ffi_pkey.h>#include <botan/internal/ffi_rng.h>#include <botan/internal/ffi_util.h>Go to the source code of this file.
| int botan_ec_privkey_get_group | ( | botan_privkey_t | key, |
| botan_ec_group_t * | ec_group ) |
Get the group of an elliptic curve private key
| key | the EC private key |
| EC Group | the new object will be placed here |
Definition at line 859 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan::EC_PublicKey::domain(), Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_ec_privkey_get_private_key | ( | botan_privkey_t | key, |
| botan_ec_scalar_t * | value ) |
Loads Diffie Hellman private key
| key | variable populated with key material |
| p | prime order of a Z_p group |
| g | group generator |
| x | private key |
| key | variable populated with key material |
| p | prime order of a Z_p group |
| g | group generator |
| y | public key |
/* Algorithm specific key operations: ElGamal Loads ElGamal public key
| key | variable populated with key material |
| p | prime order of a Z_p group |
| g | group generator |
| y | public key |
/** Loads ElGamal private key
| key | variable populated with key material |
| p | prime order of a Z_p group |
| g | group generator |
| x | private key |
/* Algorithm specific key operations: EC keys Get the secret scalar of an elliptic curve private key
| key | the EC private key |
| value | the new object will be placed here |
Definition at line 841 of file ffi_pkey_algs.cpp.
References Botan::EC_PrivateKey::_private_key(), Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_ec_pubkey_get_group | ( | botan_pubkey_t | key, |
| botan_ec_group_t * | ec_group ) |
Get the group of an elliptic curve public key
| key | the EC public key |
| EC Group | the new object will be placed here |
Definition at line 878 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan::EC_PublicKey::domain(), Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_mceies_decrypt | ( | botan_privkey_t | mce_key, |
| const char * | aead, | ||
| const uint8_t | ct[], | ||
| size_t | ct_len, | ||
| const uint8_t | ad[], | ||
| size_t | ad_len, | ||
| uint8_t | pt[], | ||
| size_t * | pt_len ) |
Formerly decrypted a message using McEliece with an AEAD.
Always returns BOTAN_FFI_ERROR_NOT_IMPLEMENTED
| mce_key | ignored |
| AEAD Modes | ignored |
| ct | ignored |
| ct_len | ignored |
| ad | ignored |
| ad_len | ignored |
| pt | ignored |
| pt_len | ignored |
Definition at line 1564 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_mceies_encrypt | ( | botan_pubkey_t | mce_key, |
| botan_rng_t | rng, | ||
| const char * | aead, | ||
| const uint8_t | pt[], | ||
| size_t | pt_len, | ||
| const uint8_t | ad[], | ||
| size_t | ad_len, | ||
| uint8_t | ct[], | ||
| size_t * | ct_len ) |
Formerly encrypted a message using McEliece with an AEAD.
Always returns BOTAN_FFI_ERROR_NOT_IMPLEMENTED
| mce_key | ignored |
| Random Number Generators | ignored |
| AEAD Modes | ignored |
| pt | ignored |
| pt_len | ignored |
| ad | ignored |
| ad_len | ignored |
| ct | ignored |
| ct_len | ignored |
Definition at line 1576 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_privkey_create_dh | ( | botan_privkey_t * | key, |
| botan_rng_t | rng, | ||
| const char * | param ) |
Create a new Diffie-Hellman private key
| key | the new object will be placed here |
| Random Number Generators | a random number generator |
| param | the name of the group, eg "modp/ietf/2048" |
Definition at line 598 of file ffi_pkey_algs.cpp.
References botan_privkey_create().
| int botan_privkey_create_dsa | ( | botan_privkey_t * | key, |
| botan_rng_t | rng_obj, | ||
| size_t | pbits, | ||
| size_t | qbits ) |
Definition at line 360 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan::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 ) |
Create a new ECDH private key
| key | the new object will be placed here |
| Random Number Generators | a random number generator |
| params | the name of the curve, eg "secp256r1" |
Definition at line 638 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NULL_POINTER, and botan_privkey_create().
| int botan_privkey_create_ecdsa | ( | botan_privkey_t * | key, |
| botan_rng_t | rng, | ||
| const char * | params ) |
Create a new ECDSA private key
| key | the new object will be placed here |
| Random Number Generators | a random number generator |
| params | the name of the curve, eg "secp256r1" |
Definition at line 439 of file ffi_pkey_algs.cpp.
References botan_privkey_create().
| int botan_privkey_create_elgamal | ( | botan_privkey_t * | key, |
| botan_rng_t | rng_obj, | ||
| size_t | pbits, | ||
| size_t | qbits ) |
Definition at line 536 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan::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 ) |
Create a new McEliece private key
| key | the new object will be placed here |
| Random Number Generators | a random number generator |
| n | the code length |
| t | the error correction capability |
Definition at line 1559 of file ffi_pkey_algs.cpp.
References botan_privkey_create().
| int botan_privkey_create_rsa | ( | botan_privkey_t * | key, |
| botan_rng_t | rng, | ||
| size_t | n_bits ) |
Create a new RSA private key
| key | the new object will be placed here |
| Random Number Generators | a random number generator |
| n_bits | the bit length of the modulus |
Definition at line 228 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, and botan_privkey_create().
| int botan_privkey_dsa_get_x | ( | botan_mp_t | n, |
| botan_privkey_t | key ) |
Get the secret value of a DSA private key
| n | set to the value of the private key |
| key | the DSA private key |
Definition at line 419 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
| int botan_privkey_ed25519_get_privkey | ( | botan_privkey_t | key, |
| uint8_t | output[64] ) |
Get the raw encoding of an Ed25519 private key, followed by the public key
| key | the Ed25519 private key |
| output | set to the 64 byte concatenation of the private and public keys |
Definition at line 932 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
| int botan_privkey_ed448_get_privkey | ( | botan_privkey_t | key, |
| uint8_t | output[57] ) |
Get the raw 57 byte encoding of an Ed448 private key
| key | the Ed448 private key |
| output | set to the raw private key |
Definition at line 1012 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
| int botan_privkey_get_field | ( | botan_mp_t | output, |
| botan_privkey_t | key, | ||
| const char * | field_name ) |
Get an arbitrary named field from a private key, eg "p" or "q" for RSA
| output | set to the value of the requested field |
| key | the private key to query |
| field_name | the name of the field to retrieve |
Definition at line 216 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
Referenced by botan_privkey_dsa_get_x(), botan_privkey_rsa_get_d(), botan_privkey_rsa_get_e(), botan_privkey_rsa_get_n(), botan_privkey_rsa_get_p(), and botan_privkey_rsa_get_q().
| int botan_privkey_load_classic_mceliece | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[], | ||
| size_t | key_len, | ||
| const char * | cmce_mode ) |
Load a Classic McEliece private key from its raw encoding
| key | the new object will be placed here |
| privkey | the raw private key |
| key_len | length of privkey in bytes |
| cmce_mode | the parameter set, eg "348864" |
Definition at line 1497 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::Classic_McEliece_Parameter_Set::from_string().
| int botan_privkey_load_dh | ( | botan_privkey_t * | key, |
| botan_mp_t | p, | ||
| botan_mp_t | g, | ||
| botan_mp_t | x ) |
Definition at line 602 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_privkey_load_dsa | ( | botan_privkey_t * | key, |
| botan_mp_t | p, | ||
| botan_mp_t | q, | ||
| botan_mp_t | g, | ||
| botan_mp_t | x ) |
Load a DSA private key from its group parameters and secret value
| key | the new object will be placed here |
| p | the group prime |
| q | the order of the subgroup |
| g | the subgroup generator |
| x | the private key |
Definition at line 383 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_privkey_load_ecdh | ( | botan_privkey_t * | key, |
| botan_mp_t | scalar, | ||
| const char * | curve_name ) |
Load an ECDH private key from its secret scalar
| key | the new object will be placed here |
| scalar | the private scalar |
| curve_name | the name of the curve, eg "secp256r1" |
Definition at line 704 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_privkey_load_ecdsa | ( | botan_privkey_t * | key, |
| botan_mp_t | scalar, | ||
| const char * | curve_name ) |
Load an ECDSA private key from its secret scalar
| key | the new object will be placed here |
| scalar | the private scalar |
| curve_name | the name of the curve, eg "secp256r1" |
Definition at line 514 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_privkey_load_ed25519 | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[32] ) |
Load an Ed25519 private key from its raw 32 byte encoding
| key | the new object will be placed here |
| privkey | the raw private key |
Definition at line 898 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::Ed25519_PrivateKey::from_seed().
| int botan_privkey_load_ed448 | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[57] ) |
Load an Ed448 private key from its raw 57 byte encoding
| key | the new object will be placed here |
| privkey | the raw private key |
Definition at line 980 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_privkey_load_elgamal | ( | botan_privkey_t * | key, |
| botan_mp_t | p, | ||
| botan_mp_t | g, | ||
| botan_mp_t | x ) |
Definition at line 579 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_privkey_load_frodokem | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[], | ||
| size_t | key_len, | ||
| const char * | frodo_mode ) |
Load a FrodoKEM private key from its raw encoding
| key | the new object will be placed here |
| privkey | the raw private key |
| key_len | length of privkey in bytes |
| frodo_mode | the parameter set, eg "FrodoKEM-640-SHAKE" |
Definition at line 1455 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_privkey_load_kyber | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[], | ||
| size_t | key_len ) |
Load a Kyber private key from its raw encoding. The parameter set is inferred from the key length.
| key | the new object will be placed here |
| privkey | the raw private key |
| key_len | length of privkey in bytes |
Definition at line 1205 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan::KyberMode::Kyber1024_R3, Botan::KyberMode::Kyber512_R3, and Botan::KyberMode::Kyber768_R3.
| int botan_privkey_load_ml_dsa | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[], | ||
| size_t | key_len, | ||
| const char * | mldsa_mode ) |
Load an ML-DSA private key from its raw encoding
| key | the new object will be placed here |
| privkey | the raw private key |
| key_len | length of privkey in bytes |
| mldsa_mode | the parameter set, eg "ML-DSA-6x5" |
Definition at line 1355 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_privkey_load_ml_kem | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[], | ||
| size_t | key_len, | ||
| const char * | mlkem_mode ) |
Load an ML-KEM private key from its raw encoding
| key | the new object will be placed here |
| privkey | the raw private key |
| key_len | length of privkey in bytes |
| mlkem_mode | the parameter set, eg "ML-KEM-768" |
Definition at line 1305 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_privkey_load_rsa | ( | botan_privkey_t * | key, |
| botan_mp_t | p, | ||
| botan_mp_t | q, | ||
| botan_mp_t | e ) |
Load an RSA private key from its factors and public exponent
| key | the new object will be placed here |
| p | the first prime factor |
| q | the second prime factor |
| e | the public exponent |
Definition at line 238 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_privkey_load_rsa_pkcs1 | ( | botan_privkey_t * | key, |
| const uint8_t | bits[], | ||
| size_t | len ) |
Load an RSA private key from a PKCS #1 RSAPrivateKey structure
| key | the new object will be placed here |
| bits | the DER encoding to load |
| len | length of bits in bytes |
Definition at line 255 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::AlgorithmIdentifier::USE_NULL_PARAM.
| int botan_privkey_load_slh_dsa | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[], | ||
| size_t | key_len, | ||
| const char * | slhdsa_mode ) |
Load an SLH-DSA private key from its raw encoding
| key | the new object will be placed here |
| privkey | the raw private key |
| key_len | length of privkey in bytes |
| slhdsa_mode | the parameter set, eg "SLH-DSA-SHA2-128s" |
Definition at line 1405 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_privkey_load_sm2 | ( | botan_privkey_t * | key, |
| botan_mp_t | scalar, | ||
| const char * | curve_name ) |
Load an SM2 private key from its secret scalar
| key | the new object will be placed here |
| scalar | the private scalar |
| curve_name | the name of the curve, typically "sm2p256v1" |
Definition at line 806 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
Referenced by botan_privkey_load_sm2_enc().
| int botan_privkey_load_sm2_enc | ( | botan_privkey_t * | key, |
| botan_mp_t | scalar, | ||
| const char * | curve_name ) |
Load an SM2 encryption private key; identical to botan_privkey_load_sm2
| key | the new object will be placed here |
| scalar | the private scalar |
| curve_name | the name of the curve, typically "sm2p256v1" |
Definition at line 835 of file ffi_pkey_algs.cpp.
References botan_privkey_load_sm2().
| int botan_privkey_load_x25519 | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[32] ) |
Load an X25519 private key from its raw 32 byte encoding
| key | the new object will be placed here |
| privkey | the raw private key |
Definition at line 1054 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_privkey_load_x448 | ( | botan_privkey_t * | key, |
| const uint8_t | privkey[56] ) |
Load an X448 private key from its raw 56 byte encoding
| key | the new object will be placed here |
| privkey | the raw private key |
Definition at line 1130 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_privkey_rsa_get_d | ( | botan_mp_t | d, |
| botan_privkey_t | rsa_key ) |
Get the private exponent of an RSA private key
| d | set to the value of the private exponent |
| rsa_key | the RSA private key |
Definition at line 323 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
| int botan_privkey_rsa_get_e | ( | botan_mp_t | e, |
| botan_privkey_t | rsa_key ) |
Get the public exponent of an RSA private key
| e | set to the value of the public exponent |
| rsa_key | the RSA private key |
Definition at line 319 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
| int botan_privkey_rsa_get_n | ( | botan_mp_t | n, |
| botan_privkey_t | rsa_key ) |
Get the modulus of an RSA private key
| n | set to the value of the modulus |
| rsa_key | the RSA private key |
Definition at line 315 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
| int botan_privkey_rsa_get_p | ( | botan_mp_t | p, |
| botan_privkey_t | rsa_key ) |
Get the first prime factor of an RSA private key
| p | set to the value of the factor |
| rsa_key | the RSA private key |
Definition at line 307 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
| int botan_privkey_rsa_get_privkey | ( | botan_privkey_t | rsa_key, |
| uint8_t | out[], | ||
| size_t * | out_len, | ||
| uint32_t | flags ) |
Export an RSA private key as a PKCS #1 RSAPrivateKey structure
| rsa_key | the RSA private key |
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
| flags | either BOTAN_PRIVKEY_EXPORT_FLAG_DER or BOTAN_PRIVKEY_EXPORT_FLAG_PEM |
Definition at line 335 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_PRIVKEY_EXPORT_FLAG_DER, BOTAN_PRIVKEY_EXPORT_FLAG_PEM, BOTAN_UNUSED, Botan::PEM_Code::encode(), Botan_FFI::write_str_output(), and Botan_FFI::write_vec_output().
| int botan_privkey_rsa_get_q | ( | botan_mp_t | q, |
| botan_privkey_t | rsa_key ) |
Get the second prime factor of an RSA private key
| q | set to the value of the factor |
| rsa_key | the RSA private key |
Definition at line 311 of file ffi_pkey_algs.cpp.
References botan_privkey_get_field().
| int botan_privkey_view_kyber_raw_key | ( | botan_privkey_t | key, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the raw encoding of a Kyber private key
| key | the Kyber private key |
| ctx | an application context passed to the view function |
| view | the view callback which receives the encoding |
Definition at line 1271 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
| int botan_privkey_x25519_get_privkey | ( | botan_privkey_t | key, |
| uint8_t | output[32] ) |
Get the raw 32 byte encoding of an X25519 private key
| key | the X25519 private key |
| output | set to the raw private key |
Definition at line 1086 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
| int botan_privkey_x448_get_privkey | ( | botan_privkey_t | key, |
| uint8_t | output[56] ) |
Get the raw 56 byte encoding of an X448 private key
| key | the X448 private key |
| output | set to the raw private key |
Definition at line 1162 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
| int botan_pubkey_dsa_get_g | ( | botan_mp_t | d, |
| botan_pubkey_t | key ) |
Get the subgroup generator of a DSA public key
| d | set to the value of the generator |
| key | the DSA public key |
Definition at line 431 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
| int botan_pubkey_dsa_get_p | ( | botan_mp_t | p, |
| botan_pubkey_t | key ) |
Get the group prime of a DSA public key
| p | set to the value of the group prime |
| key | the DSA public key |
Definition at line 423 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
| int botan_pubkey_dsa_get_q | ( | botan_mp_t | q, |
| botan_pubkey_t | key ) |
Get the subgroup order of a DSA public key
| q | set to the value of the subgroup order |
| key | the DSA public key |
Definition at line 427 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
| int botan_pubkey_dsa_get_y | ( | botan_mp_t | y, |
| botan_pubkey_t | key ) |
Get the public value of a DSA public key
| y | set to the value of the public key |
| key | the DSA public key |
Definition at line 435 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
| int botan_pubkey_ecc_key_used_explicit_encoding | ( | botan_pubkey_t | key | ) |
Check if the group of this EC key was encoded using explicit curve parameters rather than a named curve OID
| key | the EC public key to examine |
Definition at line 445 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, Botan::EC_PublicKey::domain(), Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), and Botan::EC_Group::used_explicit_encoding().
| int botan_pubkey_ed25519_get_pubkey | ( | botan_pubkey_t | key, |
| uint8_t | pubkey[32] ) |
Get the raw 32 byte encoding of an Ed25519 public key
| key | the Ed25519 public key |
| Public Key Algorithms | set to the raw public key |
Definition at line 955 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
| int botan_pubkey_ed448_get_pubkey | ( | botan_pubkey_t | key, |
| uint8_t | pubkey[57] ) |
Get the raw 57 byte encoding of an Ed448 public key
| key | the Ed448 public key |
| Public Key Algorithms | set to the raw public key |
Definition at line 1032 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
| int botan_pubkey_get_field | ( | botan_mp_t | output, |
| botan_pubkey_t | key, | ||
| const char * | field_name ) |
Get an arbitrary named field from a public key, eg "n" or "e" for RSA
| output | set to the value of the requested field |
| key | the public key to query |
| field_name | the name of the field to retrieve |
Definition at line 206 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and Botan_FFI::safe_get().
Referenced by botan_pubkey_dsa_get_g(), botan_pubkey_dsa_get_p(), botan_pubkey_dsa_get_q(), botan_pubkey_dsa_get_y(), botan_pubkey_rsa_get_e(), and botan_pubkey_rsa_get_n().
| int botan_pubkey_load_classic_mceliece | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[], | ||
| size_t | key_len, | ||
| const char * | cmce_mode ) |
Load a Classic McEliece public key from its raw encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
| key_len | length of pubkey in bytes |
| cmce_mode | the parameter set, eg "348864" |
Definition at line 1519 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::Classic_McEliece_Parameter_Set::from_string().
| int botan_pubkey_load_dh | ( | botan_pubkey_t * | key, |
| botan_mp_t | p, | ||
| botan_mp_t | g, | ||
| botan_mp_t | y ) |
Definition at line 619 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_pubkey_load_dsa | ( | botan_pubkey_t * | key, |
| botan_mp_t | p, | ||
| botan_mp_t | q, | ||
| botan_mp_t | g, | ||
| botan_mp_t | y ) |
Load a DSA public key from its group parameters and public value
| key | the new object will be placed here |
| p | the group prime |
| q | the order of the subgroup |
| g | the subgroup generator |
| y | the public key |
Definition at line 401 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_pubkey_load_ecdh | ( | botan_pubkey_t * | key, |
| botan_mp_t | public_x, | ||
| botan_mp_t | public_y, | ||
| const char * | curve_name ) |
Load an ECDH public key from the affine coordinates of the public point
| key | the new object will be placed here |
| public_x | the x coordinate of the public point |
| public_y | the y coordinate of the public point |
| curve_name | the name of the curve, eg "secp256r1" |
Definition at line 657 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_pubkey_load_ecdh_sec1 | ( | botan_pubkey_t * | key, |
| const uint8_t | sec1[], | ||
| size_t | sec1_len, | ||
| const char * | curve_name ) |
Load an ECDH public key from the SEC1 encoding of the public point
| key | the new object will be placed here |
| sec1 | the SEC1 compressed or uncompressed point encoding |
| sec1_len | length of sec1 in bytes |
| curve_name | the name of the curve, eg "secp256r1" |
Definition at line 681 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_ecdsa | ( | botan_pubkey_t * | key, |
| botan_mp_t | public_x, | ||
| botan_mp_t | public_y, | ||
| const char * | curve_name ) |
Load an ECDSA public key from the affine coordinates of the public point
| key | the new object will be placed here |
| public_x | the x coordinate of the public point |
| public_y | the y coordinate of the public point |
| curve_name | the name of the curve, eg "secp256r1" |
Definition at line 465 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_pubkey_load_ecdsa_sec1 | ( | botan_pubkey_t * | key, |
| const uint8_t | sec1[], | ||
| size_t | sec1_len, | ||
| const char * | curve_name ) |
Load an ECDSA public key from the SEC1 encoding of the public point
| key | the new object will be placed here |
| sec1 | the SEC1 compressed or uncompressed point encoding |
| sec1_len | length of sec1 in bytes |
| curve_name | the name of the curve, eg "secp256r1" |
Definition at line 491 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_ed25519 | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[32] ) |
Load an Ed25519 public key from its raw 32 byte encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
Definition at line 915 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_ed448 | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[57] ) |
Load an Ed448 public key from its raw 57 byte encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
Definition at line 996 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_elgamal | ( | botan_pubkey_t * | key, |
| botan_mp_t | p, | ||
| botan_mp_t | g, | ||
| botan_mp_t | y ) |
Definition at line 562 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_pubkey_load_frodokem | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[], | ||
| size_t | key_len, | ||
| const char * | frodo_mode ) |
Load a FrodoKEM public key from its raw encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
| key_len | length of pubkey in bytes |
| frodo_mode | the parameter set, eg "FrodoKEM-640-SHAKE" |
Definition at line 1474 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_kyber | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[], | ||
| size_t | key_len ) |
Load a Kyber public key from its raw encoding. The parameter set is inferred from the key length.
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
| key_len | length of pubkey in bytes |
Definition at line 1238 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), Botan::KyberMode::Kyber1024_R3, Botan::KyberMode::Kyber512_R3, and Botan::KyberMode::Kyber768_R3.
| int botan_pubkey_load_ml_dsa | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[], | ||
| size_t | key_len, | ||
| const char * | mldsa_mode ) |
Load an ML-DSA public key from its raw encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
| key_len | length of pubkey in bytes |
| mldsa_mode | the parameter set, eg "ML-DSA-6x5" |
Definition at line 1378 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_ml_kem | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[], | ||
| size_t | key_len, | ||
| const char * | mlkem_mode ) |
Load an ML-KEM public key from its raw encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
| key_len | length of pubkey in bytes |
| mlkem_mode | the parameter set, eg "ML-KEM-768" |
Definition at line 1328 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_rsa | ( | botan_pubkey_t * | key, |
| botan_mp_t | n, | ||
| botan_mp_t | e ) |
Load an RSA public key from its modulus and public exponent
| key | the new object will be placed here |
| n | the modulus |
| e | the public exponent |
Definition at line 273 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_pubkey_load_rsa_pkcs1 | ( | botan_pubkey_t * | key, |
| const uint8_t | bits[], | ||
| size_t | len ) |
Load an RSA public key from a PKCS #1 RSAPublicKey structure
| key | the new object will be placed here |
| bits | the DER encoding to load |
| len | length of bits in bytes |
Definition at line 289 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan::AlgorithmIdentifier::USE_NULL_PARAM.
| int botan_pubkey_load_slh_dsa | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[], | ||
| size_t | key_len, | ||
| const char * | slhdsa_mode ) |
Load an SLH-DSA public key from its raw encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
| key_len | length of pubkey in bytes |
| slhdsa_mode | the parameter set, eg "SLH-DSA-SHA2-128s" |
Definition at line 1428 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_sm2 | ( | botan_pubkey_t * | key, |
| botan_mp_t | public_x, | ||
| botan_mp_t | public_y, | ||
| const char * | curve_name ) |
Load an SM2 public key from the affine coordinates of the public point
| key | the new object will be placed here |
| public_x | the x coordinate of the public point |
| public_y | the y coordinate of the public point |
| curve_name | the name of the curve, typically "sm2p256v1" |
Definition at line 759 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_UNKNOWN_ERROR, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
Referenced by botan_pubkey_load_sm2_enc().
| int botan_pubkey_load_sm2_enc | ( | botan_pubkey_t * | key, |
| botan_mp_t | public_x, | ||
| botan_mp_t | public_y, | ||
| const char * | curve_name ) |
Load an SM2 encryption public key; identical to botan_pubkey_load_sm2
| key | the new object will be placed here |
| public_x | the x coordinate of the public point |
| public_y | the y coordinate of the public point |
| curve_name | the name of the curve, typically "sm2p256v1" |
Definition at line 828 of file ffi_pkey_algs.cpp.
References botan_pubkey_load_sm2().
| int botan_pubkey_load_sm2_sec1 | ( | botan_pubkey_t * | key, |
| const uint8_t | sec1[], | ||
| size_t | sec1_len, | ||
| const char * | curve_name ) |
Load an SM2 public key from the SEC1 encoding of the public point
| key | the new object will be placed here |
| sec1 | the SEC1 compressed or uncompressed point encoding |
| sec1_len | length of sec1 in bytes |
| curve_name | the name of the curve, typically "sm2p256v1" |
Definition at line 783 of file ffi_pkey_algs.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_x25519 | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[32] ) |
Load an X25519 public key from its raw 32 byte encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
Definition at line 1070 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_load_x448 | ( | botan_pubkey_t * | key, |
| const uint8_t | pubkey[56] ) |
Load an X448 public key from its raw 56 byte encoding
| key | the new object will be placed here |
| Public Key Algorithms | the raw public key |
Definition at line 1146 of file ffi_pkey_algs.cpp.
References Botan_FFI::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_pubkey_rsa_get_e | ( | botan_mp_t | e, |
| botan_pubkey_t | rsa_key ) |
Get the public exponent of an RSA public key
| e | set to the value of the public exponent |
| rsa_key | the RSA public key |
Definition at line 327 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
| int botan_pubkey_rsa_get_n | ( | botan_mp_t | n, |
| botan_pubkey_t | rsa_key ) |
Get the modulus of an RSA public key
| n | set to the value of the modulus |
| rsa_key | the RSA public key |
Definition at line 331 of file ffi_pkey_algs.cpp.
References botan_pubkey_get_field().
| int botan_pubkey_sm2_compute_za | ( | uint8_t | out[], |
| size_t * | out_len, | ||
| const char * | ident, | ||
| const char * | hash_algo, | ||
| botan_pubkey_t | key ) |
Compute the SM2 ZA value, the hash of the user identity and public key which is prefixed to the message before signing
| out | output buffer |
| out_len | on input the size of out, on output the number of bytes written or required |
| ident | the user identifier |
| hash_algo | the hash to use, typically "SM3" |
| key | the SM2 public key |
Definition at line 726 of file ffi_pkey_algs.cpp.
References Botan::EC_PublicKey::_public_ec_point(), Botan::Asymmetric_Key::algo_name(), Botan::any_null_pointers(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, Botan::HashFunction::create_or_throw(), Botan::EC_PublicKey::domain(), Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), Botan::sm2_compute_za(), and Botan_FFI::write_vec_output().
| int botan_pubkey_view_ec_public_point | ( | botan_pubkey_t | key, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the uncompressed public point associated with the key
Definition at line 1541 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
| int botan_pubkey_view_kyber_raw_key | ( | botan_pubkey_t | key, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the raw encoding of a Kyber public key
| key | the Kyber public key |
| ctx | an application context passed to the view function |
| view | the view callback which receives the encoding |
Definition at line 1286 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
| int botan_pubkey_x25519_get_pubkey | ( | botan_pubkey_t | key, |
| uint8_t | pubkey[32] ) |
Get the raw 32 byte encoding of an X25519 public key
| key | the X25519 public key |
| Public Key Algorithms | set to the raw public key |
Definition at line 1109 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().
| int botan_pubkey_x448_get_pubkey | ( | botan_pubkey_t | key, |
| uint8_t | pubkey[56] ) |
Get the raw 56 byte encoding of an X448 public key
| key | the X448 public key |
| Public Key Algorithms | set to the raw public key |
Definition at line 1182 of file ffi_pkey_algs.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::copy_mem().