ldns(3) Library Functions Manual ldns(3)

# [NAME](#NAME)

ldns\_key\_new, ldns\_key\_new\_frm\_algorithm, ldns\_key\_new\_frm\_fp, ldns\_key\_new\_frm\_fp\_l, ldns\_key\_new\_frm\_fp\_rsa, ldns\_key\_new\_frm\_fp\_rsa\_l, ldns\_key\_new\_frm\_fp\_dsa, ldns\_key\_new\_frm\_fp\_dsa\_l - create a ldns\_key

# [SYNOPSIS](#SYNOPSIS)

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

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

ldns\_key* ldns\_key\_new(void);

ldns\_key* ldns\_key\_new\_frm\_algorithm(ldns\_signing\_algorithm a, uint16\_t size);

ldns\_status ldns\_key\_new\_frm\_fp(ldns\_key \*\*k, FILE \*fp);

ldns\_status ldns\_key\_new\_frm\_fp\_l(ldns\_key \*\*k, FILE \*fp, int \*line\_nr);

RSA* ldns\_key\_new\_frm\_fp\_rsa(FILE \*fp);

RSA* ldns\_key\_new\_frm\_fp\_rsa\_l(FILE \*fp, int \*line\_nr);

DSA* ldns\_key\_new\_frm\_fp\_dsa(FILE \*fp);

DSA* ldns\_key\_new\_frm\_fp\_dsa\_l(FILE \*fp, int \*line\_nr);

# [DESCRIPTION](#DESCRIPTION)

*ldns\_key\_new*() Creates a new empty key structure  
Returns a new ldns\_key * structure

*ldns\_key\_new\_frm\_algorithm*() Creates a new key based on the algorithm

**a**: The algorithm to use  
**size**: the number of bytes for the keysize  
Returns a new ldns\_key structure with the key

*ldns\_key\_new\_frm\_fp*() Creates a new priv key based on the contents of the file pointed by fp.

The file should be in Private-key-format v1.x.

**k**: the new ldns\_key structure  
**fp**: the file pointer to use  
Returns an error or LDNS\_STATUS\_OK

*ldns\_key\_new\_frm\_fp\_l*() Creates a new private key based on the contents of the file pointed by fp

The file should be in Private-key-format v1.x.

**k**: the new ldns\_key structure  
**fp**: the file pointer to use  
**line\_nr**: pointer to an integer containing the current line number (for debugging purposes)  
Returns an error or LDNS\_STATUS\_OK

*ldns\_key\_new\_frm\_fp\_rsa*() frm\_fp helper function. This function parses the remainder of the (RSA) priv. key file generated from bind9  
**fp**: the file to parse  
Returns NULL on failure otherwise a RSA structure

*ldns\_key\_new\_frm\_fp\_rsa\_l*() frm\_fp helper function. This function parses the remainder of the (RSA) priv. key file generated from bind9  
**fp**: the file to parse  
**line\_nr**: pointer to an integer containing the current line number (for debugging purposes)  
Returns NULL on failure otherwise a RSA structure

*ldns\_key\_new\_frm\_fp\_dsa*() frm\_fp helper function. This function parses the remainder of the (DSA) priv. key file  
**fp**: the file to parse  
Returns NULL on failure otherwise a RSA structure

*ldns\_key\_new\_frm\_fp\_dsa\_l*() frm\_fp helper function. This function parses the remainder of the (DSA) priv. key file  
**fp**: the file to parse  
**line\_nr**: pointer to an integer containing the current line number (for debugging purposes)  
Returns NULL on failure otherwise a RSA structure

# [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_key_new_frm_fp_rsa(3) from ldns 1.9.2-r2 (Chainguard OS)
Source: https://github.com/NLnetLabs/ldns.git
