Example #1
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, e:
     return S_ERROR( "Can't load key file: %s (Probably bad pass phrase?)" % str( e ) )
Example #2
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, e:
     return S_ERROR( "Can't load key file: %s (Probably bad pass phrase?)" % str( e ) )
Example #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()
Example #4
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()