---
name: "ldns_key2str"
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_key2str"
---

# ldns\_key2str(3)

functions for conversions to string

## NAME

ldns\_rr2str, ldns\_pkt2str, ldns\_rdf2str, ldns\_rr\_list2str, ldns\_key2str - functions for conversions to string

## SYNOPSIS

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

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

char\* ldns\_rr2str(const ldns\_rr \*rr);

char\* ldns\_pkt2str(const ldns\_pkt \*pkt);

char\* ldns\_rdf2str(const ldns\_rdf \*rdf);

char\* ldns\_rr\_list2str(const ldns\_rr\_list \*rr\_list);

char\* ldns\_key2str(const ldns\_key \*k);

## DESCRIPTION

*ldns\_rr2str*() Converts the data in the resource record to presentation format and returns that as a char \*. Remember to free it.

.br **rr**: The rdata field to convert .br Returns null terminated char \* data, or NULL on error

*ldns\_pkt2str*() Converts the data in the DNS packet to presentation format and returns that as a char \*. Remember to free it.

.br **pkt**: The rdata field to convert .br Returns null terminated char \* data, or NULL on error

*ldns\_rdf2str*() Converts the data in the rdata field to presentation format and returns that as a char \*. Remember to free it.

.br **rdf**: The rdata field to convert .br Returns null terminated char \* data, or NULL on error

*ldns\_rr\_list2str*() Converts a list of resource records to presentation format and returns that as a char \*. Remember to free it.

.br **rr\_list**: the rr\_list to convert to text .br Returns null terminated char \* data, or NULL on error

*ldns\_key2str*() Converts a private key to the test presentation fmt and returns that as a char \*. Remember to free it.

.br **k**: the key to convert to text .br Returns null terminated char \* data, or NULL on error

## 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\_rr\_print*, *ldns\_rdf\_print*, *ldns\_pkt\_print*, *ldns\_rr\_list\_print*, *ldns\_resolver\_print*, *ldns\_zone\_print*. And **perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034**  and **RFC4035**.

## REMARKS

This manpage was automatically generated from the ldns source code.
