Function gnunet_sys::GNUNET_CRYPTO_eddsa_key_from_file[][src]

pub unsafe extern "C" fn GNUNET_CRYPTO_eddsa_key_from_file(
    filename: *const c_char,
    do_create: c_int,
    pkey: *mut GNUNET_CRYPTO_EddsaPrivateKey
) -> c_int

@ingroup crypto @brief Create a new private key by reading it from a file.

If the files does not exist and @a do_create is set, creates a new key and write it to the file.

If the contents of the file are invalid, an error is returned.

@param filename name of file to use to store the key @param do_create should a file be created? @param[out] pkey set to the private key from @a filename on success @return #GNUNET_OK on success, #GNUNET_NO if @a do_create was set but we found an existing file, #GNUNET_SYSERR on failure