From 5050e6eb3495abaa33aa3e9b03cc4377ce37a037 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Fri, 15 May 2020 06:34:26 -0400 Subject: Add DER signature handling to Python --- src/python/botan2.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/python') diff --git a/src/python/botan2.py b/src/python/botan2.py index 4cae19d1a..6ae1bd6da 100755 --- a/src/python/botan2.py +++ b/src/python/botan2.py @@ -1170,9 +1170,9 @@ class PKDecrypt(object): return outbuf.raw[0:int(outbuf_sz.value)] class PKSign(object): # pylint: disable=invalid-name - def __init__(self, key, padding): + def __init__(self, key, padding, der=False): self.__obj = c_void_p(0) - flags = c_uint32(0) # always zero in this ABI + flags = c_uint32(1) if der else c_uint32(0) _DLL.botan_pk_op_sign_create(byref(self.__obj), key.handle_(), _ctype_str(padding), flags) def __del__(self): @@ -1189,9 +1189,9 @@ class PKSign(object): # pylint: disable=invalid-name return outbuf.raw[0:int(outbuf_sz.value)] class PKVerify(object): - def __init__(self, key, padding): + def __init__(self, key, padding, der=False): self.__obj = c_void_p(0) - flags = c_uint32(0) # always zero in this ABI + flags = c_uint32(1) if der else c_uint32(0) _DLL.botan_pk_op_verify_create(byref(self.__obj), key.handle_(), _ctype_str(padding), flags) def __del__(self): -- cgit v1.2.3