'Create a new key pair object.
: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:`.KeyPair`'

def import_key_pair_from_string(self, name, key_material):

    params = {'name': name, 'value': key_material}
    kp = self.connection.request('hosting.ssh.create', params).object
    return self._to_key_pair(kp)
