/* -*-c-*-
*
- * $Id: key.h,v 1.8 2001/02/03 11:57:38 mdw Exp $
+ * $Id: key.h,v 1.10 2004/04/08 01:02:49 mdw Exp $
*
* Simple key management
*
/*----- Revision history --------------------------------------------------*
*
* $Log: key.h,v $
+ * Revision 1.10 2004/04/08 01:02:49 mdw
+ * key-binary.c
+ *
+ * Revision 1.9 2001/06/22 19:37:59 mdw
+ * New interface to enquire whether a key has expired.
+ *
* Revision 1.8 2001/02/03 11:57:38 mdw
* Allow creating keyfiles with no file attached.
*
# include "key-data.h"
#endif
+#ifndef CATACOMB_GHASH_H
+# include "ghash.h"
+#endif
+
#ifndef CATACOMB_MP_H
# include "mp.h"
#endif
KERR_BADPASS = -10, /* Error decrypting locked key */
KERR_WRONGTYPE = -11, /* Key has incorrect type */
KERR_NOTFOUND = -12, /* Key couldn't be found */
+ KERR_BADATTR = -13, /* Malformed attribute name */
KERR_MAX /* Largest possible error */
};
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
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@ --- *