Camel.CipherContext.encrypt

### Method

# Camel CipherContextencrypt

since: 3.0

#### Declaration [src]

    void
    camel_cipher_context_encrypt (
      CamelCipherContext* context,
      const gchar* userid,
      GPtrArray* recipients,
      CamelMimePart* ipart,
      CamelMimePart* opart,
      gint io_priority,
      GCancellable* cancellable,
      GAsyncReadyCallback callback,
      gpointer user_data
    )

#### Description [src]

Asynchronously encrypts the clear-text `ipart` and writes the resulting cipher-text to `opart`.

When the operation is finished, `callback` will be called. You can then call `camel_cipher_context_encrypt_finish()` to get the result of the operation.

Note: The `userid` is unused, `NULL` should be passed for it.

Available since: 3.0

This method completes asynchronously. Use `camel_cipher_context_encrypt_finish()` inside the `GAsyncReadyCallback` to obtain the result of the operation.

#### Parameters

`userid`

  Type: `const gchar*`

  Unused.

  The argument can be `NULL`.
  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`recipients`

  Type: An array of `utf8`

  An array of recipient key IDs and/or email addresses.

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

`ipart`

  Type: `CamelMimePart`

  Clear-text `CamelMimePart`.

  The data is owned by the caller of the method.

`opart`

  Type: `CamelMimePart`

  Cipher-text `CamelMimePart`.

  The data is owned by the caller of the method.

`io_priority`

  Type: `gint`

  The I/O priority of the request.

`cancellable`

  Type: `GCancellable`

  Optional `GCancellable` object, or `NULL`.

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

`callback`

  Type: `GAsyncReadyCallback`

  A `GAsyncReadyCallback` to call when the request is satisfied.

  The argument can be `NULL`.

`user_data`

  Type: `gpointer`

  Data to pass to the callback function.

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