---
name: "ldns_key2buffer_str"
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_key2buffer_str"
---

# ldns\_key2buffer\_str(3)

lower level conversions

## NAME

ldns\_pkt2buffer\_str, ldns\_pktheader2buffer\_str, ldns\_rr2buffer\_str, ldns\_rr\_list2buffer\_str, ldns\_rdf2buffer\_str, ldns\_key2buffer\_str, ldns\_pkt2buffer\_wire, ldns\_rr2buffer\_wire, ldns\_rdf2buffer\_wire, ldns\_rrsig2buffer\_wire, ldns\_rr\_rdata2buffer\_wire - lower level conversions

## SYNOPSIS

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

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

ldns\_status ldns\_pkt2buffer\_str(ldns\_buffer \*output, const ldns\_pkt \*pkt);

ldns\_status ldns\_pktheader2buffer\_str(ldns\_buffer \*output, const ldns\_pkt \*pkt);

ldns\_status ldns\_rr2buffer\_str(ldns\_buffer \*output, const ldns\_rr \*rr);

ldns\_status ldns\_rr\_list2buffer\_str(ldns\_buffer \*output, const ldns\_rr\_list \*list);

ldns\_status ldns\_rdf2buffer\_str(ldns\_buffer \*output, const ldns\_rdf \*rdf);

ldns\_status ldns\_key2buffer\_str(ldns\_buffer \*output, const ldns\_key \*k);

ldns\_status ldns\_pkt2buffer\_wire(ldns\_buffer \*output, const ldns\_pkt \*pkt);

ldns\_status ldns\_rr2buffer\_wire(ldns\_buffer \*output, const ldns\_rr \*rr, int section);

ldns\_status ldns\_rdf2buffer\_wire(ldns\_buffer \*output, const ldns\_rdf \*rdf);

ldns\_status ldns\_rrsig2buffer\_wire(ldns\_buffer \*output, const ldns\_rr \*sigrr);

ldns\_status ldns\_rr\_rdata2buffer\_wire(ldns\_buffer \*output, const ldns\_rr \*rr);

## DESCRIPTION

*ldns\_pkt2buffer\_str*() Converts the data in the DNS packet to presentation format (as char \*) and appends it to the given buffer

.br **output**: pointer to the buffer to append the data to .br **pkt**: the pointer to the packet to convert .br Returns status

*ldns\_pktheader2buffer\_str*() Converts the header of a packet to presentation format and appends it to the output buffer .br **output**: the buffer to append output to .br **pkt**: the packet to convert the header of .br Returns ldns\_status

*ldns\_rr2buffer\_str*() Converts the data in the resource record to presentation format (as char \*) and appends it to the given buffer. The presentation format of DNSKEY record is annotated with comments giving the id, type and size of the key.

.br **output**: pointer to the buffer to append the data to .br **rr**: the pointer to the rr field to convert .br Returns status

*ldns\_rr\_list2buffer\_str*() Converts a rr\_list to presentation format and appends it to the output buffer .br **output**: the buffer to append output to .br **list**: the ldns\_rr\_list to print .br Returns ldns\_status

*ldns\_rdf2buffer\_str*() Converts the data in the rdata field to presentation format (as char \*) and appends it to the given buffer

.br **output**: pointer to the buffer to append the data to .br **rdf**: the pointer to the rdafa field containing the data .br Returns status

*ldns\_key2buffer\_str*() Converts the data in the DNS packet to presentation format (as char \*) and appends it to the given buffer

.br **output**: pointer to the buffer to append the data to .br **k**: the pointer to the private key to convert .br Returns status

*ldns\_pkt2buffer\_wire*() Copies the packet data to the buffer in wire format .br **\*output**: buffer to append the result to .br **\*pkt**: packet to convert .br Returns ldns\_status

*ldns\_rr2buffer\_wire*() Copies the rr data to the buffer in wire format .br **\*output**: buffer to append the result to .br **\*rr**: resource record to convert .br **section**: the section in the packet this rr is supposed to be in (to determine whether to add rdata or not) .br Returns ldns\_status

*ldns\_rdf2buffer\_wire*() Copies the rdata data to the buffer in wire format .br **\*output**: buffer to append the result to .br **\*rdf**: rdata to convert .br Returns ldns\_status

*ldns\_rrsig2buffer\_wire*() Converts a rrsig to wireformat BUT EXCLUDE the rrsig rdata This is needed in DNSSEC verification .br **output**: buffer to append the result to .br **sigrr**: signature rr to operate on .br Returns ldns\_status

*ldns\_rr\_rdata2buffer\_wire*() Converts an rr's rdata to wireformat, while excluding the ownername and all the stuff before the rdata. This is needed in DNSSEC keytag calculation, the ds calculation from the key and maybe elsewhere.

.br **\*output**: buffer where to put the result .br **\*rr**: rr to operate on .br Returns ldns\_status

## 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\_pkt2str*, *ldns\_rr2str*, *ldns\_rdf2str*, *ldns\_rr\_list2str*, *ldns\_key2str*. And **perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034**  and **RFC4035**.

## REMARKS

This manpage was automatically generated from the ldns source code.
