ldns(3) Library Functions Manual ldns(3)

# [NAME](#NAME)

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

# [SYNOPSIS](#SYNOPSIS)

#include &lt;stdint.h&gt;  
#include &lt;stdbool.h&gt;

#include &lt;ldns/ldns.h&gt;

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](#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.  
**pkt**: the packet to verify  
**wire**: needed to verify the mac  
**wire\_size**: size of wire  
**key\_name**: the name of the shared key  
**key\_data**: the key in base 64 format  
**mac**: original mac  
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.  
**pkt**: the packet to sign  
**key\_name**: the name of the shared key  
**key\_data**: the key in base 64 format  
**fudge**: seconds of error permitted in time signed  
**algorithm\_name**: the name of the algorithm used  
**query\_mac**: is added to the digest if not NULL (so NULL is for signing queries, not NULL is for signing answers)  
Returns status (OK if success)

# [AUTHOR](#AUTHOR)

The ldns team at NLnet Labs.

# [REPORTING BUGS](#REPORTING_BUGS)

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

# [COPYRIGHT](#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](#SEE_ALSO)

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

# [REMARKS](#REMARKS)

This manpage was automatically generated from the ldns source code.

30 May 2006

---

Document: ldns_pkt_tsig_verify(3) from ldns 1.9.2-r2 (Chainguard OS)
Source: https://github.com/NLnetLabs/ldns.git
