documenting

This commit is contained in:
Christian Grothoff 2015-03-15 17:39:44 +01:00
parent ee2180b144
commit ca8612b6db
2 changed files with 76 additions and 7 deletions

View File

@ -21,18 +21,39 @@
* @author Benedikt Mueller * @author Benedikt Mueller
* @author Sree Harsha Totakura * @author Sree Harsha Totakura
* @author Christian Grothoff * @author Christian Grothoff
*
* TODO:
* - document better
* - revisit IO with respect to variable-size RSA keys!
*/ */
#include "platform.h" #include "platform.h"
#include "key_io.h" #include "key_io.h"
/**
*
*/
struct SignkeysIterateContext struct SignkeysIterateContext
{ {
/**
*
*/
TALER_MINT_SignkeyIterator it; TALER_MINT_SignkeyIterator it;
/**
*
*/
void *it_cls; void *it_cls;
}; };
/**
*
*
* @param cls
* @param filename
* @return
*/
static int static int
signkeys_iterate_dir_iter (void *cls, signkeys_iterate_dir_iter (void *cls,
const char *filename) const char *filename)
@ -181,19 +202,40 @@ TALER_MINT_write_denom_key (const char *filename,
} }
/**
*
*/
struct DenomkeysIterateContext struct DenomkeysIterateContext
{ {
/**
*
*/
const char *alias; const char *alias;
/**
*
*/
TALER_MINT_DenomkeyIterator it; TALER_MINT_DenomkeyIterator it;
/**
*
*/
void *it_cls; void *it_cls;
}; };
/**
*
*
* @param cls
* @param filename
* @return
*/
static int static int
denomkeys_iterate_keydir_iter (void *cls, denomkeys_iterate_keydir_iter (void *cls,
const char *filename) const char *filename)
{ {
struct DenomkeysIterateContext *dic = cls; struct DenomkeysIterateContext *dic = cls;
struct TALER_MINT_DenomKeyIssuePriv issue; struct TALER_MINT_DenomKeyIssuePriv issue;
@ -206,10 +248,19 @@ denomkeys_iterate_keydir_iter (void *cls,
filename); filename);
return GNUNET_OK; return GNUNET_OK;
} }
return dic->it (dic->it_cls, dic->alias, &issue); return dic->it (dic->it_cls,
dic->alias,
&issue);
} }
/**
*
*
* @param cls
* @param filename
* @return
*/
static int static int
denomkeys_iterate_topdir_iter (void *cls, denomkeys_iterate_topdir_iter (void *cls,
const char *filename) const char *filename)
@ -229,7 +280,8 @@ denomkeys_iterate_topdir_iter (void *cls,
int int
TALER_MINT_denomkeys_iterate (const char *mint_base_dir, TALER_MINT_denomkeys_iterate (const char *mint_base_dir,
TALER_MINT_DenomkeyIterator it, void *cls) TALER_MINT_DenomkeyIterator it,
void *it_cls)
{ {
char *dir; char *dir;
size_t len; size_t len;
@ -241,7 +293,7 @@ TALER_MINT_denomkeys_iterate (const char *mint_base_dir,
GNUNET_assert (len > 0); GNUNET_assert (len > 0);
dic.it = it; dic.it = it;
dic.it_cls = cls; dic.it_cls = it_cls;
// scan over alias dirs // scan over alias dirs
return GNUNET_DISK_directory_scan (dir, return GNUNET_DISK_directory_scan (dir,
@ -250,5 +302,4 @@ TALER_MINT_denomkeys_iterate (const char *mint_base_dir,
} }
/* end of key_io.c */
/* end of mint_common.c */

View File

@ -29,9 +29,17 @@
#include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_util_lib.h>
#include "taler_signatures.h" #include "taler_signatures.h"
/**
*
*/
#define DIR_SIGNKEYS "signkeys" #define DIR_SIGNKEYS "signkeys"
/**
*
*/
#define DIR_DENOMKEYS "denomkeys" #define DIR_DENOMKEYS "denomkeys"
/** /**
* On disk format used for a mint signing key. * On disk format used for a mint signing key.
* Includes the private key followed by the signed * Includes the private key followed by the signed
@ -104,6 +112,11 @@ typedef int
/** /**
* FIXME * FIXME
*
* @param mint_base_dir
* @param it
* @param it_cls closure for @a it
* @return
*/ */
int int
TALER_MINT_signkeys_iterate (const char *mint_base_dir, TALER_MINT_signkeys_iterate (const char *mint_base_dir,
@ -113,6 +126,11 @@ TALER_MINT_signkeys_iterate (const char *mint_base_dir,
/** /**
* FIXME * FIXME
*
* @param mint_base_dir
* @param it
* @param it_cls closure for @a it
* @return
*/ */
int int
TALER_MINT_denomkeys_iterate (const char *mint_base_dir, TALER_MINT_denomkeys_iterate (const char *mint_base_dir,