TlsInteraction

open class TlsInteraction(pointer: <Error class: unknown class><<Error class: unknown class>>)

GTlsInteraction provides a mechanism for the TLS connection and database code to interact with the user. It can be used to ask the user for passwords.

To use a GTlsInteraction with a TLS connection use method@Gio.TlsConnection.set_interaction.

Callers should instantiate a derived class that implements the various interaction methods to show the required dialogs.

Callers should use the 'invoke' functions like method@Gio.TlsInteraction.invoke_ask_password to run interaction methods. These functions make sure that the interaction is invoked in the main loop and not in the current thread, if the current thread is not running the main loop.

Derived classes can choose to implement whichever interactions methods they’d like to support by overriding those virtual methods in their class initialization function. Any interactions not implemented will return G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method, it must also implement the corresponding finish method.

Since

2.30

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gioTlsInteractionPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
open fun askPassword(password: TlsPassword, cancellable: Cancellable? = null): <Error class: unknown class><TlsInteractionResult>

Run synchronous interaction to ask the user for a password. In general, g_tls_interaction_invoke_ask_password() should be used instead of this function.

Link copied to clipboard
open fun askPasswordAsync(password: TlsPassword, cancellable: Cancellable? = null, callback: AsyncReadyCallback?)

Run asynchronous interaction to ask the user for a password. In general, g_tls_interaction_invoke_ask_password() should be used instead of this function.

Link copied to clipboard
open fun askPasswordFinish(result: AsyncResult): <Error class: unknown class><TlsInteractionResult>

Complete an ask password user interaction request. This should be once the g_tls_interaction_ask_password_async() completion callback is called.

Link copied to clipboard
open fun invokeAskPassword(password: TlsPassword, cancellable: Cancellable? = null): <Error class: unknown class><TlsInteractionResult>

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.

Link copied to clipboard
open fun invokeRequestCertificate(connection: TlsConnection, flags: TlsCertificateRequestFlags, cancellable: Cancellable? = null): <Error class: unknown class><TlsInteractionResult>

Invoke the interaction to ask the user to choose a certificate to use with the connection. 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 when the peer requests a certificate during the handshake.

Link copied to clipboard
open fun requestCertificate(connection: TlsConnection, flags: TlsCertificateRequestFlags, cancellable: Cancellable? = null): <Error class: unknown class><TlsInteractionResult>

Run synchronous interaction to ask the user to choose a certificate to use with the connection. In general, g_tls_interaction_invoke_request_certificate() should be used instead of this function.

Link copied to clipboard
open fun requestCertificateAsync(connection: TlsConnection, flags: TlsCertificateRequestFlags, cancellable: Cancellable? = null, callback: AsyncReadyCallback?)

Run asynchronous interaction to ask the user for a certificate to use with the connection. In general, g_tls_interaction_invoke_request_certificate() should be used instead of this function.

Link copied to clipboard
open fun requestCertificateFinish(result: AsyncResult): <Error class: unknown class><TlsInteractionResult>

Complete a request certificate user interaction request. This should be once the g_tls_interaction_request_certificate_async() completion callback is called.