X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/9f1b58fea081b172581719412abe83e660469f97..981bf1273304e1bc6604ea22b6ab4bd9ae07974b:/key.h diff --git a/key.h b/key.h index 09bcad5..05ba9a3 100644 --- a/key.h +++ b/key.h @@ -1,6 +1,6 @@ /* -*-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 * @@ -30,6 +30,12 @@ /*----- 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. * @@ -78,6 +84,10 @@ # include "key-data.h" #endif +#ifndef CATACOMB_GHASH_H +# include "ghash.h" +#endif + #ifndef CATACOMB_MP_H # include "mp.h" #endif @@ -197,6 +207,7 @@ enum { 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 */ }; @@ -374,6 +385,15 @@ extern key *key_new(key_file */*f*/, uint32 /*id*/, const char */*type*/, 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 @@ -408,6 +428,20 @@ extern int key_expire(key_file */*f*/, key */*k*/); 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@ --- *