コード例 #1
0
ファイル: X509Chain.py プロジェクト: JanEbbing/DIRAC
 def loadKeyFromString( self, pemData, password = False ):
   """
   Load a xPKey from a string containing the pem data
   Return : S_OK / S_ERROR
   """
   self.__loadedPKey = False
   try:
     self.__keyObj = crypto.load_privatekey( crypto.FILETYPE_PEM, pemData, password )
   except Exception, e:
     return S_ERROR( "Can't load key file: %s (Probably bad pass phrase?)" % str( e ) )
コード例 #2
0
ファイル: X509Chain.py プロジェクト: zhangxiaomei/DIRAC
 def loadKeyFromString( self, pemData, password = False ):
   """
   Load a xPKey from a string containing the pem data
   Return : S_OK / S_ERROR
   """
   self.__loadedPKey = False
   try:
     self.__keyObj = crypto.load_privatekey( crypto.FILETYPE_PEM, pemData, password )
   except Exception, e:
     return S_ERROR( "Can't load key file: %s (Probably bad pass phrase?)" % str( e ) )
コード例 #3
0
 def loadKeyFromString(self, pemData, password=False):
   """
   Load a xPKey from a string containing the pem data
   Return : S_OK / S_ERROR
   """
   self.__loadedPKey = False
   try:
     self.__keyObj = crypto.load_privatekey(crypto.FILETYPE_PEM, pemData, password)
   except Exception as e:
     return S_ERROR(DErrno.ECERTREAD, "%s (Probably bad pass phrase?)" % repr(e).replace(',)', ')'))
   self.__loadedPKey = True
   return S_OK()
コード例 #4
0
ファイル: X509Chain.py プロジェクト: DIRACGrid/DIRAC
 def loadKeyFromString(self, pemData, password=False):
   """
   Load a xPKey from a string containing the pem data
   Return : S_OK / S_ERROR
   """
   self.__loadedPKey = False
   try:
     self.__keyObj = crypto.load_privatekey(crypto.FILETYPE_PEM, pemData, password)
   except Exception as e:
     return S_ERROR(DErrno.ECERTREAD, "%s (Probably bad pass phrase?)" % repr(e).replace(',)', ')'))
   self.__loadedPKey = True
   return S_OK()