github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/go/tao/proto/keys.proto (about) 1 // Copyright (c) 2013, Google Inc. All rights reserved. 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 // http://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 syntax = "proto2"; 15 16 import "attestation.proto"; 17 18 package tao; 19 20 enum CryptoVersion { 21 CRYPTO_VERSION_1 = 1; 22 CRYPTO_VERSION_2 = 2; 23 } 24 25 // CryptoHeader has been changed to include: 26 // key_name, key_epoch, key_type, key_purpose, key_status (all strings). 27 // key_epoch is monotonically increasing integer 28 // key_status: "primary," "pre-primary", "post-primary," "inactive," "revoked" 29 // key_types: 30 // "aes-128-raw", "aes-256-raw", 31 // "aes128-ctr", "aes256-ctr", 32 // "aes128-ctr-hmacsha256", "aes256-ctr-hmacsha256", 33 // "hmacsha256", "hmacsha384", "hmacsha512", 34 // "rsa1024", "rsa2048", "rsa3072" 35 // "ecdsap256", "ecdsap384", "ecdsap384", 36 // "rsa1024-public", "rsa2048-public", "rsa3072-public" 37 // "ecdsap256-public", "ecdsap384-public" 38 // "hdkf-sha256" 39 // key_purpose: "verifying", "signing", "crypting", "deriving", "sealing" 40 message CryptoHeader { 41 required CryptoVersion version = 1; 42 optional string key_name = 2; 43 optional int32 key_epoch = 3; 44 optional string key_type = 4; 45 optional string key_purpose = 5; 46 optional string key_status = 6; 47 } 48 49 // CryptoKey 50 message CryptoKey { 51 required CryptoHeader key_header = 1; 52 repeated bytes key_components = 2; 53 } 54 55 message CryptoKeyset { 56 repeated bytes keys = 1; 57 // Cert for Signing Key 58 optional bytes cert = 2; 59 optional Attestation delegation = 3; 60 // certs supporting cert from cert signer to authority. 61 repeated bytes cert_chain = 4; 62 } 63 64 // Stacked Tao hosts can invoke their host Tao to seal a serialized CryptoKeyset 65 // (or individual CryptoKeys). 66 67 // PBEData is used by root Tao hosts to seal a serialized CryptoKeyset 68 // using a user-chosen password. 69 70 // TODO(jlm): Should cipher/hmac be replaced by CryptoHeader? 71 message PBEData { 72 required CryptoVersion version = 1; 73 required string cipher = 2; // "aes128-ctr" 74 required string hmac = 3; // "sha256" 75 required int32 iterations = 4; // 4096 76 required bytes iv = 5; 77 required bytes ciphertext = 6; 78 // TODO(kwalsh) Should this not use a mac as well for integrity protection? 79 required bytes salt = 7; 80 } 81 82 // Contextualized protobuf. 83 // SECURITY WARNING: Always choose a unique context for each unique type of 84 // message. One easy way to do this is to number the messages in a protocol 85 // and make the context "ProtocolName Message Y: ProtobufName Version X" 86 // Marshaled representation of this is the data that is signed. 87 message ContextualizedData { 88 required string context = 1; 89 required bytes data = 2; 90 } 91 92 // A PDU including metadata for representing data to be signed. The data is 93 // a serialized ContextualizedData message providing unique deserialization. 94 message SignaturePDU { 95 required CryptoHeader header = 1; 96 required string context = 2; 97 // The serialized ContextualizedData that is to be signed. 98 required bytes data = 3; 99 } 100 101 102 // The result of signing. 103 message SignedData { 104 required CryptoHeader header = 1; 105 required bytes signature = 2; 106 } 107 108 // A PDU to be serialized and signed for integrity-protection when using 109 // encryption modes (like AES CTR with HMAC-SHA) that require a separate MAC. 110 // Note: We actually just hmac the partially serialized EncryptedData message 111 // with all fields complete except the mac field. 112 message EncryptionIntegrityPDU { 113 required CryptoHeader header = 1; 114 required bytes iv = 2; 115 required bytes ciphertext = 3; 116 } 117 118 // The result of encrypting. 119 message EncryptedData { 120 required CryptoHeader header = 1; 121 required bytes iv = 2; 122 required bytes ciphertext = 3; 123 optional bytes mac = 4; // optional for modes that don't require mac 124 } 125 126 // A PDU to be serialized and fed to HKDF for derivation. 127 message KeyDerivationPDU { 128 required bytes previous_hash = 1; 129 required fixed32 size = 2; 130 required string context = 3; 131 required fixed32 index = 4; 132 } 133 134 message EcdsaSig { 135 required bytes r_val = 1; 136 required bytes s_val = 2; 137 }