### Function

# Gcr trust_add_pinned_certificate_async

since: 4

#### Declaration [src]

    void
    gcr_trust_add_pinned_certificate_async (
      GcrCertificate* certificate,
      const gchar* purpose,
      const gchar* peer,
      GCancellable* cancellable,
      GAsyncReadyCallback callback,
      gpointer user_data
    )

#### Description [src]

Add a pinned certificate for communication with `peer` for `purpose`. A pinned certificate overrides all other certificate verification and should be used with care.

If the same pinned certificate already exists, then this operation does not add another, and succeeds without error.

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

Available since: 4

#### Parameters

`certificate`

  Type: `GcrCertificate`

  A `GcrCertificate`.

  The data is owned by the caller of the function.

`purpose`

  Type: `const gchar*`

  The purpose string.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`peer`

  Type: `const gchar*`

  The peer for this pinned certificate.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`cancellable`

  Type: `GCancellable`

  A `GCancellable`.

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

`callback`

  Type: `GAsyncReadyCallback`

  A `GAsyncReadyCallback` to call when the operation completes.

  The argument can be `NULL`.

`user_data`

  Type: `gpointer`

  The data to pass to callback function.

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