+/*----- Packing and unpacking keys ----------------------------------------*/
+
+/* --- @key_pack@ --- *
+ *
+ * Arguments: @key_packdef *kp@ = pointer to packing structure
+ * @key_data *kd@ = pointer to destination key data
+ * @dstr *d@ = pointer to tag string for the key data
+ *
+ * Returns: Error code, or zero.
+ *
+ * Use: Packs a key from a data structure.
+ */
+
+extern int key_pack(key_packdef */*kp*/, key_data */*kd*/, dstr */*d*/);
+
+/* --- @key_unpack@ --- *
+ *
+ * Arguments: @key_packdef *kp@ = pointer to packing structure
+ * @key_data *kd@ = pointer to source key data
+ * @dstr *d@ = pointer to tag string for the key data
+ *
+ * Returns: Error code, or zero.
+ *
+ * Use: Unpacks a key into an appropriate data structure.
+ */
+
+extern int key_unpack(key_packdef */*kp*/, key_data */*kd*/, dstr */*d*/);
+
+/* --- @key_unpackdone@ --- *
+ *
+ * Arguments: @key_packdef *kp@ = pointer to packing definition
+ *
+ * Returns: ---
+ *
+ * Use: Frees the key components contained within a packing
+ * definition, created during key unpacking.
+ */
+
+extern void key_unpackdone(key_packdef */*kp*/);
+
+/*----- Key encryption ----------------------------------------------------*/
+
+/* --- @key_lock@ --- *
+ *
+ * Arguments: @key_data *kt@ = destination block
+ * @key_data *k@ = source key data block
+ * @const void *e@ = secret to encrypt key with
+ * @size_t esz@ = size of the secret
+ *
+ * Returns: ---
+ *
+ * Use: Encrypts a key data block using a secret.
+ */
+
+extern void key_lock(key_data */*kt*/, key_data */*k*/,
+ const void */*e*/, size_t /*esz*/);
+
+/* --- @key_unlock@ --- *
+ *
+ * Arguments: @key_data *kt@ = target block
+ * @key_data *k@ = source key data block
+ * @const void *e@ = secret to decrypt the block with
+ * @size_t esz@ = size of the secret
+ *
+ * Returns: Zero for success, or a @KERR_@ error code.
+ *
+ * Use: Unlocks a key using a secret.
+ */
+
+extern int key_unlock(key_data */*kt*/, key_data */*k*/,
+ const void */*e*/, size_t /*esz*/);