---
name: "gnutls_certificate_set_openpgp_key_mem2"
section: "3"
platform: "linux"
package: "gnutls-doc"
version: "3.5.8-5+deb9u5"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/gnutls_certificate_set_openpgp_key_mem2"
---

# gnutls\_certificate\_set\_openpgp\_key\_mem2(3)

API function

## NAME

gnutls\_certificate\_set\_openpgp\_key\_mem2 - API function

## SYNOPSIS

**#include \<gnutls/openpgp.h\>**

**int gnutls\_certificate\_set\_openpgp\_key\_mem2(gnutls\_certificate\_credentials\_t**      *res***, const gnutls\_datum\_t \*** *cert***, const gnutls\_datum\_t \*** *key***, const char \*** *subkey\_id***, gnutls\_openpgp\_crt\_fmt\_t** *format***);**

## ARGUMENTS

- gnutls\_certificate\_credentials\_t res

  the destination context to save the data.

- const gnutls\_datum\_t \* cert

  the datum that contains the public key.

- const gnutls\_datum\_t \* key

  the datum that contains the secret key.

- const char \* subkey\_id

  a hex encoded subkey id

- gnutls\_openpgp\_crt\_fmt\_t format

  the format of the keys

## DESCRIPTION

This function is used to load OpenPGP keys into the GnuTLS credentials structure. The datum should contain at least one valid non encrypted subkey.

The special keyword "auto" is also accepted as  *subkey\_id* .  In that case the **gnutls\_openpgp\_crt\_get\_auth\_subkey()** will be used to retrieve the subkey.

## RETURNS

On success, **GNUTLS\_E\_SUCCESS** (0) is returned, otherwise a negative error value.

## SINCE

2\.4.0

## REPORTING BUGS

Report bugs to \<bugs@gnutls.org\>.\
 Home page: http://www.gnutls.org

## COPYRIGHT

Copyright © 2001-2020 Free Software Foundation, Inc., and others.\
 Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.

## SEE ALSO

The full documentation for **gnutls** is maintained as a Texinfo manual. If the /usr/share/doc/gnutls/ directory does not contain the HTML form visit

- http://www.gnutls.org/manual/
