summaryrefslogtreecommitdiff
path: root/host/lib/include/host_key.h
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/include/host_key.h')
-rw-r--r--host/lib/include/host_key.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/host/lib/include/host_key.h b/host/lib/include/host_key.h
index cdfc81bd..25b7f767 100644
--- a/host/lib/include/host_key.h
+++ b/host/lib/include/host_key.h
@@ -8,10 +8,12 @@
#ifndef VBOOT_REFERENCE_HOST_KEY_H_
#define VBOOT_REFERENCE_HOST_KEY_H_
+#include "2crypto.h"
#include "cryptolib.h"
#include "vboot_struct.h"
struct vb2_packed_key;
+struct vb2_private_key;
typedef struct rsa_st RSA;
@@ -23,9 +25,11 @@ typedef struct VbPrivateKey {
/* Read a private key from a .pem file. Caller owns the returned pointer,
- * and must free it with PrivateKeyFree(). */
+ * and must free() it. */
VbPrivateKey* PrivateKeyReadPem(const char* filename, uint64_t algorithm);
-
+struct vb2_private_key *vb2_read_private_key_pem(
+ const char *filename,
+ enum vb2_crypto_algorithm algorithm);
/* Free a private key. */
void PrivateKeyFree(VbPrivateKey* key);
@@ -33,13 +37,12 @@ void PrivateKeyFree(VbPrivateKey* key);
/* Write a private key to a file in .vbprivk format. */
int PrivateKeyWrite(const char* filename, const VbPrivateKey* key);
-/* Read a privake key from a .vbprivk file. Caller owns the returned
- * pointer, and must free it with PrivateKeyFree().
+/* Read a private key from a .vbprivk file. Caller owns the returned
+ * pointer, and must free() it.
*
* Returns NULL if error. */
VbPrivateKey* PrivateKeyRead(const char* filename);
-
-
+struct vb2_private_key *vb2_read_private_key(const char *filename);
/* Allocate a new public key with space for a [key_size] byte key. */
VbPublicKey* PublicKeyAlloc(uint64_t key_size, uint64_t algorithm,