def make_sign_blob_call(rpc, bytes_to_sign):
 if (not isinstance(bytes_to_sign, str)):
  raise TypeError(('bytes_to_sign must be str: %s' % bytes_to_sign))
 request = app_identity_service_pb.SignForAppRequest()
 request.set_bytes_to_sign(bytes_to_sign)
 response = app_identity_service_pb.SignForAppResponse()
 def signing_for_app_result(rpc):
  'Check success, handle exceptions, and return converted RPC result.\n\n    This method waits for the RPC if it has not yet finished, and calls the\n    post-call hooks on the first invocation.\n\n    Args:\n      rpc: A UserRPC object.\n\n    Returns:\n      A tuple that contains signing key name and signature.\n    '
  assert (rpc.service == _APP_IDENTITY_SERVICE_NAME), repr(rpc.service)
  assert (rpc.method == _SIGN_FOR_APP_METHOD_NAME), repr(rpc.method)
  try:
   rpc.check_success()
  except apiproxy_errors.ApplicationError as err:
   raise _to_app_identity_error(err)
  return (response.key_name(), response.signature_bytes())
 rpc.make_call(_SIGN_FOR_APP_METHOD_NAME, request, response, signing_for_app_result)

def make_sign_blob_call ( rpc , bytes_to_sign ) : if ( not isinstance ( bytes_to_sign , str ) ) : raise TypeError ( ( 'bytes_to_sign must be str: %s' % bytes_to_sign ) ) request = app_identity_service_pb . SignForAppRequest ( ) request . set_bytes_to_sign ( bytes_to_sign ) response = app_identity_service_pb . SignForAppResponse ( ) def signing_for_app_result ( rpc ) : assert ( rpc . service == _APP_IDENTITY_SERVICE_NAME ) , repr ( rpc . service ) assert ( rpc . method == _SIGN_FOR_APP_METHOD_NAME ) , repr ( rpc . method ) try : rpc . check_success ( ) except apiproxy_errors . ApplicationError as err : raise _to_app_identity_error ( err ) return ( response . key_name ( ) , response . signature_bytes ( ) ) rpc . make_call ( _SIGN_FOR_APP_METHOD_NAME , request , response , signing_for_app_result )
executes the rpc call to sign a blob .