diff options
author | NingSun <ning.sun@intel.com> | 2018-03-27 10:42:51 -0700 |
---|---|---|
committer | NingSun <ning.sun@intel.com> | 2018-03-28 16:03:21 -0700 |
commit | 8a5b33a9ba846d785d244e29bc29a46f7be34928 (patch) | |
tree | a5b6ad7d3950a57fefd60dd1200c4ce52dd959b5 /TPM2-Plugin/lib/include/files.h | |
parent | da00ff6db5e68773996ec79d711c45fb3444c580 (diff) |
Add more codes in tpm2-plugin
Implement tpm2_plugin_load_key() and tpm2_plugin_rsa_sign() APIs
Issue-ID: AAF-94
Change-Id: I5f4329fdf973e52264d9e0e8aabc864c5fbdeebf
Signed-off-by: NingSun <ning.sun@intel.com>
Diffstat (limited to 'TPM2-Plugin/lib/include/files.h')
-rw-r--r-- | TPM2-Plugin/lib/include/files.h | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/TPM2-Plugin/lib/include/files.h b/TPM2-Plugin/lib/include/files.h index 164e308..a4befc8 100644 --- a/TPM2-Plugin/lib/include/files.h +++ b/TPM2-Plugin/lib/include/files.h @@ -34,7 +34,7 @@ #include <stdbool.h> #include <stdio.h> -#include <sapi/tpm20.h> +#include <tss2/tss2_sys.h> /** * Reads a series of bytes from a file as a byte array. This is similar to files_read_bytes(), @@ -214,6 +214,16 @@ bool files_load_ticket(const char *path, TPMT_TK_VERIFIED *ticket); bool files_load_sensitive(const char *path, TPM2B_SENSITIVE *sensitive); /** + * Serializes a TPM2B_SENSITIVE to the file path provided. + * @param sensitive + * The TPM2B_SENSITIVE to save to disk. + * @param path + * The path to save to. + * @return + * true on success, false on error. + */ +bool files_save_sensitive(TPM2B_SENSITIVE *sensitive, const char *path); +/** * Serializes a TPMT_TK_HASHCHECK to the file path provided. * @param validation * The TPMT_TK_HASHCHECK to save to disk. @@ -236,6 +246,28 @@ bool files_save_validation(TPMT_TK_HASHCHECK *validation, const char *path); bool files_load_validation(const char *path, TPMT_TK_HASHCHECK *validation); /** + * Serializes a TPM2B_PRIVATE to the file path provided. + * @param private + * The TPM2B_PRIVATE to save to disk. + * @param path + * The path to save to. + * @return + * true on success, false on error. + */ +bool files_save_private(TPM2B_PRIVATE *private, const char *path); + +/** + * Loads a TPM2B_PRIVATE from disk. + * @param private + * The path to load from. + * @param validation + * The TPM2B_PRIVATE to load. + * @return + * true on success, false on error. + */ +bool files_load_private(const char *path, TPM2B_PRIVATE *private); + +/** * Checks a file for existence. * @param path * The file to check for existence. |