xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/blind_sign_auth/proto/spend_token_data.proto (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS-IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package privacy.ppn;
18
19import "quiche/blind_sign_auth/proto/public_metadata.proto";
20import "anonymous_tokens/proto/anonymous_tokens.proto";
21
22message SpendTokenData {
23  // Public metadata associated with the token being spent.
24  // See go/ppn-token-spend and go/ppn-phosphor-at-service for details.
25  PublicMetadata public_metadata = 1;
26  // The unblinded token to be spent which was blind-signed by Phosphor.
27  bytes unblinded_token = 2;
28  // The signature for the token to be spent, obtained from Phosphor and
29  // unblinded.
30  bytes unblinded_token_signature = 3;
31  // The version number of the signing key that was used during blind-signing.
32  uint64 signing_key_version = 4;
33  // A use case identifying the caller. Should be a fixed, hardcoded value to
34  // prevent cross-spending tokens.
35  anonymous_tokens.AnonymousTokensUseCase use_case = 5;
36  // Nonce used to mask plaintext message before cryptographic verification.
37  bytes message_mask = 6;
38  // General public metadata. Use deserializer to inspect. Only set one of this
39  // or public_metadata.
40  bytes binary_public_metadata = 7;
41}
42
43message PrivacyPassTokenData {
44  // The base64 encoded Privacy Pass token.
45  string token = 1;
46  // The base64 encoded, Privacy Pass compliant binary public metadata.
47  string encoded_extensions = 2;
48  // Populate only for testing, this will affect which public key is used.
49  anonymous_tokens.AnonymousTokensUseCase use_case_override =
50      3;
51}
52