Carlos IL | 3e5dd76 | 2017-10-06 22:35:10 | [diff] [blame^] | 1 | // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | // |
| 5 | |
| 6 | syntax = "proto2"; |
| 7 | |
| 8 | package encrypted_messages; |
| 9 | |
| 10 | // Chrome requires this. |
| 11 | option optimize_for = LITE_RUNTIME; |
| 12 | |
| 13 | // This protobuffer is intended to store an encrypted message. |
| 14 | // Messages are encrypted with a secret derived from a client key pair (which |
| 15 | // should be generated fresh randomly for each message) and a server public |
| 16 | // key. The remote message recipient can decrypt the message by performing the |
| 17 | // same key exchange using the included client public key to recover the shared |
| 18 | // secret. |
| 19 | message EncryptedMessage { |
| 20 | // An encrypted, serialized message. |
| 21 | required bytes encrypted_message = 1; |
| 22 | // The server public key version that was used to derive the shared secret. |
| 23 | required uint32 server_public_key_version = 2; |
| 24 | // The client public key that corresponds to the private key that was used |
| 25 | // to derive the shared secret. |
| 26 | required bytes client_public_key = 3; |
| 27 | // The encryption algorithm used to encrypt the message. |
| 28 | enum Algorithm { |
| 29 | UNKNOWN_ALGORITHM = 0; |
| 30 | AEAD_ECDH_AES_128_CTR_HMAC_SHA256 = 1; |
| 31 | } |
| 32 | optional Algorithm algorithm = 4 |
| 33 | [default = AEAD_ECDH_AES_128_CTR_HMAC_SHA256]; |
| 34 | }; |