---
name: "gnutls_x509_trust_list_iter_get_ca"
section: "3"
platform: "linux"
package: "gnutls"
version: "3.8.13-3"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/gnutls_x509_trust_list_iter_get_ca"
---

# gnutls\_x509\_trust\_list\_iter\_get\_ca(3)

API function

## NAME

gnutls\_x509\_trust\_list\_iter\_get\_ca - API function

## SYNOPSIS

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

**int gnutls\_x509\_trust\_list\_iter\_get\_ca(gnutls\_x509\_trust\_list\_t** *list***, gnutls\_x509\_trust\_list\_iter\_t \*** *iter***, gnutls\_x509\_crt\_t \*** *crt***);**

## ARGUMENTS

- gnutls\_x509\_trust\_list\_t list

  The list

- gnutls\_x509\_trust\_list\_iter\_t \* iter

  A pointer to an iterator (initially the iterator should be **NULL**)

- gnutls\_x509\_crt\_t \* crt

  where the certificate will be copied

## DESCRIPTION

This function obtains a certificate in the trust list and advances the iterator to the next certificate. The certificate returned in  *crt* must be deallocated with **gnutls\_x509\_crt\_deinit()**.

When past the last element is accessed **GNUTLS\_E\_REQUESTED\_DATA\_NOT\_AVAILABLE** is returned and the iterator is reset.

The iterator is deinitialized and reset to **NULL** automatically by this function after iterating through all elements until **GNUTLS\_E\_REQUESTED\_DATA\_NOT\_AVAILABLE** is returned. If the iteration is aborted early, it must be manually deinitialized using **gnutls\_x509\_trust\_list\_iter\_deinit()**.

## RETURNS

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

## SINCE

3\.4.0

## REPORTING BUGS

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

## COPYRIGHT

Copyright © 2001-2023 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

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