示例#1
0
 def loadChainFromString( self, data, dataFormat = crypto.FILETYPE_PEM ):
   """
   Load a x509 cert from a string containing the pem data
   Return : S_OK / S_ERROR
   """
   self.__loadedChain = False
   try:
     self.__certList = crypto.load_certificate_chain( crypto.FILETYPE_PEM, data )
   except Exception, e:
     return S_ERROR( "Can't load pem data: %s" % str( e ) )
示例#2
0
 def loadChainFromString( self, pemData ):
   """
   Load a x509 cert from a string containing the pem data
   Return : S_OK / S_ERROR
   """
   self.__loadedChain = False
   try:
     self.__certList = crypto.load_certificate_chain( crypto.FILETYPE_PEM, pemData )
   except Exception, e:
     return S_ERROR( "Can't load pem data: %s" % str( e ) )
示例#3
0
 def loadChainFromString(self, data, dataFormat=crypto.FILETYPE_PEM):
   """
   Load a x509 cert from a string containing the pem data
   Return : S_OK / S_ERROR
   """
   self.__loadedChain = False
   try:
     self.__certList = crypto.load_certificate_chain(crypto.FILETYPE_PEM, data)
   except Exception as e:
     return S_ERROR(DErrno.ECERTREAD, "%s" % repr(e).replace(',)', ')'))
   if not self.__certList:
     return S_ERROR(DErrno.EX509)
   self.__loadedChain = True
   # Update internals
   self.__checkProxyness()
   return S_OK()
示例#4
0
 def loadChainFromString(self, data, dataFormat=crypto.FILETYPE_PEM):
   """
   Load a x509 cert from a string containing the pem data
   Return : S_OK / S_ERROR
   """
   self.__loadedChain = False
   try:
     self.__certList = crypto.load_certificate_chain(crypto.FILETYPE_PEM, data)
   except Exception as e:
     return S_ERROR(DErrno.ECERTREAD, "%s" % repr(e).replace(',)', ')'))
   if not self.__certList:
     return S_ERROR(DErrno.EX509)
   self.__loadedChain = True
   # Update internals
   self.__checkProxyness()
   return S_OK()