OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009-2010 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 |
| 5 #ifndef TPM_INIT_SECURE_BLOB_H_ |
| 6 #define TPM_INIT_SECURE_BLOB_H_ |
| 7 |
| 8 #include <chromeos/utility.h> |
| 9 |
| 10 namespace tpm_init { |
| 11 |
| 12 typedef unsigned char SecureBlobElement; |
| 13 |
| 14 // SecureBlob erases the contents on destruction. It does not guarantee erasure |
| 15 // on resize, assign, etc. |
| 16 class SecureBlob : public chromeos::Blob { |
| 17 public: |
| 18 SecureBlob(); |
| 19 SecureBlob(chromeos::Blob::const_iterator begin, |
| 20 chromeos::Blob::const_iterator end); |
| 21 explicit SecureBlob(int size); |
| 22 SecureBlob(const unsigned char* from, int from_length); |
| 23 SecureBlob(const char* from, int from_length); |
| 24 virtual ~SecureBlob(); |
| 25 |
| 26 void resize(size_type sz); |
| 27 void resize(size_type sz, const SecureBlobElement& x); |
| 28 |
| 29 void clear_contents(); |
| 30 |
| 31 void* data(); |
| 32 const void* const_data() const; |
| 33 }; |
| 34 |
| 35 } // tpm_init |
| 36 |
| 37 #endif // TPM_INIT_SECURE_BLOB_H_ |
OLD | NEW |