---
name: "gnutls_certificate_get_openpgp_crt"
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_get_openpgp_crt"
---

# gnutls\_certificate\_get\_openpgp\_crt(3)

API function

## NAME

gnutls\_certificate\_get\_openpgp\_crt - API function

## SYNOPSIS

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

**int gnutls\_certificate\_get\_openpgp\_crt(gnutls\_certificate\_credentials\_t** *res***, unsigned** *index***, gnutls\_openpgp\_crt\_t \*\*** *crt\_list***, unsigned \*** *crt\_list\_size***);**

## ARGUMENTS

- gnutls\_certificate\_credentials\_t res

  is a **gnutls\_certificate\_credentials\_t** type.

- unsigned index

  The index of the certificate list to obtain.

- gnutls\_openpgp\_crt\_t \*\* crt\_list

  Where to store the certificate list.

- unsigned \* crt\_list\_size

  \-- undescribed --

## DESCRIPTION

Obtains a X.509 certificate list that has been stored in  *res* with one of **gnutls\_certificate\_set\_openpgp\_key()**, **gnutls\_certificate\_set\_openpgp\_key\_file()**, **gnutls\_certificate\_set\_openpgp\_key\_file2()**, **gnutls\_certificate\_set\_openpgp\_key\_mem()**, or **gnutls\_certificate\_set\_openpgp\_key\_mem2()**.  Each certificate in the returned certificate list must be deallocated with **gnutls\_openpgp\_crt\_deinit()**, and the list itself must be freed with **gnutls\_free()**.

If there is no certificate with the given index, **GNUTLS\_E\_REQUESTED\_DATA\_NOT\_AVAILABLE** is returned. If the certificate with the given index is not a X.509 certificate, **GNUTLS\_E\_INVALID\_REQUEST** is returned.

## RETURNS

**GNUTLS\_E\_SUCCESS** (0) on success, or a negative error code.

## SINCE

3\.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/
