chromium/services/network/trust_tokens/proto/public.proto

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto2";

package network;

// Mandatory boilerplate since Chromium only supports lite protobufs:
option optimize_for = LITE_RUNTIME;

// Message TrustToken represents a signed trust token received from
// an issuer.
message TrustToken {
  // The body of the token. This is an opaque string passed to
  // BoringSSL.
  optional bytes body = 1;  // required

  // The key with which the token was signed. Tokens
  // are only provided to servers while their commitment keys
  // remain active.
  optional bytes signing_key = 2;  // required

  // Creation time of the token.
  optional Timestamp creation_time = 3;
}

// A TrustTokenRedemptionRecord message stores state associated with a single
// Trust Token's redemption record ("RR"). The "body" field is the contents of
// the RR itself.
message TrustTokenRedemptionRecord {
  // The body of an RR contains an arbitrary bundle of issuer-provided bytes
  // set as part of the redemption.
  optional bytes body = 1;  // required

  // The token verification key for the token redeemed to obtain this RR.
  optional bytes token_verification_key = 4;  // required

  // Lifetime of the redemption record in seconds. Redemption record expires
  // lifetime many seconds after redemption. When omitted, a record is expired
  // when the relevant key is expired.
  optional uint64 lifetime = 5;

  // Creation time of the redemption record.
  optional Timestamp creation_time = 6;
}

message Timestamp {
  // Represents microseconds since the Windows epoch.
  required int64 micros = 1;
}