+extern int key_delete(key_file */*f*/, key */*k*/);
+
+/* --- @key_expired@ --- *
+ *
+ * Arguments: @key *k@ = pointer to key block
+ *
+ * Returns: Zero if the key is OK, nonzero if it's expired.
+ */
+
+int key_expired(key */*k*/);
+
+/* --- @key_expire@ --- *
+ *
+ * Arguments: @key_file *f@ = pointer to file block
+ * @key *k@ = pointer to key block
+ *
+ * Returns: Error code (one of the @KERR@ constants).
+ *
+ * Use: Immediately marks the key as expired. It may be removed
+ * immediately, if it is no longer required, and will be removed
+ * by a tidy operation when it is no longer required. The key
+ * file must be writable.
+ */
+
+extern int key_expire(key_file */*f*/, key */*k*/);
+
+/* --- @key_used@ --- *
+ *
+ * Arguments: @key_file *f@ = pointer to key file
+ * @key *k@ = pointer to key block
+ * @time_t t@ = when key can be removed
+ *
+ * Returns: Zero if OK, nonzero on failure.
+ *
+ * Use: Marks a key as being required until a given time. Even
+ * though the key may expire before then (and won't be returned
+ * by type after that time), it will still be available when
+ * requested explicitly by id. The key file must be writable.
+ *
+ * The only (current) reason for failure is attempting to use
+ * a key which can expire for something which can't.
+ */
+
+extern int key_used(key_file */*f*/, key */*k*/, time_t /*t*/);
+
+/* --- @key_fingerprint@ --- *
+ *
+ * Arguments: @key *k@ = the key to fingerprint
+ * @ghash *h@ = the hash to use
+ * @const key_filter *kf@ = filter to apply
+ *
+ * Returns: Nonzero if the key slightly matched the filter.
+ *
+ * Use: Updates the hash context with the key contents.
+ */
+
+extern int key_fingerprint(key */*k*/, ghash */*h*/,
+ const key_filter */*kf*/);
+
+/*----- Setting and reading attributes ------------------------------------*/
+
+/* --- @key_chkident@ --- *
+ *
+ * Arguments: @const char *p@ = pointer to a type string
+ *
+ * Returns: Zero if OK, -1 on error.
+ *
+ * Use: Checks whether an identification component string is OK.
+ */
+
+extern int key_chkident(const char */*p*/);
+
+/* --- @key_chkcomment@ --- *
+ *
+ * Arguments: @const char *p@ = pointer to a comment string
+ *
+ * Returns: Zero if OK, -1 on error.
+ *
+ * Use: Checks whether a comment string is OK.
+ */
+
+extern int key_chkcomment(const char */*p*/);
+
+/* --- @key_setcomment@ --- *
+ *
+ * Arguments: @key_file *f@ = pointer to key file block
+ * @key *k@ = pointer to key block
+ * @const char *c@ = pointer to comment to set, or zero
+ *
+ * Returns: Error code (one of the @KERR@ constants).
+ *
+ * Use: Replaces the key's current comment with a new one.
+ */
+
+extern int key_setcomment(key_file */*f*/, key */*k*/, const char */*c*/);
+
+/* --- @key_settag@ --- *
+ *
+ * Arguments: @key_file *f@ = pointer to key file block
+ * @key *k@ = pointer to key block
+ * @const char *tag@ = pointer to comment to set, or zero
+ *
+ * Returns: Error code (one of the @KERR@ constants).
+ *
+ * Use: Replaces the key's current tag with a new one.
+ */
+
+extern int key_settag(key_file */*f*/, key */*k*/, const char */*tag*/);
+
+/* --- @key_setkeydata@ --- *
+ *
+ * Arguments: @key_file *kf@ = pointer to key file
+ * @key *k@ = pointer to key
+ * @key_data *kd@ = new key data
+ *
+ * Returns: Zero on success, or a @KERR_@ error code on failure.
+ *
+ * Use: Sets the key data for a key.
+ */
+
+extern int key_setkeydata(key_file */*kf*/, key */*k*/, key_data */*kd*/);
+
+/* --- @key_fulltag@ --- *
+ *
+ * Arguments: @key *k@ = pointer to key
+ * @dstr *d@ = pointer to destination string
+ *
+ * Returns: ---
+ *
+ * Use: Emits the key's full tag, which has the form
+ * `ID:TYPE[:TAG]'. This is used in the textual file format,
+ * and to identify passphrases for locked keys.
+ */
+
+extern void key_fulltag(key */*k*/, dstr */*d*/);
+
+/* --- @key_qtag@ --- *
+ *
+ * Arguments: @key_file *f@ = key file to find a key from
+ * @const char *tag@ = pointer to tag string
+ * @dstr *d@ = pointer to string for full tag name
+ * @key **k@ = where to store the key pointer
+ * @key_data ***kd@ = where to store the key data pointer
+ *
+ * Returns: Zero if OK, nonzero if it failed.
+ *
+ * Use: Performs a full lookup on a qualified tag name. The tag is
+ * qualified by the names of subkeys, separated by dots. Hence,
+ * a qualified tag is ID|TAG[.TAG...]. The various result
+ * pointers can be null to indicate that the result isn't
+ * interesting.
+ */
+
+extern int key_qtag(key_file */*f*/, const char */*tag*/,
+ dstr */*d*/, key **/*k*/, key_data ***/*kd*/);