---
name: "ldns_pkt_tsig_verify"
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_pkt_tsig_verify"
---

# ldns\_pkt\_tsig\_verify(3)

tsig signing and verification

## NAME

ldns\_pkt\_tsig\_verify, ldns\_pkt\_tsig\_sign - tsig signing and verification

## SYNOPSIS

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

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

bool ldns\_pkt\_tsig\_verify(ldns\_pkt \*pkt, const uint8\_t \*wire, size\_t wire\_size, const char \*key\_name, const char \*key\_data, const ldns\_rdf \*mac);

ldns\_status ldns\_pkt\_tsig\_sign(ldns\_pkt \*pkt, const char \*key\_name, const char \*key\_data, uint16\_t fudge, const char \*algorithm\_name, const ldns\_rdf \*query\_mac);

## DESCRIPTION

*ldns\_pkt\_tsig\_verify*() verifies the tsig rr for the given packet and key. The wire must be given too because tsig does not sign normalized packets. .br **pkt**: the packet to verify .br **wire**: needed to verify the mac .br **wire\_size**: size of wire .br **key\_name**: the name of the shared key .br **key\_data**: the key in base 64 format .br **mac**: original mac .br Returns true if tsig is correct, false if not, or if tsig is not set

*ldns\_pkt\_tsig\_sign*() creates a tsig rr for the given packet and key. .br **pkt**: the packet to sign .br **key\_name**: the name of the shared key .br **key\_data**: the key in base 64 format .br **fudge**: seconds of error permitted in time signed .br **algorithm\_name**: the name of the algorithm used .br **query\_mac**: is added to the digest if not NULL (so NULL is for signing queries, not NULL is for signing answers) .br Returns status (OK if success)

## 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*. And **perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034**  and **RFC4035**.

## REMARKS

This manpage was automatically generated from the ldns source code.
