aboutsummaryrefslogtreecommitdiff
path: root/tools/cert_create/include/key.h
diff options
context:
space:
mode:
authorJuan Castillo <juan.castillo@arm.com>2015-06-12 11:27:59 +0100
committerJuan Castillo <juan.castillo@arm.com>2015-07-16 14:31:20 +0100
commit55e291a4058633300deafabe62db7e2885f0afb5 (patch)
treeb1e0d284711d4e484f43bbf6a189484d341e5178 /tools/cert_create/include/key.h
parent484bb38509e8822d8b1fde93e215eb0e7abdf86d (diff)
downloadtrusted-firmware-a-55e291a4058633300deafabe62db7e2885f0afb5.tar.gz
TBB: rework cert_create tool to follow a data driven approach
This patch reworks the certificate generation tool to follow a data driven approach. The user may specify at build time the certificates, keys and extensions defined in the CoT, register them using the appropiate macros and the tool will take care of creating the certificates corresponding to the CoT specified. Change-Id: I29950b39343c3e1b71718fce0e77dcf2a9a0be2f
Diffstat (limited to 'tools/cert_create/include/key.h')
-rw-r--r--tools/cert_create/include/key.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/cert_create/include/key.h b/tools/cert_create/include/key.h
index 165ffa1cf..da9f1195a 100644
--- a/tools/cert_create/include/key.h
+++ b/tools/cert_create/include/key.h
@@ -68,8 +68,18 @@ typedef struct key_s {
EVP_PKEY *key; /* Key container */
} key_t;
+/* Exported API */
int key_create(key_t *key, int type);
int key_load(key_t *key, unsigned int *err_code);
int key_store(key_t *key);
+/* Macro to register the keys used in the CoT */
+#define REGISTER_KEYS(_keys) \
+ key_t *keys = &_keys[0]; \
+ const unsigned int num_keys = sizeof(_keys)/sizeof(_keys[0]);
+
+/* Exported variables */
+extern key_t *keys;
+extern const unsigned int num_keys;
+
#endif /* KEY_H_ */