aboutsummaryrefslogtreecommitdiffstats
path: root/src/python
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2020-05-15 06:34:26 -0400
committerJack Lloyd <[email protected]>2020-05-15 06:34:26 -0400
commit5050e6eb3495abaa33aa3e9b03cc4377ce37a037 (patch)
treebf221e597618d910ce19f32e6a6798823494d6a2 /src/python
parentccb39d9cb02e7595b9346a055bc9a80e5f57d716 (diff)
Add DER signature handling to Python
Diffstat (limited to 'src/python')
-rwxr-xr-xsrc/python/botan2.py8
1 files changed, 4 insertions, 4 deletions
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):