// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package fcp.confidentialcompute;

import "fcp/protos/confidentialcompute/payload_metadata.proto";

option java_multiple_files = true;

// A header included with each uploaded data blob, documenting how it was
// encrypted and how it may be used.
message BlobHeader {
  // A unique random identifier for the blob.
  bytes blob_id = 1;

  // The identifier for the public key used to encrypt the blob.
  fixed32 public_key_id = 2 [deprecated = true];

  // The COSE "kid" property (RFC 9052) of the asymmetric key used to encrypt
  // the blob.
  bytes key_id = 5;

  // A SHA-256 hash of the access policy to use for the blob.
  bytes access_policy_sha256 = 3;

  // The id of the AccessPolicy node corresponding to this blob. This data will
  // only be used by transforms with a matching `src` field. This field should
  // be 0 for non-derived blobs.
  uint32 access_policy_node_id = 4;

  // The metadata about the data blob to be uploaded to the server.
  PayloadMetadata payload_metadata = 7;

  reserved 6;
}
