diff options
author | Jack Lloyd <[email protected]> | 2018-08-11 17:55:50 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-08-11 17:55:50 -0400 |
commit | cb05f9c9938434c0c56122addd94015e7df38b19 (patch) | |
tree | 11df42809c02f6a6bf3d0ae6f7f2fb358867474a /src/python/botan2.py | |
parent | cb3b4483d7784a6c593e13c91fa2325b2c31208b (diff) |
In Python expose new name getters
Diffstat (limited to 'src/python/botan2.py')
-rwxr-xr-x | src/python/botan2.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/python/botan2.py b/src/python/botan2.py index 021ac8a61..617efa887 100755 --- a/src/python/botan2.py +++ b/src/python/botan2.py @@ -110,6 +110,9 @@ botan.botan_hash_init.errcheck = errcheck_for('botan_hash_init') botan.botan_hash_destroy.argtypes = [c_void_p] botan.botan_hash_destroy.errcheck = errcheck_for('botan_hash_destroy') +botan.botan_hash_name.argtypes = [c_void_p, POINTER(c_char), POINTER(c_size_t)] +botan.botan_hash_name.errcheck = errcheck_for('botan_hash_name') + botan.botan_hash_clear.argtypes = [c_void_p] botan.botan_hash_clear.errcheck = errcheck_for('botan_hash_clear') @@ -129,6 +132,9 @@ botan.botan_mac_init.errcheck = errcheck_for('botan_mac_init') botan.botan_mac_destroy.argtypes = [c_void_p] botan.botan_mac_destroy.errcheck = errcheck_for('botan_mac_destroy') +botan.botan_mac_name.argtypes = [c_void_p, POINTER(c_char), POINTER(c_size_t)] +botan.botan_mac_name.errcheck = errcheck_for('botan_mac_name') + botan.botan_mac_clear.argtypes = [c_void_p] botan.botan_mac_clear.errcheck = errcheck_for('botan_mac_clear') @@ -151,6 +157,9 @@ botan.botan_cipher_init.errcheck = errcheck_for('botan_cipher_init') botan.botan_cipher_destroy.argtypes = [c_void_p] botan.botan_cipher_destroy.errcheck = errcheck_for('botan_cipher_destroy') +botan.botan_cipher_name.argtypes = [c_void_p, POINTER(c_char), POINTER(c_size_t)] +botan.botan_cipher_name.errcheck = errcheck_for('botan_cipher_name') + botan.botan_cipher_get_default_nonce_length.argtypes = [c_void_p, POINTER(c_size_t)] botan.botan_cipher_get_default_nonce_length.errcheck = errcheck_for('botan_cipher_get_default_nonce_length') @@ -226,6 +235,9 @@ botan.botan_pubkey_fingerprint.errcheck = errcheck_for('botan_pubkey_fingerprint botan.botan_privkey_create.argtypes = [c_void_p, c_char_p, c_char_p, c_void_p] botan.botan_privkey_create.errcheck = errcheck_for('botan_privkey_create') +botan.botan_privkey_algo_name.argtypes = [c_void_p, POINTER(c_char), POINTER(c_size_t)] +botan.botan_privkey_algo_name.errcheck = errcheck_for('botan_privkey_algo_name') + botan.botan_privkey_export_pubkey.argtypes = [c_void_p, c_void_p] botan.botan_privkey_export_pubkey.errcheck = errcheck_for('botan_privkey_export_pubkey') @@ -454,6 +466,9 @@ class hash_function(object): # pylint: disable=invalid-name def __del__(self): botan.botan_hash_destroy(self.hash) + def algo_name(self): + return _call_fn_returning_string(32, lambda b, bl: botan.botan_hash_name(self.hash, b, bl)) + def clear(self): botan.botan_hash_clear(self.hash) @@ -485,6 +500,9 @@ class message_authentication_code(object): # pylint: disable=invalid-name def clear(self): botan.botan_mac_clear(self.mac) + def algo_name(self): + return _call_fn_returning_string(32, lambda b, bl: botan.botan_mac_name(self.mac, b, bl)) + def output_length(self): l = c_size_t(0) botan.botan_mac_output_length(self.mac, byref(l)) @@ -510,6 +528,9 @@ class cipher(object): # pylint: disable=invalid-name def __del__(self): botan.botan_cipher_destroy(self.cipher) + def algo_name(self): + return _call_fn_returning_string(32, lambda b, bl: botan.botan_cipher_name(self.cipher, b, bl)) + def default_nonce_length(self): l = c_size_t(0) botan.botan_cipher_get_default_nonce_length(self.cipher, byref(l)) @@ -694,6 +715,9 @@ class private_key(object): # pylint: disable=invalid-name def __del__(self): botan.botan_privkey_destroy(self.privkey) + def algo_name(self): + return _call_fn_returning_string(32, lambda b, bl: botan.botan_privkey_algo_name(self.privkey, b, bl)) + def get_public_key(self): pub = c_void_p(0) |