def get_keys_from_ldap(self, username=None):
        """
        Fetch keys from ldap.

        Args:
            username Username associated with keys to fetch (optional)

        Returns:
            Array of dictionaries in '{username: [public keys]}' format

        """
        result_dict = {}
        filter = ['(sshPublicKey=*)']
        if username is not None:
            filter.append('(uid={})'.format(username))
        attributes = ['uid', 'sshPublicKey']
        results = self.client.search(filter, attributes)
        for result in results:
            result_dict[result.uid.value] = result.sshPublicKey.values
        return result_dict