summaryrefslogtreecommitdiffstats
path: root/keystore/keystore.h
diff options
context:
space:
mode:
Diffstat (limited to 'keystore/keystore.h')
-rw-r--r--keystore/keystore.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/keystore/keystore.h b/keystore/keystore.h
index 0c2dac5..fe2ce56 100644
--- a/keystore/keystore.h
+++ b/keystore/keystore.h
@@ -91,4 +91,23 @@ command_code_t CommandCodes[] = {
'y', // UNGRANT
};
+/**
+ * Returns the size of the softkey magic header value for measuring
+ * and allocating purposes.
+ */
+size_t get_softkey_header_size();
+
+/**
+ * Adds the magic softkey header to a key blob.
+ *
+ * Returns NULL if the destination array is too small. Otherwise it
+ * returns the offset directly after the magic value.
+ */
+uint8_t* add_softkey_header(uint8_t* key_blob, size_t key_blob_length);
+
+/**
+ * Returns true if the key blob has a magic softkey header at the beginning.
+ */
+bool is_softkey(const uint8_t* key_blob, const size_t key_blob_length);
+
#endif