Function caprock_key_identifier_public
Defined in File keys.h
Function Documentation
-
caprock_error_t caprock_key_identifier_public(caprock_field_identifier tag, void *buffer, size_t *bufsize, caprock_key const *pubkey, caprock_identifier_hash_length hash_length)
Given a public key, create an identifier from it.
- Parameters
tag – [in] The caprock_field_identifier tag to use; this can be one of CFI_ISSUER_IDv1, CFI_CLAIMv1_SUBJECT or CFI_CLAIMv1_OBJECT.
buffer – [out] The output buffer.
bufsize – [inout] The output buffer’s size in octets. On success, the amount of buffer used.
pubkey – [in] The public key to use as input.
hash_length – [in] Any of the hash length values in caprock_identifier_hash_length.
- Return values
CAPROCK_ERR_SUCCESS – On success.
CAPROCK_ERR_INVALID_VALUE – If any of the inputs are invalid.
CAPROCK_ERR_CODEC – If the identifier could not be serialized.