def __init__(self, x509_name=None, _pyfree=0): if x509_name is not None: assert m2.x509_name_type_check(x509_name), "'x509_name' type error" self.x509_name = x509_name self._pyfree = _pyfree else: self.x509_name = m2.x509_name_new () self._pyfree = 1
def __setattr__(self, attr, value): if attr in self.nid: assert m2.x509_name_type_check( self.x509_name), "'x509_name' type error" return m2.x509_name_set_by_nid(self.x509_name, self.nid[attr], value) self.__dict__[attr] = value
def __init__(self, x509_name=None, _pyfree=0): if x509_name is not None: assert m2.x509_name_type_check(x509_name), "'x509_name' type error" self.x509_name = x509_name self._pyfree = _pyfree else: self.x509_name = m2.x509_name_new() self._pyfree = 1
def __getattr__(self, attr): if attr in self.nid: assert m2.x509_name_type_check(self.x509_name), "'x509_name' type error" return m2.x509_name_by_nid(self.x509_name, self.nid[attr]) if attr in self.__dict__: return self.__dict__[attr] raise AttributeError, (self, attr)
def __getattr__(self, attr): if attr in self.nid: assert m2.x509_name_type_check( self.x509_name), "'x509_name' type error" return m2.x509_name_by_nid(self.x509_name, self.nid[attr]) if attr in self.__dict__: return self.__dict__[attr] raise AttributeError, (self, attr)
def as_text(self, indent=0, flags=m2.XN_FLAG_COMPAT): """ as_text returns the name as a string. @param indent: Each line in multiline format is indented by this many spaces. @param flags: Flags that control how the output should be formatted. """ assert m2.x509_name_type_check(self.x509_name), "'x509_name' type error" buf=BIO.MemoryBuffer() m2.x509_name_print_ex(buf.bio_ptr(), self.x509_name, indent, flags) return buf.read_all()
def as_text(self, indent=0, flags=m2.XN_FLAG_COMPAT): """ as_text returns the name as a string. @param indent: Each line in multiline format is indented by this many spaces. @param flags: Flags that control how the output should be formatted. """ assert m2.x509_name_type_check( self.x509_name), "'x509_name' type error" buf = BIO.MemoryBuffer() m2.x509_name_print_ex(buf.bio_ptr(), self.x509_name, indent, flags) return buf.read_all()
def as_hash(self): assert m2.x509_name_type_check(self.x509_name), "'x509_name' type error" return m2.x509_name_hash(self.x509_name)
def as_der(self): assert m2.x509_name_type_check(self.x509_name), "'x509_name' type error" return m2.x509_name_get_der(self.x509_name)
def __setattr__(self, attr, value): if attr in self.nid: assert m2.x509_name_type_check(self.x509_name), "'x509_name' type error" return m2.x509_name_set_by_nid(self.x509_name, self.nid[attr], value) self.__dict__[attr] = value
def __str__(self): assert m2.x509_name_type_check(self.x509_name), "'x509_name' type error" return m2.x509_name_oneline(self.x509_name)
def __str__(self): assert m2.x509_name_type_check( self.x509_name), "'x509_name' type error" return m2.x509_name_oneline(self.x509_name)
def as_hash(self): assert m2.x509_name_type_check( self.x509_name), "'x509_name' type error" return m2.x509_name_hash(self.x509_name)
def as_der(self): assert m2.x509_name_type_check( self.x509_name), "'x509_name' type error" return m2.x509_name_get_der(self.x509_name)