Function gnunet_sys::GNUNET_IDENTITY_read_key_from_buffer [−][src]
pub unsafe extern "C" fn GNUNET_IDENTITY_read_key_from_buffer(
key: *mut GNUNET_IDENTITY_PublicKey,
buffer: *const c_void,
len: usize
) -> isize
Reads a #GNUNET_IDENTITY_PublicKey from a compact buffer. The buffer has to contain at least the compacted length of a #GNUNET_IDENTITY_PublicKey in bytes. If the buffer is too small, the function returns -1 as error. If the buffer does not contain a valid key, it returns -2 as error.
@param key the key @param buffer the buffer @param len the length of buffer @return -1 or -2 on error, else the amount of bytes read from the buffer