nagendra modadugu | bdcfaa8 | 2017-09-17 17:11:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | syntax = "proto3"; |
| 18 | |
| 19 | package nugget.app.keymaster; |
| 20 | |
nagendra modadugu | ebfdd37 | 2017-10-25 23:52:25 -0700 | [diff] [blame] | 21 | import "nugget/app/keymaster/keymaster_defs.proto"; |
| 22 | |
Andrew Scull | b5f24a5 | 2017-10-13 19:46:40 +0100 | [diff] [blame] | 23 | message KeyParameter { |
nagendra modadugu | ebfdd37 | 2017-10-25 23:52:25 -0700 | [diff] [blame] | 24 | Tag tag = 1; /* Possible values defined here |
Andrew Scull | b5f24a5 | 2017-10-13 19:46:40 +0100 | [diff] [blame] | 25 | * ::android::hardware::keymaster::V3_0::Tag |
| 26 | */ |
| 27 | uint32 integer = 2; |
| 28 | uint64 long_integer = 3; |
| 29 | bytes blob = 4; |
| 30 | } |
| 31 | |
| 32 | message KeyParameters { |
| 33 | repeated KeyParameter params = 1; |
| 34 | } |
| 35 | |
| 36 | message KeyBlob { |
| 37 | bytes blob = 1; |
| 38 | } |
| 39 | |
| 40 | message OperationHandle { |
| 41 | uint64 handle = 1; |
| 42 | } |
| 43 | |
| 44 | message Certificate { |
| 45 | bytes data = 1; |
| 46 | } |
| 47 | |
| 48 | message CertificateChain { |
| 49 | repeated Certificate certificates = 1; |
| 50 | } |
| 51 | |
| 52 | message KeyCharacteristics { |
nagendra modadugu | c9c7697 | 2017-10-24 14:54:00 -0700 | [diff] [blame] | 53 | KeyParameters software_enforced = 1; |
| 54 | KeyParameters tee_enforced = 2; |
| 55 | } |
| 56 | |
nagendra modadugu | bdf53cd | 2017-12-04 21:28:02 -0800 | [diff] [blame] | 57 | message HmacSharingParameters { |
| 58 | bytes seed = 1; |
| 59 | bytes nonce = 2; |
| 60 | } |
| 61 | |
| 62 | message VerificationToken { |
| 63 | uint64 challenge = 1; |
| 64 | uint64 timestamp = 2; |
| 65 | KeyParameters params_verified = 3; |
| 66 | SecurityLevel security_level = 4; |
| 67 | bytes mac = 5; |
| 68 | } |
| 69 | |
nagendra modadugu | c9c7697 | 2017-10-24 14:54:00 -0700 | [diff] [blame] | 70 | /* |
| 71 | * Internal types. |
| 72 | */ |
| 73 | message RSAKey { |
| 74 | uint32 e = 1; |
| 75 | bytes d = 2; |
| 76 | bytes n = 3; |
| 77 | } |
| 78 | |
| 79 | message ECKey { |
| 80 | uint32 curve_id = 1; |
| 81 | bytes d = 2; |
| 82 | bytes x = 3; |
| 83 | bytes y = 4; |
| 84 | } |
| 85 | |
| 86 | message SymmetricKey { |
nagendra modadugu | 8e4a8fe | 2018-01-03 02:18:58 -0800 | [diff] [blame^] | 87 | bytes material = 1; |
Andrew Scull | b5f24a5 | 2017-10-13 19:46:40 +0100 | [diff] [blame] | 88 | } |