### Method

# Gcr SecretExchange get_secret

#### Declaration [src]

    const gchar*
    gcr_secret_exchange_get_secret (
      GcrSecretExchange* self,
      gsize* secret_len
    )

#### Description [src]

Returns the last secret received. If no secret has yet been received this will return `NULL`. The string is owned by the `GcrSecretExchange` object and will be valid until the next time that `gcr_secret_exchange_receive()` is called on this object, or the object is destroyed.

Depending on the secret passed into the other side of the secret exchange, the result may be a binary string. It does however have a null terminator, so if you’re certain that it is does not contain arbitrary binary data, it can be used as a string.

#### Parameters

`secret_len` | `gsize*`
| Optionally, a location to store the length of returned secret.
| The argument will be set by the function.
| The argument can be `NULL`.

#### Return value

Returns: | An array of `gchar`
| The last secret received.
| The length of the array is in the `secret_len` argument.
| The data is owned by the instance.
| Each element is a NUL terminated UTF-8 string.