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 ksk, 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
| ) |  |

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 3070 of file libhsm.c.

References hsm_ctx_set_error().

Referenced by hsm_keytag().

## hsm_keytag()

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

Calculate keytag

Parameters

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

Definition at line 3014 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 | ) |

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 2360 of file libhsm.c.

References hsm_sign_params_t::owner.

Referenced by hsm_keytag().

## hsm_sign_params_new()

hsm_sign_params_t* hsm_sign_params_new | ( | void |  | ) |

Returns an allocated hsm_sign_params_t with some defaults

Definition at line 2343 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().

## 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
| ) |  |

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 2957 of file libhsm.c.