File: gcm_encryption_data.proto

package info (click to toggle)
chromium-browser 57.0.2987.98-1~deb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 2,637,852 kB
  • ctags: 2,544,394
  • sloc: cpp: 12,815,961; ansic: 3,676,222; python: 1,147,112; asm: 526,608; java: 523,212; xml: 286,794; perl: 92,654; sh: 86,408; objc: 73,271; makefile: 27,698; cs: 18,487; yacc: 13,031; tcl: 12,957; pascal: 4,875; ml: 4,716; lex: 3,904; sql: 3,862; ruby: 1,982; lisp: 1,508; php: 1,368; exp: 404; awk: 325; csh: 117; jsp: 39; sed: 37
file content (56 lines) | stat: -rw-r--r-- 1,844 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;

package gcm;

// Stores a public/private key-pair.
// Next tag: 5
message KeyPair {
  // The type of key used for key agreement. Currently only the ECDH key
  // agreement scheme is supported, using NIST P-256.
  enum KeyType {
    ECDH_P256 = 0;
  }

  required KeyType type = 1;

  // The private key matching the size requirements of |type|.
  optional bytes private_key = 2;

  // The public key as an X.509 SubjectPublicKeyInfo block.
  optional bytes public_key_x509 = 3;

  // The public key as an uncompressed EC point according to SEC 2.3.3.
  optional bytes public_key = 4;
}

// Stores a vector of public/private key-pairs associated with an app id and
// optionally the authorized entity of an instance id token.
//
// In the current implementation, each (app_id, authorized_entity) pair will
// have a single encryption key-pair associated with it at most. The message
// allows for multiple key pairs in case we need to force-cycle all keys,
// allowing the old keys to remain valid for a period of time enabling the web
// app to update.
//
// Next tag: 5
message EncryptionData {
  // The app id to whom this encryption data belongs.
  required string app_id = 1;

  // The sender id of the instance id token that this encryption data belongs
  // to. Must not be empty. Must be omitted for non-InstanceID registrations.
  optional string authorized_entity = 4;

  // The actual public/private key-pairs.
  repeated KeyPair keys = 2;

  // The authentication secret associated with the subscription. Must be a
  // cryptographically secure number of at least 12 bytes.
  optional bytes auth_secret = 3;
}