blob: 2a83ad8222054c823dfccf357185f125d20388c3 [file] [log] [blame]
Zentaro Kavanagh26f0a732018-10-25 14:36:47 -07001// 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 Kavanagh8034a392018-11-21 10:25:33 -08005#ifndef LIBTPMCRYPTO_TPM_PROTO_UTILS_H_
6#define LIBTPMCRYPTO_TPM_PROTO_UTILS_H_
Zentaro Kavanagh26f0a732018-10-25 14:36:47 -07007
8#include <string>
9
10#include "libtpmcrypto/tpm_encrypted_data.pb.h"
11
12namespace brillo {
13class SecureBlob;
14} // namespace brillo
15
16namespace tpmcrypto {
17
18bool 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
24bool 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 Kavanagh8034a392018-11-21 10:25:33 -080032#endif // LIBTPMCRYPTO_TPM_PROTO_UTILS_H_