---
name: "ldns_key_set_keytag"
section: "3"
platform: "linux"
package: "ldns"
version: "1.9.2-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ldns_key_set_keytag"
---

# ldns\_key\_set\_keytag(3)

set ldns\_key attributes

## NAME

ldns\_key\_set\_algorithm, ldns\_key\_set\_rsa\_key, ldns\_key\_set\_dsa\_key, ldns\_key\_set\_hmac\_key, ldns\_key\_set\_origttl, ldns\_key\_set\_inception, ldns\_key\_set\_expiration, ldns\_key\_set\_pubkey\_owner, ldns\_key\_set\_keytag, ldns\_key\_set\_flags, ldns\_key\_list\_set\_key\_count, ldns\_key\_algo\_supported - set ldns\_key attributes

## SYNOPSIS

\#include \<stdint.h\>\
 \#include \<stdbool.h\>\

\#include \<ldns/ldns.h\>

void ldns\_key\_set\_algorithm(ldns\_key \*k, ldns\_signing\_algorithm l);

void ldns\_key\_set\_rsa\_key(ldns\_key \*k, RSA \*r);

void ldns\_key\_set\_dsa\_key(ldns\_key \*k, DSA \*d);

void ldns\_key\_set\_hmac\_key(ldns\_key \*k, unsigned char \*hmac);

void ldns\_key\_set\_origttl(ldns\_key \*k, uint32\_t t);

void ldns\_key\_set\_inception(ldns\_key \*k, uint32\_t i);

void ldns\_key\_set\_expiration(ldns\_key \*k, uint32\_t e);

void ldns\_key\_set\_pubkey\_owner(ldns\_key \*k, ldns\_rdf \*r);

void ldns\_key\_set\_keytag(ldns\_key \*k, uint16\_t tag);

void ldns\_key\_set\_flags(ldns\_key \*k, uint16\_t flags);

void ldns\_key\_list\_set\_key\_count(ldns\_key\_list \*key, size\_t count);

int ldns\_key\_algo\_supported(int algo);

## DESCRIPTION

*ldns\_key\_set\_algorithm*() Set the key's algorithm .br **k**: the key .br **l**: the algorithm

*ldns\_key\_set\_rsa\_key*() Set the key's rsa data. The rsa data should be freed by the user. .br **k**: the key .br **r**: the rsa data

*ldns\_key\_set\_dsa\_key*() Set the key's dsa data The dsa data should be freed by the user. .br **k**: the key .br **d**: the dsa data

*ldns\_key\_set\_hmac\_key*() Set the key's hmac data .br **k**: the key .br **hmac**: the raw key data

*ldns\_key\_set\_origttl*() Set the key's original ttl .br **k**: the key .br **t**: the ttl

*ldns\_key\_set\_inception*() Set the key's inception date (seconds after epoch) .br **k**: the key .br **i**: the inception

*ldns\_key\_set\_expiration*() Set the key's expiration date (seconds after epoch) .br **k**: the key .br **e**: the expiration

*ldns\_key\_set\_pubkey\_owner*() Set the key's pubkey owner .br **k**: the key .br **r**: the owner

*ldns\_key\_set\_keytag*() Set the key's key tag .br **k**: the key .br **tag**: the keytag

*ldns\_key\_set\_flags*() Set the key's flags .br **k**: the key .br **flags**: the flags

*ldns\_key\_list\_set\_key\_count*() Set the keylist's key count to count .br **key**: the key .br **count**: the count

*ldns\_key\_algo\_supported*() See if a key algorithm is supported .br **algo**: the signing algorithm number. .br Returns s true if supported.

## AUTHOR

The ldns team at NLnet Labs.

## REPORTING BUGS

Please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues

## COPYRIGHT

Copyright (c) 2004 - 2006 NLnet Labs.

Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO

*ldns\_key\_push\_key*, *ldns\_key*. And **perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034**  and **RFC4035**.

## REMARKS

This manpage was automatically generated from the ldns source code.
