[][src]Function sequoia_openpgp_ffi::fingerprint::pgp_fingerprint_from_hex

#[no_mangle]
pub extern "C" fn pgp_fingerprint_from_hex(
    hex: *const c_char
) -> Maybe<Fingerprint>

Reads a hexadecimal fingerprint.

C Declaration

pgp_fingerprint_t
pgp_fingerprint_from_hex (const char *hex);

Example

#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <sequoia/openpgp.h>

pgp_fingerprint_t fp =
    pgp_fingerprint_from_hex ("D2F2C5D45BE9FDE6A4EE0AAF31855247603831FD");

char *pretty = pgp_fingerprint_to_string (fp);
assert (strcmp (pretty,
                "D2F2 C5D4 5BE9 FDE6 A4EE  0AAF 3185 5247 6038 31FD") == 0);

free (pretty);
pgp_fingerprint_free (fp);