diff options
Diffstat (limited to 'src/mint/mint.h')
-rw-r--r-- | src/mint/mint.h | 102 |
1 files changed, 2 insertions, 100 deletions
diff --git a/src/mint/mint.h b/src/mint/mint.h index 0a0e00d04..1c5e9802e 100644 --- a/src/mint/mint.h +++ b/src/mint/mint.h | |||
@@ -20,20 +20,18 @@ | |||
20 | * @author Benedikt Mueller | 20 | * @author Benedikt Mueller |
21 | * | 21 | * |
22 | * TODO: | 22 | * TODO: |
23 | * - revisit and document `struct Deposit` members. | 23 | * - move DB functions to mint_db.h |
24 | */ | 24 | */ |
25 | #ifndef _MINT_H | 25 | #ifndef _MINT_H |
26 | #define _MINT_H | 26 | #define _MINT_H |
27 | 27 | ||
28 | #include <gnunet/gnunet_util_lib.h> | 28 | #include <gnunet/gnunet_util_lib.h> |
29 | #include <gnunet/gnunet_common.h> | 29 | #include <gnunet/gnunet_common.h> |
30 | #include <libpq-fe.h> | ||
31 | #include <jansson.h> | 30 | #include <jansson.h> |
31 | #include <libpq-fe.h> | ||
32 | #include "taler_util.h" | 32 | #include "taler_util.h" |
33 | #include "taler_signatures.h" | 33 | #include "taler_signatures.h" |
34 | 34 | ||
35 | #define DIR_SIGNKEYS "signkeys" | ||
36 | #define DIR_DENOMKEYS "denomkeys" | ||
37 | 35 | ||
38 | /** | 36 | /** |
39 | * For now, we just do EUR. Should become configurable | 37 | * For now, we just do EUR. Should become configurable |
@@ -41,31 +39,6 @@ | |||
41 | */ | 39 | */ |
42 | #define MINT_CURRENCY "EUR" | 40 | #define MINT_CURRENCY "EUR" |
43 | 41 | ||
44 | /** | ||
45 | * On disk format used for a mint signing key. | ||
46 | * Includes the private key followed by the signed | ||
47 | * issue message. | ||
48 | */ | ||
49 | struct TALER_MINT_SignKeyIssuePriv | ||
50 | { | ||
51 | struct GNUNET_CRYPTO_EddsaPrivateKey signkey_priv; | ||
52 | struct TALER_MINT_SignKeyIssue issue; | ||
53 | }; | ||
54 | |||
55 | |||
56 | |||
57 | struct TALER_MINT_DenomKeyIssuePriv | ||
58 | { | ||
59 | /** | ||
60 | * The private key of the denomination. Will be NULL if the private key is | ||
61 | * not available. | ||
62 | */ | ||
63 | struct GNUNET_CRYPTO_rsa_PrivateKey *denom_priv; | ||
64 | |||
65 | struct TALER_MINT_DenomKeyIssue issue; | ||
66 | }; | ||
67 | |||
68 | |||
69 | 42 | ||
70 | /** | 43 | /** |
71 | * Public information about a coin (including the public key | 44 | * Public information about a coin (including the public key |
@@ -357,77 +330,6 @@ struct Reserve | |||
357 | 330 | ||
358 | 331 | ||
359 | 332 | ||
360 | /** | ||
361 | * Iterator for sign keys. | ||
362 | * | ||
363 | * @param cls closure | ||
364 | * @param ski the sign key issue | ||
365 | * @return #GNUNET_OK to continue to iterate, | ||
366 | * #GNUNET_NO to stop iteration with no error, | ||
367 | * #GNUNET_SYSERR to abort iteration with error! | ||
368 | */ | ||
369 | typedef int | ||
370 | (*TALER_MINT_SignkeyIterator)(void *cls, | ||
371 | const struct TALER_MINT_SignKeyIssuePriv *ski); | ||
372 | |||
373 | /** | ||
374 | * Iterator for denomination keys. | ||
375 | * | ||
376 | * @param cls closure | ||
377 | * @param dki the denomination key issue | ||
378 | * @param alias coin alias | ||
379 | * @return #GNUNET_OK to continue to iterate, | ||
380 | * #GNUNET_NO to stop iteration with no error, | ||
381 | * #GNUNET_SYSERR to abort iteration with error! | ||
382 | */ | ||
383 | typedef int | ||
384 | (*TALER_MINT_DenomkeyIterator)(void *cls, | ||
385 | const char *alias, | ||
386 | const struct TALER_MINT_DenomKeyIssuePriv *dki); | ||
387 | |||
388 | |||
389 | |||
390 | /** | ||
391 | * FIXME | ||
392 | */ | ||
393 | int | ||
394 | TALER_MINT_signkeys_iterate (const char *mint_base_dir, | ||
395 | TALER_MINT_SignkeyIterator it, void *cls); | ||
396 | |||
397 | |||
398 | /** | ||
399 | * FIXME | ||
400 | */ | ||
401 | int | ||
402 | TALER_MINT_denomkeys_iterate (const char *mint_base_dir, | ||
403 | TALER_MINT_DenomkeyIterator it, void *cls); | ||
404 | |||
405 | |||
406 | /** | ||
407 | * Exports a denomination key to the given file | ||
408 | * | ||
409 | * @param filename the file where to write the denomination key | ||
410 | * @param dki the denomination key | ||
411 | * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure. | ||
412 | */ | ||
413 | int | ||
414 | TALER_MINT_write_denom_key (const char *filename, | ||
415 | const struct TALER_MINT_DenomKeyIssuePriv *dki); | ||
416 | |||
417 | |||
418 | /** | ||
419 | * Import a denomination key from the given file | ||
420 | * | ||
421 | * @param filename the file to import the key from | ||
422 | * @param dki pointer to return the imported denomination key | ||
423 | * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure | ||
424 | */ | ||
425 | int | ||
426 | TALER_MINT_read_denom_key (const char *filename, | ||
427 | struct TALER_MINT_DenomKeyIssuePriv *dki); | ||
428 | |||
429 | |||
430 | |||
431 | int | 333 | int |
432 | TALER_TALER_DB_extract_amount (PGresult *result, | 334 | TALER_TALER_DB_extract_amount (PGresult *result, |
433 | unsigned int row, | 335 | unsigned int row, |