1 from ctypes import c_void_p
2 from ctypescrypto.bio import Membio
3 from ctypescrypto.exception import LibCryptoError
4 from crypescrypto import libcrypto
7 def __init__(self,ptr):
10 libcrypto.X509_NAME_free(self.ptr)
14 return libcrypto.X509_NAME_entry_count(self.ptr)
16 def __getattr__(self,key):
18 def __setattr__(self,key,val):
21 def __init__(self,ptr):
24 libcrypto.X509_NAME_free(self.ptr)
28 return libcrypto.X509_NAME_entry_count(self.ptr)
30 def __getattr__(self,key):
32 def __setattr__(self,key,val):
39 def __init__(self,ptr):
42 libcrypto.X509_free(self.cert)
44 """ Returns der string of the certificate """
46 """ Returns EVP PKEy object of certificate public key"""
47 return PKey(libcrypto.X509_get_pubkey(self.cert,False)
49 """ Verify self on given issuer key """
51 """ Create X509 object from pem string """
53 """ Create X509 object from der string """
55 return X509Name(libcrypto.X509_get_subject_name(self.cert))
57 return X509Name(libcrypto.X509_get_issuer_name(self.cert))