diff options
-rw-r--r-- | openpgp-ffi/src/fingerprint.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/openpgp-ffi/src/fingerprint.rs b/openpgp-ffi/src/fingerprint.rs index 2dac4224..d177029d 100644 --- a/openpgp-ffi/src/fingerprint.rs +++ b/openpgp-ffi/src/fingerprint.rs @@ -27,6 +27,25 @@ pub extern "system" fn pgp_fingerprint_from_bytes(buf: *const uint8_t, } /// Reads a hexadecimal fingerprint. +/// +/// # Example +/// +/// ```c +/// #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); +/// ``` #[::ffi_catch_abort] #[no_mangle] pub extern "system" fn pgp_fingerprint_from_hex(hex: *const c_char) -> *mut Fingerprint { |