Zentaro Kavanagh | 26f0a73 | 2018-10-25 14:36:47 -0700 | [diff] [blame] | 1 | // Copyright 2018 The Chromium OS 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 | |
Zentaro Kavanagh | 8034a39 | 2018-11-21 10:25:33 -0800 | [diff] [blame] | 5 | #ifndef LIBTPMCRYPTO_TPM_PROTO_UTILS_H_ |
| 6 | #define LIBTPMCRYPTO_TPM_PROTO_UTILS_H_ |
Zentaro Kavanagh | 26f0a73 | 2018-10-25 14:36:47 -0700 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include "libtpmcrypto/tpm_encrypted_data.pb.h" |
| 11 | |
| 12 | namespace brillo { |
| 13 | class SecureBlob; |
| 14 | } // namespace brillo |
| 15 | |
| 16 | namespace tpmcrypto { |
| 17 | |
| 18 | bool CreateSerializedTpmCryptoProto(const brillo::SecureBlob& sealed_key, |
| 19 | const brillo::SecureBlob& iv, |
| 20 | const brillo::SecureBlob& tag, |
| 21 | const brillo::SecureBlob& encrypted_data, |
| 22 | std::string* serialized); |
| 23 | |
| 24 | bool ParseTpmCryptoProto(const std::string& serialized, |
| 25 | brillo::SecureBlob* sealed_key, |
| 26 | brillo::SecureBlob* iv, |
| 27 | brillo::SecureBlob* tag, |
| 28 | brillo::SecureBlob* encrypted_data); |
| 29 | |
| 30 | } // namespace tpmcrypto |
| 31 | |
Zentaro Kavanagh | 8034a39 | 2018-11-21 10:25:33 -0800 | [diff] [blame] | 32 | #endif // LIBTPMCRYPTO_TPM_PROTO_UTILS_H_ |