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 ) )
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()