code: def gpg_profile_create_key( blockchain_id, keyname, immutable=True, proxy=None, wallet_keys=None, config_dir=None, gpghome=None, use_key_server=True, key_server=None ):
      
  
      assert is_valid_keyname(keyname)
  
      if config_dir is None:
          config_dir = get_config_dir()
  
      if gpghome is None:
          gpghome = get_default_gpg_home()
  
      keydir = make_gpg_tmphome( "create-account-", config_dir=config_dir )
      gpg = gnupg.GPG( homedir=keydir )
  
      log.debug("Generating GPG key (this may take a while)")
  
      key_input = gpg.gen_key_input( key_type="RSA", name_email=blockchain_id, key_length=4096, name_real=keyname )
      key_res = gpg.gen_key( key_input )
      assert key_res
  
      key_id = key_res.fingerprint
      key_data = gpg.export_keys( [key_id] )
      assert key_data
  
      # save the key itself, to the global keyring
      rc = gpg_stash_key( keyname, key_data, gpghome=gpghome ) 
      assert rc, "Failed to store key '%s' (%s)" % (keyname, key_id)
      
      shutil.rmtree(keydir)
  
      # propagate to blockstack
      add_res = gpg_profile_put_key( blockchain_id, key_id, immutable=immutable, use_key_server=use_key_server, key_server=key_server, key_name=keyname, proxy=proxy, wallet_keys=wallet_keys, gpghome=gpghome )
      return add_res
docs: Create a new account key.
      Select good default GPG values (4096-bit, RSA/RSA)
      Note that without rngd running, this may take a while.
      Add the new key to the user's account.
  
      Return {'status': True, 'key_url': ..., 'key_id': ..., } on success
      Return {'error': ...} on error