'imports the public key from an RSA key pair that you created
with a third-party tool.
Supported formats:
* OpenSSH public key format (e.g., the format
in ~/.ssh/authorized_keys)
* Base64 encoded DER format
* SSH public key file format as specified in RFC4716
DSA keys are not supported. Make sure your key generator is
set up to create RSA keys.
Supported lengths: 1024, 2048, and 4096.
:type key_name: string
:param key_name: The name of the new keypair
:type public_key_material: string
:param public_key_material: The public key. You must base64 encode
the public key material before sending
it to AWS.
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
:rtype: :class:`boto.ec2.keypair.KeyPair`
:return: A :class:`boto.ec2.keypair.KeyPair` object representing
the newly imported key pair.  This object will contain only
the key name and the fingerprint.'

def import_key_pair(self, key_name, public_key_material, dry_run=False):

    public_key_material = base64.b64encode(public_key_material)
    params = {'KeyName': key_name, 'PublicKeyMaterial': public_key_material}
    if dry_run:
        params['DryRun'] = 'true'
    return self.get_object('ImportKeyPair', params, KeyPair, verb='POST')
