helper function for easy EdDSA key setup More...
Go to the source code of this file.
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "util-crypto-ecc", __VA_ARGS__) |
#define | LOG_STRERROR(kind, syscall) GNUNET_log_from_strerror (kind, "util-crypto-ecc", syscall) |
#define | LOG_STRERROR_FILE(kind, syscall, filename) GNUNET_log_from_strerror_file (kind, "util-crypto-ecc", syscall, filename) |
#define | LOG_GCRY(level, cmd, rc) |
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the message given by gcry_strerror(rc). More... | |
Functions | |
static enum GNUNET_GenericReturnValue | read_from_file (const char *filename, void *buf, size_t buf_size) |
Read file to buf. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_eddsa_key_from_file (const char *filename, int do_create, struct GNUNET_CRYPTO_EddsaPrivateKey *pkey) |
Create a new private key by reading it from a file. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecdsa_key_from_file (const char *filename, int do_create, struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey) |
Create a new private key by reading it from a file. More... | |
struct GNUNET_CRYPTO_EddsaPrivateKey * | GNUNET_CRYPTO_eddsa_key_create_from_configuration (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Create a new private key by reading our peer's key from the file specified in the configuration. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_get_peer_identity (const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_PeerIdentity *dst) |
Retrieve the identity of the host's peer. More... | |
void | GNUNET_CRYPTO_eddsa_setup_key (const char *cfg_name) |
Setup a key file for a peer given the name of the configuration file (!). More... | |
helper function for easy EdDSA key setup
Definition in file crypto_ecc_setup.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "util-crypto-ecc", __VA_ARGS__) |
Definition at line 31 of file crypto_ecc_setup.c.
#define LOG_STRERROR | ( | kind, | |
syscall | |||
) | GNUNET_log_from_strerror (kind, "util-crypto-ecc", syscall) |
Definition at line 33 of file crypto_ecc_setup.c.
#define LOG_STRERROR_FILE | ( | kind, | |
syscall, | |||
filename | |||
) | GNUNET_log_from_strerror_file (kind, "util-crypto-ecc", syscall, filename) |
Definition at line 36 of file crypto_ecc_setup.c.
#define LOG_GCRY | ( | level, | |
cmd, | |||
rc | |||
) |
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the message given by gcry_strerror(rc).
Definition at line 44 of file crypto_ecc_setup.c.
|
static |
Read file to buf.
Fails if the file does not exist or does not have precisely buf_size bytes.
filename | file to read | |
[out] | buf | where to write the file contents |
buf_size | number of bytes in buf |
Definition at line 1 of file crypto_ecc_setup.c.
void GNUNET_CRYPTO_eddsa_setup_key | ( | const char * | cfg_name | ) |
Setup a key file for a peer given the name of the configuration file (!).
This function is used so that at a later point code can be certain that reading a key is fast (for example in time-dependent testcases).
cfg_name | name of the configuration file to use |
Definition at line 301 of file crypto_ecc_setup.c.
References cfg, GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_destroy(), GNUNET_CONFIGURATION_load(), GNUNET_CRYPTO_eddsa_key_create_from_configuration(), and GNUNET_free.