---
name: "gnutls_pcert_import_x509_list"
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_pcert_import_x509_list"
---

# gnutls\_pcert\_import\_x509\_list(3)

API function

## NAME

gnutls\_pcert\_import\_x509\_list - API function

## SYNOPSIS

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

**int gnutls\_pcert\_import\_x509\_list(gnutls\_pcert\_st \*** *pcert\_list***, gnutls\_x509\_crt\_t \*** *crt***, unsigned \*** *ncrt***, unsigned int** *flags***);**

## ARGUMENTS

- gnutls\_pcert\_st \* pcert\_list

  The structures to store the certificates; must not contain initialized **gnutls\_pcert\_st** structures.

- gnutls\_x509\_crt\_t \* crt

  The certificates to be imported

- unsigned \* ncrt

  The number of certificates in  *crt* ; will be updated if necessary

- unsigned int flags

  zero or **GNUTLS\_X509\_CRT\_LIST\_SORT**

## DESCRIPTION

This convenience function will import the given certificates to an already allocated set of **gnutls\_pcert\_st** structures. The structures must be deinitialized afterwards using **gnutls\_pcert\_deinit()**.  *pcert\_list* should contain space for at least  *ncrt* elements.

In the case **GNUTLS\_X509\_CRT\_LIST\_SORT** is specified and that function cannot sort the list, **GNUTLS\_E\_CERTIFICATE\_LIST\_UNSORTED** will be returned. Currently sorting can fail if the list size exceeds an internal constraint (16).

## 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/
