Function caprock_key_read_public

Function Documentation

caprock_error_t caprock_key_read_public(caprock_key *pubkey, void const *buffer, size_t bufsize, char const *password)

Read a public key from a buffer.

Note that this is a thin wrapper around :cpp:function:s3kr1t::key::read_pubkey, so refer to that function for information on the formats of input data that can be understood.

Parameters
  • pubkey[out] They caprock_key structure to read the material into.

  • buffer[in] The buffer to read key material from.

  • bufsize[in] The size of the input buffer.

  • password[in] A NULL-terminated, optional password to decrypt the key material. Pass NULL if unused.

Return values
  • CAPROCK_ERR_SUCCESS – On success.

  • CAPROCK_ERR_INVALID_VALUE – If the input could not be read or buffers provided were too small, etc.