summaryrefslogtreecommitdiff
path: root/tools/cert_create/include/key.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/cert_create/include/key.h')
-rw-r--r--tools/cert_create/include/key.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/tools/cert_create/include/key.h b/tools/cert_create/include/key.h
index 88197500..165ffa1c 100644
--- a/tools/cert_create/include/key.h
+++ b/tools/cert_create/include/key.h
@@ -35,6 +35,24 @@
#define RSA_KEY_BITS 2048
+/* Error codes */
+enum {
+ KEY_ERR_NONE,
+ KEY_ERR_MALLOC,
+ KEY_ERR_FILENAME,
+ KEY_ERR_OPEN,
+ KEY_ERR_LOAD
+};
+
+/* Supported key algorithms */
+enum {
+ KEY_ALG_RSA,
+#ifndef OPENSSL_NO_EC
+ KEY_ALG_ECDSA,
+#endif /* OPENSSL_NO_EC */
+ KEY_ALG_MAX_NUM
+};
+
/*
* This structure contains the relevant information to create the keys
* required to sign the certificates.
@@ -50,8 +68,8 @@ typedef struct key_s {
EVP_PKEY *key; /* Key container */
} key_t;
-int key_new(key_t *key);
-int key_load(key_t *key);
+int key_create(key_t *key, int type);
+int key_load(key_t *key, unsigned int *err_code);
int key_store(key_t *key);
#endif /* KEY_H_ */