'Import a new public key from string.
:param name: Key pair name (unused).
:type name: ``str``
:param key_material: Public key material.
:type key_material: ``str``
:rtype: :class:`.KeyPair` object'

def import_key_pair_from_string(self, name, key_material):

    data = json.dumps({'key': key_material})
    user_id = self.connection.request('/profile.json').object['user']['id']
    response = self.connection.request(('/users/%s/ssh_keys.json' % user_id), data=data, headers={'Content-type': 'application/json'}, method='POST')
    return self._to_key_pair(response.object['ssh_key'])
