Method

GioTlsInteractioninvoke_ask_password

Declaration

GTlsInteractionResult
g_tls_interaction_invoke_ask_password (
  GTlsInteraction* interaction,
  GTlsPassword* password,
  GCancellable* cancellable,
  GError** error
)

Description

Invoke the interaction to ask the user for a password. It invokes this interaction in the main loop, specifically the GMainContext returned by g_main_context_get_thread_default() when the interaction is created. This is called by called by GTlsConnection or GTlsDatabase to ask the user for a password.

Derived subclasses usually implement a password prompt, although they may also choose to provide a password from elsewhere. The password value will be filled in and then callback will be called. Alternatively the user may abort this password request, which will usually abort the TLS connection.

The implementation can either be a synchronous (eg: modal dialog) or an asynchronous one (eg: modeless dialog). This function will take care of calling which ever one correctly.

If the interaction is cancelled by the cancellation object, or by the user then G_TLS_INTERACTION_FAILED will be returned with an error that contains a G_IO_ERROR_CANCELLED error code. Certain implementations may not support immediate cancellation.

Available since:2.30

Parameters

password GTlsPassword
 

A GTlsPassword object.

 The data is owned by the caller of the function.
cancellable GCancellable
 

An optional GCancellable cancellation object.

 The argument can be NULL.
 The data is owned by the caller of the function.
error GError **
  The return location for a GError*, or NULL.

Return value

Returns: GTlsInteractionResult
 

The status of the ask password interaction.