'Import a new public key from string.
:param name: Key pair name.
:type name: ``str``
:param key_material: Public key material.
:type key_material: ``str``
:return: Imported key pair object.
:rtype: :class:`libcloud.compute.base.KeyPair`'

def import_key_pair_from_string(self, name, key_material):

    res = self._sync_request(command='registerSSHKeyPair', params={'name': name, 'publickey': key_material}, method='GET')
    key_pair = self._to_key_pair(data=res['keypair'])
    return key_pair
