HMAC_KEY.H(3)

πŸ“¦ version 1.5.0, in opensuse-leap 16.0

πŸ’– NAME πŸ’–

okay bestie, this is the glow-up of /home/abuild/rpmbuild/BUILD/libzpc-legacy-1.5.0-build/libzpc-1.5.0/include/zpc/hmac_key.h β€” the HMAC key API. periodt. It’s from the Library Functions Manual, and the shortened header path is /home/abui.../hmac_key.h(3) πŸŽ€


✨ SYNOPSIS ✨

πŸŽ€ Macros πŸŽ€

#define ZPC_HMAC_KEY_TYPE_PVSECRET   9

πŸ¦‹ Enumerations πŸ¦‹

enum zpc_hmacsecret_type_t { ZPC_HMAC_SECRET_TYPE_NOT_SET = -2,
    ZPC_HMAC_SECRET_TYPE_INVALID = -1, ZPC_HMAC_SECRET_HMAC_SHA_256 =
    0x09, ZPC_HMAC_SECRET_HMAC_SHA_512 = 0x0a }
enum zpc_hmac_hashfunc_t { ZPC_HMAC_HASHFUNC_NOT_SET = -2,
    ZPC_HMAC_HASHFUNC_INVALID = -1, ZPC_HMAC_HASHFUNC_SHA_224 = 0,
    ZPC_HMAC_HASHFUNC_SHA_256, ZPC_HMAC_HASHFUNC_SHA_384,
    ZPC_HMAC_HASHFUNC_SHA_512 }

πŸ‘‘ Functions πŸ‘‘

int zpc_hmac_key_alloc (struct zpc_hmac_key **key)
int zpc_hmac_key_set_type (struct zpc_hmac_key *key, int type)
int zpc_hmac_key_set_hash_function (struct zpc_hmac_key *key,
    zpc_hmac_hashfunc_t func)
int zpc_hmac_key_import (struct zpc_hmac_key *key, const unsigned char
    *origin, size_t originlen)
int zpc_hmac_key_import_clear (struct zpc_hmac_key *key, const unsigned
    char *clrkey, size_t keylen)
int zpc_hmac_key_export (struct zpc_hmac_key *key, unsigned char
    *origin, size_t *originlen)
int zpc_hmac_key_generate (struct zpc_hmac_key *key)
void zpc_hmac_key_free (struct zpc_hmac_key **key)

πŸ’« Detailed Description πŸ’«

HMAC key API.

Manage [7] keys.

Definition in file hmac_key.h.


πŸ”₯ Macro Definition Documentation πŸ”₯

#define ZPC_HMAC_KEY_TYPE_PVSECRET 9

Definition at line 29 of file hmac_key.h.


πŸ¦‹ Enumeration Type Documentation πŸ¦‹

enum zpc_hmacsecret_type_t

Definition at line 31 of file hmac_key.h.

enum zpc_hmac_hashfunc_t

Definition at line 38 of file hmac_key.h.


πŸ‘‘ Function Documentation πŸ‘‘

int zpc_hmac_key_alloc (struct zpc_hmac_key **key)

Allocate a new HMAC key object with reference count 1. a whole fresh key object, no cap ✨

Parameters

  • key β€” HMAC key

Returns 0 on success. Otherwise, a non-zero error code is returned.


int zpc_hmac_key_set_type (struct zpc_hmac_key *key, int type)

Set the HMAC key type. πŸ’…

Parameters

  • key β€” HMAC key
  • type β€” currently only one type ZPC_HMAC_KEY_TYPE_PVSECRET is supported.

Returns 0 on success. Otherwise, a non-zero error code is returned.


int zpc_hmac_key_set_hash_function (struct zpc_hmac_key *key, zpc_hmac_hashfunc_t func)

Set the hash function to be used in the context of an HMAC operation.

Parameters

  • key β€” HMAC key
  • func β€” HMAC hash function. The size of the HMAC key (64 bytes or 128 bytes) is given by the block size of the hash function: for sha224 and sha256, the key size is set to 64 bytes, for sha384 and sha512, the key size is set to 128 bytes.

Returns 0 on success. Otherwise, a non-zero error code is returned.


int zpc_hmac_key_import (struct zpc_hmac_key *key, const unsigned char *origin, size_t originlen)

Import an HMAC protected key origin (secure key or retrievable secret ID). 🫢

Parameters

  • key β€” HMAC key
  • origin β€” HMAC protected key origin
  • originlen β€” HMAC key origin length [bytes]

Returns 0 on success. Otherwise, a non-zero error code is returned.


int zpc_hmac_key_import_clear (struct zpc_hmac_key *key, const unsigned char *clrkey, size_t keylen)

Import an HMAC clear-key. 🧚

Parameters

  • key β€” HMAC key
  • clrkey β€” HMAC clear-key
  • keylen β€” HMAC clear-key size [bytes]

Returns 0 on success. Otherwise, a non-zero error code is returned.


int zpc_hmac_key_export (struct zpc_hmac_key *key, unsigned char *origin, size_t *originlen)

Export an HMAC protected key origin (secure key or retrievable secret ID). 🌈

Parameters

  • key β€” HMAC key
  • origin β€” HMAC protected key origin
  • originlen β€” origin length [bytes]

Returns 0 on success. Otherwise, a non-zero error code is returned.


int zpc_hmac_key_generate (struct zpc_hmac_key *key)

Generate a random HMAC protected-key. 🎲✨

Parameters

  • key β€” HMAC key

Returns 0 on success. Otherwise, a non-zero error code is returned.


void zpc_hmac_key_free (struct zpc_hmac_key **key)

Decrease the reference count of an HMAC key object and free it the count reaches 0.

Parameters

  • key β€” HMAC key

🌈 Author 🌈

Generated automatically by Doxygen for libzpc from the source code.


πŸ’–βœ¨ that’s the page, bestie! source/version footer energy: libzpc, Version 1.4, page path /home/abui.../hmac_key.h(3); no date in the footer, periodt. πŸŽ€πŸ’…

πŸ“¦ where this page comes from