unbound: sldns/keyraw.c File Reference

unbound 0.1

Functions
keyraw.c File Reference

Implementation of raw DNSKEY functions (work on wire rdata). More...

`#include "config.h"`
`#include "sldns/keyraw.h"`
`#include "sldns/rrdef.h"`

## Functions
size_t | sldns_rr_dnskey_key_size_raw (const unsigned char *keydata, const size_t len, int alg)
| get the length of the keydata in bits
uint16_t | sldns_calc_keytag_raw (uint8_t *key, size_t keysize)
| Calculates keytag of DNSSEC key, operates on wireformat rdata.

## Detailed Description

Implementation of raw DNSKEY functions (work on wire rdata).

## Function Documentation

## ◆ sldns_rr_dnskey_key_size_raw()

size_t sldns_rr_dnskey_key_size_raw | ( | const unsigned char * | keydata,
|  | const size_t | len,
|  | int | alg
| ) |  |

get the length of the keydata in bits

Parameters

  [in] | keydata | the raw key data
  [in] | len | the length of the keydata
  [in] | alg | the cryptographic algorithm this is a key for

Returns
  the keysize in bits, or 0 on error

Referenced by dnskey_get_keysize(), dnskey_size_is_supported(), and rr_comment_dnskey().

## ◆ sldns_calc_keytag_raw()

uint16_t sldns_calc_keytag_raw | ( | uint8_t * | key,
|  | size_t | keysize
| ) |  |

Calculates keytag of DNSSEC key, operates on wireformat rdata.

Parameters

  [in] | key | the key as uncompressed wireformat rdata.
  [in] | keysize | length of key data.

Returns
  the keytag

Referenced by auth_rr_to_string(), check_contains_revoked(), dnskey_calc_keytag(), rr_comment_dnskey(), and verbose_key().