libhsmdns.h File Reference
`#include <ldns/ldns.h>`

Go to the source code of this file.

## Data Structures

struct | hsm_sign_params_t

## Functions

hsm_sign_params_t * | hsm_sign_params_new (void)
void | hsm_sign_params_free (hsm_sign_params_t *params)
ldns_rr * | hsm_sign_rrset (hsm_ctx_t *ctx, const ldns_rr_list *rrset, const libhsm_key_t *key, const hsm_sign_params_t *sign_params)
ldns_rr * | hsm_get_dnskey (hsm_ctx_t *ctx, const libhsm_key_t *key, const hsm_sign_params_t *sign_params)
int | hsm_keytag (const char *loc, int alg, int sep, uint16_t *keytag)

## Function Documentation

## hsm_get_dnskey()

ldns_rr * hsm_get_dnskey | ( | hsm_ctx_t * | ctx,
|  | const libhsm_key_t * | key,
|  | const hsm_sign_params_t * | sign_params )

extern

Get DNSKEY RR

The returned ldns_rr structure can be freed with ldns_rr_free()

Parameters

  context | HSM context
  key | Key to get DNSKEY RR from
  sign_params | the signing parameters (flags, algorithm, etc)

Returns
  ldns_rr*

Definition at line 3266 of file libhsm.c.

References hsm_sign_params_t::algorithm, ctx, hsm_sign_params_t::flags, hsm_ctx_set_error(), and hsm_sign_params_t::owner.

Referenced by hsm_keytag(), and main().

## hsm_keytag()

int hsm_keytag | ( | const char * | loc,
|  | int | alg,
|  | int | sep,
|  | uint16_t * | keytag )

extern

Calculate keytag

Parameters

  | loc | Locator of keydata on HSM
  | alg | Algorithm of key
  | sep | 0 for zsk, positive int for ksk|csk (DNSKEY Secure Entry Point)
  [out] | keytag | the calculated keytag return: non-zero in case of failure

Definition at line 3210 of file libhsm.c.

References hsm_sign_params_t::algorithm, hsm_sign_params_t::flags, hsm_create_context(), hsm_destroy_context(), hsm_find_key_by_id(), hsm_get_dnskey(), hsm_sign_params_free(), hsm_sign_params_new(), libhsm_key_free(), and hsm_sign_params_t::owner.

## hsm_sign_params_free()

void hsm_sign_params_free | ( | hsm_sign_params_t * | params | ) |

extern

Free the signer parameters structure

If params->owner has been set, ldns_rdf_deep_free() will be called on it.

Parameters

  params | The signer parameters to free

Definition at line 2461 of file libhsm.c.

References hsm_sign_params_t::owner.

Referenced by hsm_keytag(), and main().

## hsm_sign_params_new()

hsm_sign_params_t * hsm_sign_params_new | ( | void |  | ) |

extern

Returns an allocated hsm_sign_params_t with some defaults

Definition at line 2447 of file libhsm.c.

References hsm_sign_params_t::algorithm, hsm_sign_params_t::expiration, hsm_sign_params_t::flags, hsm_sign_params_t::inception, hsm_sign_params_t::keytag, and hsm_sign_params_t::owner.

Referenced by hsm_keytag(), and main().

## hsm_sign_rrset()

ldns_rr * hsm_sign_rrset | ( | hsm_ctx_t * | ctx,
|  | const ldns_rr_list * | rrset,
|  | const libhsm_key_t * | key,
|  | const hsm_sign_params_t * | sign_params )

extern

Sign RRset using key

The returned ldns_rr structure can be freed with ldns_rr_free()

Parameters

  context | HSM context
  rrset | RRset to sign
  key | Key pair used to sign

Returns
  ldns_rr* Signed RRset

Definition at line 3153 of file libhsm.c.

References hsm_sign_params_t::algorithm, and ctx.

Referenced by main().