コード例 #1
0
ファイル: X509.py プロジェクト: 0xkag/M2Crypto
 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
コード例 #2
0
ファイル: X509.py プロジェクト: rossonet/Strumenti-RCloud
    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
コード例 #3
0
ファイル: X509.py プロジェクト: rossonet/Strumenti-RCloud
 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
コード例 #4
0
ファイル: X509.py プロジェクト: 0xkag/M2Crypto
    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)
コード例 #5
0
ファイル: X509.py プロジェクト: rossonet/Strumenti-RCloud
    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)
コード例 #6
0
ファイル: X509.py プロジェクト: 0xkag/M2Crypto
 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()
コード例 #7
0
ファイル: X509.py プロジェクト: rossonet/Strumenti-RCloud
 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()
コード例 #8
0
ファイル: X509.py プロジェクト: 0xkag/M2Crypto
 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)
コード例 #9
0
ファイル: X509.py プロジェクト: 0xkag/M2Crypto
 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)
コード例 #10
0
ファイル: X509.py プロジェクト: 0xkag/M2Crypto
    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
コード例 #11
0
ファイル: X509.py プロジェクト: 0xkag/M2Crypto
 def __str__(self):
     assert m2.x509_name_type_check(self.x509_name), "'x509_name' type error" 
     return m2.x509_name_oneline(self.x509_name)
コード例 #12
0
ファイル: X509.py プロジェクト: rossonet/Strumenti-RCloud
 def __str__(self):
     assert m2.x509_name_type_check(
         self.x509_name), "'x509_name' type error"
     return m2.x509_name_oneline(self.x509_name)
コード例 #13
0
 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)
コード例 #14
0
 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)