| // Copyright 2016 The Fuchsia Authors |
| // |
| // 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 cobalt; |
| |
| option go_package = "cobalt"; |
| |
| // An EncryptedMessage is used for several purposes in Cobalt. It carries |
| // the bytes of the ciphertext of the standard serialization of various |
| // types of proto messages. |
| message EncryptedMessage { |
| // The different schemes used to encrypt a message. |
| enum EncryptionScheme { |
| // The message is not encrypted. |ciphertext| contains plaintext bytes |
| // of a serialized protocol buffer message. |
| // This scheme must only be used in tests. |
| NONE = 0; |
| |
| // Hybrid Cipher using elliptic curve Diffie-Hellman, version 1. |
| HYBRID_ECDH_V1 = 1; |
| } |
| |
| // Which scheme was used to encrypt this message? |
| EncryptionScheme scheme = 1; |
| |
| // 32-byte fingerprint (SHA256) of the recipient’s public key. |
| // This is used to facilitate key rotation. |
| bytes public_key_fingerprint = 2; |
| |
| bytes ciphertext = 3; // The encryption of the standard serialization of some |
| // proto message. Which message is determined by |
| // context. |
| } |