diff options
author | Jack Lloyd <[email protected]> | 2017-04-02 16:01:40 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-04-02 16:01:40 -0400 |
commit | afbf3dc9e0e1169dce42a72275d95128c6d4e4da (patch) | |
tree | 987b3a5be31eb25b5e80d5d49e34b00b47729550 /src/lib/ffi/ffi.h | |
parent | f6723299eb3a05b0e3482ed88650680a43be1cd8 (diff) |
Add generic getters for PK parameters in C interface
Supporting RSA, DSA, and ECC. Add also DSA specific loading functions.
Diffstat (limited to 'src/lib/ffi/ffi.h')
-rw-r--r-- | src/lib/ffi/ffi.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/ffi/ffi.h b/src/lib/ffi/ffi.h index 661368c18..b7918d2b4 100644 --- a/src/lib/ffi/ffi.h +++ b/src/lib/ffi/ffi.h @@ -653,6 +653,16 @@ BOTAN_DLL int botan_pubkey_fingerprint(botan_pubkey_t key, const char* hash, BOTAN_DLL int botan_pubkey_destroy(botan_pubkey_t key); +/* +* Get arbitrary named fields from public or privat keys +*/ +BOTAN_DLL int botan_pubkey_get_field(botan_mp_t output, + botan_pubkey_t key, + const char* field_name); + +BOTAN_DLL int botan_privkey_get_field(botan_mp_t output, + botan_privkey_t key, + const char* field_name); /* * Algorithm specific key operations: RSA @@ -676,6 +686,28 @@ BOTAN_DLL int botan_pubkey_rsa_get_e(botan_mp_t e, botan_pubkey_t rsa_key); BOTAN_DLL int botan_pubkey_rsa_get_n(botan_mp_t n, botan_pubkey_t rsa_key); /* +* Algorithm specific key operations: DSA +*/ +BOTAN_DLL 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); + +BOTAN_DLL 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); + +BOTAN_DLL int botan_privkey_dsa_get_x(botan_mp_t n, botan_privkey_t key); + +BOTAN_DLL int botan_pubkey_dsa_get_p(botan_mp_t p, botan_pubkey_t key); +BOTAN_DLL int botan_pubkey_dsa_get_q(botan_mp_t q, botan_pubkey_t key); +BOTAN_DLL int botan_pubkey_dsa_get_g(botan_mp_t d, botan_pubkey_t key); +BOTAN_DLL int botan_pubkey_dsa_get_y(botan_mp_t y, botan_pubkey_t key); + +/* * Public Key Encryption */ typedef struct botan_pk_op_encrypt_struct* botan_pk_op_encrypt_t; |