#NEWLINE# def import_keys( self , key_data ) : #NEWLINE# #INDENT# ' import the key_data into our keyring\n\n        >>> import shutil\n        >>> shutil.rmtree("keys")\n        >>> gpg = GPG(gnupghome="keys")\n        >>> input = gpg.gen_key_input()\n        >>> result = gpg.gen_key(input)\n        >>> print1 = result.fingerprint\n        >>> result = gpg.gen_key(input)\n        >>> print2 = result.fingerprint\n        >>> pubkey1 = gpg.export_keys(print1)\n        >>> seckey1 = gpg.export_keys(print1,secret=True)\n        >>> seckeys = gpg.list_keys(secret=True)\n        >>> pubkeys = gpg.list_keys()\n        >>> assert print1 in seckeys.fingerprints\n        >>> assert print1 in pubkeys.fingerprints\n        >>> str(gpg.delete_keys(print1))\n        \'Must delete secret key first\'\n        >>> str(gpg.delete_keys(print1,secret=True))\n        \'ok\'\n        >>> str(gpg.delete_keys(print1))\n        \'ok\'\n        >>> str(gpg.delete_keys("nosuchkey"))\n        \'No such key\'\n        >>> seckeys = gpg.list_keys(secret=True)\n        >>> pubkeys = gpg.list_keys()\n        >>> assert not print1 in seckeys.fingerprints\n        >>> assert not print1 in pubkeys.fingerprints\n        >>> result = gpg.import_keys(\'foo\')\n        >>> assert not result\n        >>> result = gpg.import_keys(pubkey1)\n        >>> pubkeys = gpg.list_keys()\n        >>> seckeys = gpg.list_keys(secret=True)\n        >>> assert not print1 in seckeys.fingerprints\n        >>> assert print1 in pubkeys.fingerprints\n        >>> result = gpg.import_keys(seckey1)\n        >>> assert result\n        >>> seckeys = gpg.list_keys(secret=True)\n        >>> pubkeys = gpg.list_keys()\n        >>> assert print1 in seckeys.fingerprints\n        >>> assert print1 in pubkeys.fingerprints\n        >>> assert print2 in pubkeys.fingerprints\n\n        ' #NEWLINE# result = self . result_map [ 'import' ] ( self ) #NEWLINE# logger . debug ( 'import_keys: %r' , data [ : 256 ] ) #NEWLINE# data = _make_binary_stream ( key_data , self . encoding ) #NEWLINE# self . _handle_io ( [ '--import' ] , data , result , binary = True ) #NEWLINE# logger . debug ( 'import_keys result: %r' , result . __dict__ ) #NEWLINE# data . close ( ) #NEWLINE# return result