def getPrivateKeys(self):
        """
        Return the server private keys.
        """
        privateKeys = {}
        for filename in os.listdir(self.dataRoot):
            if filename[:9] == 'ssh_host_' and filename[-4:]=='_key':
                fullPath = os.path.join(self.dataRoot, filename)
                try:
                    key = keys.Key.fromFile(fullPath)
                except __HOLE__, e:
                    if e.errno == errno.EACCES:
                        # Not allowed, let's switch to root
                        key = runAsEffectiveUser(0, 0, keys.Key.fromFile, fullPath)
                        keyType = keys.objectType(key.keyObject)
                        privateKeys[keyType] = key
                    else:
                        raise
                except Exception, e:
                    log.msg('bad private key file %s: %s' % (filename, e))
                else:
                    keyType = keys.objectType(key.keyObject)
                    privateKeys[keyType] = key
        return privateKeys
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/conch/openssh_compat/factory.py/OpenSSHFactory.getPrivateKeys