wrap wolfSSL_X509_get_der()

pull/8/head
Chris Conlon 2018-12-26 16:08:33 -08:00
parent 6d60fa4b4b
commit 9ff47b5728
2 changed files with 12 additions and 0 deletions

View File

@ -114,6 +114,17 @@ class WolfSSLX509(object):
return san
def get_der(self):
outSz = _ffi.new("int *")
derPtr = _lib.wolfSSL_X509_get_der(self.native_object, outSz)
if derPtr == _ffi.NULL:
return None
derBytes = _ffi.buffer(derPtr, outSz[0])
return derBytes
class SSLContext(object):
"""

View File

@ -108,6 +108,7 @@ ffi.cdef(
*/
char* wolfSSL_X509_get_subjectCN(void*);
char* wolfSSL_X509_get_next_altname(void*);
const unsigned char* wolfSSL_X509_get_der(void*, int*);
"""
)