### Virtual Method

# Camel Session get_recipient_certificates_sync

since: 3.30

#### Declaration [src]

    gboolean
    get_recipient_certificates_sync (
      CamelSession* session,
      guint32 flags,
      const GPtrArray* recipients,
      GSList** out_certificates,
      GCancellable* cancellable,
      GError** error
    )

#### Description [src]

Searches for S/MIME certificates or PGP keys for the given `recipients`, which are returned as base64 encoded strings in `out_certificates`. This is used when encrypting messages. The `flags` influence what the `out_certificates` will contain. The order of items in `out_certificates` should match the order of items in `recipients`, with `NULL` data for those which could not be found.

The function should return failure only if some fatal error happened. It’s not an error when certificates for some, or all, recipients could not be found.

This method is optional and the default implementation returns `TRUE` and sets the `out_certificates` to `NULL`. It’s the only exception when the length of `recipients` and `out_certificates` can differ. In all other cases the length of the two should match.

The `out_certificates` will be freed with g_slist_free_full (certificates, g_free); when done with it.

Available since: 3.30

#### Parameters

`flags`

  Type: `guint32`

  Bit-or of `CamelRecipientCertificateFlags`.

`recipients`

  Type: An array of `utf8`

  A `GPtrArray` of recipients.

  The data is owned by the caller of the method.
  Each element is a NUL terminated UTF-8 string.

`out_certificates`

  Type: A list of `utf8`

  A `GSList` of gathered certificates.

  The argument will be set by the function.
  The caller of the method takes ownership of the returned data, and is responsible for freeing it.
  Each element is a NUL terminated UTF-8 string.

`cancellable`

  Type: `GCancellable`

  Optional `GCancellable` object, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the virtual function if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `gboolean`

Whether succeeded, or better whether no fatal error happened.