Gio.TlsInteraction¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| ask_password(password, cancellable) | |
| ask_password_async(password, cancellable, callback, *user_data) | |
| ask_password_finish(result) | |
| invoke_ask_password(password, cancellable) | |
| invoke_request_certificate(connection, flags, cancellable) | |
| request_certificate(connection, flags, cancellable) | |
| request_certificate_async(connection, flags, cancellable, callback, *user_data) | |
| request_certificate_finish(result) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
| do_ask_password(password, cancellable) | |
| do_ask_password_async(password, cancellable, callback, *user_data) | |
| do_ask_password_finish(result) | |
| do_request_certificate(connection, flags, cancellable) | |
| do_request_certificate_async(connection, flags, cancellable, callback, *user_data) | |
| do_request_certificate_finish(result) | 
Properties¶
None
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class Gio.TlsInteraction(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - Gio.TlsInteractionClass- Gio.TlsInteractionprovides 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 - Gio.TlsInteractionwith a TLS connection use- 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 - 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 - Gio.TlsInteractionResult.UNHANDLED. If a derived class implements an async method, it must also implement the corresponding finish method.- New in version 2.30. - 
ask_password(password, cancellable)[source]¶
- Parameters: - password (Gio.TlsPassword) – aGio.TlsPasswordobject
- cancellable (Gio.CancellableorNone) – an optionalGio.Cancellablecancellation object
 - Raises: - Returns: - The status of the ask password interaction. - Return type: - Run synchronous interaction to ask the user for a password. In general, - Gio.TlsInteraction.invoke_ask_password() should be used instead of this function.- 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. - If the interaction is cancelled by the cancellation object, or by the user then - Gio.TlsInteractionResult.FAILEDwill be returned with an error that contains a- Gio.IOErrorEnum.CANCELLEDerror code. Certain implementations may not support immediate cancellation.- New in version 2.30. 
- password (
 - 
ask_password_async(password, cancellable, callback, *user_data)[source]¶
- Parameters: - password (Gio.TlsPassword) – aGio.TlsPasswordobject
- cancellable (Gio.CancellableorNone) – an optionalGio.Cancellablecancellation object
- callback (Gio.AsyncReadyCallbackorNone) – will be called when the interaction completes
- user_data (objectorNone) – data to pass to the callback
 - Run asynchronous interaction to ask the user for a password. In general, - Gio.TlsInteraction.invoke_ask_password() should be used instead of this function.- 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. - If the interaction is cancelled by the cancellation object, or by the user then - Gio.TlsInteractionResult.FAILEDwill be returned with an error that contains a- Gio.IOErrorEnum.CANCELLEDerror code. Certain implementations may not support immediate cancellation.- Certain implementations may not support immediate cancellation. - New in version 2.30. 
- password (
 - 
ask_password_finish(result)[source]¶
- Parameters: - result ( - Gio.AsyncResult) – the result passed to the callback- Raises: - GLib.Error- Returns: - The status of the ask password interaction. - Return type: - Gio.TlsInteractionResult- Complete an ask password user interaction request. This should be once the - Gio.TlsInteraction.ask_password_async() completion callback is called.- If - Gio.TlsInteractionResult.HANDLEDis returned, then the- Gio.TlsPasswordpassed to- Gio.TlsInteraction.ask_password() will have its password filled in.- If the interaction is cancelled by the cancellation object, or by the user then - Gio.TlsInteractionResult.FAILEDwill be returned with an error that contains a- Gio.IOErrorEnum.CANCELLEDerror code.- New in version 2.30. 
 - 
invoke_ask_password(password, cancellable)[source]¶
- Parameters: - password (Gio.TlsPassword) – aGio.TlsPasswordobject
- cancellable (Gio.CancellableorNone) – an optionalGio.Cancellablecancellation object
 - Raises: - Returns: - The status of the ask password interaction. - Return type: - Invoke the interaction to ask the user for a password. It invokes this interaction in the main loop, specifically the - GLib.MainContextreturned by- GLib.MainContext.get_thread_default() when the interaction is created. This is called by called by- Gio.TlsConnectionor- Gio.TlsDatabaseto 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 - Gio.TlsInteractionResult.FAILEDwill be returned with an error that contains a- Gio.IOErrorEnum.CANCELLEDerror code. Certain implementations may not support immediate cancellation.- New in version 2.30. 
- password (
 - 
invoke_request_certificate(connection, flags, cancellable)[source]¶
- Parameters: - connection (Gio.TlsConnection) – aGio.TlsConnectionobject
- flags (Gio.TlsCertificateRequestFlags) – flags providing more information about the request
- cancellable (Gio.CancellableorNone) – an optionalGio.Cancellablecancellation object
 - Raises: - Returns: - The status of the certificate request interaction. - Return type: - 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 - GLib.MainContextreturned by- GLib.MainContext.get_thread_default() when the interaction is created. This is called by called by- Gio.TlsConnectionwhen the peer requests a certificate during the handshake.- Derived subclasses usually implement a certificate selector, although they may also choose to provide a certificate from elsewhere. Alternatively the user may abort this certificate request, which may or may not 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 - Gio.TlsInteractionResult.FAILEDwill be returned with an error that contains a- Gio.IOErrorEnum.CANCELLEDerror code. Certain implementations may not support immediate cancellation.- New in version 2.40. 
- connection (
 - 
request_certificate(connection, flags, cancellable)[source]¶
- Parameters: - connection (Gio.TlsConnection) – aGio.TlsConnectionobject
- flags (Gio.TlsCertificateRequestFlags) – flags providing more information about the request
- cancellable (Gio.CancellableorNone) – an optionalGio.Cancellablecancellation object
 - Raises: - Returns: - The status of the request certificate interaction. - Return type: - Run synchronous interaction to ask the user to choose a certificate to use with the connection. In general, - Gio.TlsInteraction.invoke_request_certificate() should be used instead of this function.- Derived subclasses usually implement a certificate selector, although they may also choose to provide a certificate from elsewhere. Alternatively the user may abort this certificate request, which will usually abort the TLS connection. - If - Gio.TlsInteractionResult.HANDLEDis returned, then the- Gio.TlsConnectionpassed to- Gio.TlsInteraction.request_certificate() will have had its- Gio.TlsConnection- :certificatefilled in.- If the interaction is cancelled by the cancellation object, or by the user then - Gio.TlsInteractionResult.FAILEDwill be returned with an error that contains a- Gio.IOErrorEnum.CANCELLEDerror code. Certain implementations may not support immediate cancellation.- New in version 2.40. 
- connection (
 - 
request_certificate_async(connection, flags, cancellable, callback, *user_data)[source]¶
- Parameters: - connection (Gio.TlsConnection) – aGio.TlsConnectionobject
- flags (Gio.TlsCertificateRequestFlags) – flags providing more information about the request
- cancellable (Gio.CancellableorNone) – an optionalGio.Cancellablecancellation object
- callback (Gio.AsyncReadyCallbackorNone) – will be called when the interaction completes
- user_data (objectorNone) – data to pass to the callback
 - Run asynchronous interaction to ask the user for a certificate to use with the connection. In general, - Gio.TlsInteraction.invoke_request_certificate() should be used instead of this function.- Derived subclasses usually implement a certificate selector, although they may also choose to provide a certificate from elsewhere. callback will be called when the operation completes. Alternatively the user may abort this certificate request, which will usually abort the TLS connection. - New in version 2.40. 
- connection (
 - 
request_certificate_finish(result)[source]¶
- Parameters: - result ( - Gio.AsyncResult) – the result passed to the callback- Raises: - GLib.Error- Returns: - The status of the request certificate interaction. - Return type: - Gio.TlsInteractionResult- Complete a request certificate user interaction request. This should be once the - Gio.TlsInteraction.request_certificate_async() completion callback is called.- If - Gio.TlsInteractionResult.HANDLEDis returned, then the- Gio.TlsConnectionpassed to- Gio.TlsInteraction.request_certificate_async() will have had its- Gio.TlsConnection- :certificatefilled in.- If the interaction is cancelled by the cancellation object, or by the user then - Gio.TlsInteractionResult.FAILEDwill be returned with an error that contains a- Gio.IOErrorEnum.CANCELLEDerror code.- New in version 2.40. 
 - 
do_ask_password(password, cancellable) virtual¶
- Parameters: - password (Gio.TlsPassword) – aGio.TlsPasswordobject
- cancellable (Gio.CancellableorNone) – an optionalGio.Cancellablecancellation object
 - Returns: - The status of the ask password interaction. - Return type: - Run synchronous interaction to ask the user for a password. In general, - Gio.TlsInteraction.invoke_ask_password() should be used instead of this function.- 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. - If the interaction is cancelled by the cancellation object, or by the user then - Gio.TlsInteractionResult.FAILEDwill be returned with an error that contains a- Gio.IOErrorEnum.CANCELLEDerror code. Certain implementations may not support immediate cancellation.- New in version 2.30. 
- password (
 - 
do_ask_password_async(password, cancellable, callback, *user_data) virtual¶
- Parameters: - password (Gio.TlsPassword) – aGio.TlsPasswordobject
- cancellable (Gio.CancellableorNone) – an optionalGio.Cancellablecancellation object
- callback (Gio.AsyncReadyCallbackorNone) – will be called when the interaction completes
- user_data (objectorNone) – data to pass to the callback
 - Run asynchronous interaction to ask the user for a password. In general, - Gio.TlsInteraction.invoke_ask_password() should be used instead of this function.- 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. - If the interaction is cancelled by the cancellation object, or by the user then - Gio.TlsInteractionResult.FAILEDwill be returned with an error that contains a- Gio.IOErrorEnum.CANCELLEDerror code. Certain implementations may not support immediate cancellation.- Certain implementations may not support immediate cancellation. - New in version 2.30. 
- password (
 - 
do_ask_password_finish(result) virtual¶
- Parameters: - result ( - Gio.AsyncResult) – the result passed to the callback- Returns: - The status of the ask password interaction. - Return type: - Gio.TlsInteractionResult- Complete an ask password user interaction request. This should be once the - Gio.TlsInteraction.ask_password_async() completion callback is called.- If - Gio.TlsInteractionResult.HANDLEDis returned, then the- Gio.TlsPasswordpassed to- Gio.TlsInteraction.ask_password() will have its password filled in.- If the interaction is cancelled by the cancellation object, or by the user then - Gio.TlsInteractionResult.FAILEDwill be returned with an error that contains a- Gio.IOErrorEnum.CANCELLEDerror code.- New in version 2.30. 
 - 
do_request_certificate(connection, flags, cancellable) virtual¶
- Parameters: - connection (Gio.TlsConnection) – aGio.TlsConnectionobject
- flags (Gio.TlsCertificateRequestFlags) – flags providing more information about the request
- cancellable (Gio.CancellableorNone) – an optionalGio.Cancellablecancellation object
 - Returns: - The status of the request certificate interaction. - Return type: - Run synchronous interaction to ask the user to choose a certificate to use with the connection. In general, - Gio.TlsInteraction.invoke_request_certificate() should be used instead of this function.- Derived subclasses usually implement a certificate selector, although they may also choose to provide a certificate from elsewhere. Alternatively the user may abort this certificate request, which will usually abort the TLS connection. - If - Gio.TlsInteractionResult.HANDLEDis returned, then the- Gio.TlsConnectionpassed to- Gio.TlsInteraction.request_certificate() will have had its- Gio.TlsConnection- :certificatefilled in.- If the interaction is cancelled by the cancellation object, or by the user then - Gio.TlsInteractionResult.FAILEDwill be returned with an error that contains a- Gio.IOErrorEnum.CANCELLEDerror code. Certain implementations may not support immediate cancellation.- New in version 2.40. 
- connection (
 - 
do_request_certificate_async(connection, flags, cancellable, callback, *user_data) virtual¶
- Parameters: - connection (Gio.TlsConnection) – aGio.TlsConnectionobject
- flags (Gio.TlsCertificateRequestFlags) – flags providing more information about the request
- cancellable (Gio.CancellableorNone) – an optionalGio.Cancellablecancellation object
- callback (Gio.AsyncReadyCallbackorNone) – will be called when the interaction completes
- user_data (objectorNone) – data to pass to the callback
 - Run asynchronous interaction to ask the user for a certificate to use with the connection. In general, - Gio.TlsInteraction.invoke_request_certificate() should be used instead of this function.- Derived subclasses usually implement a certificate selector, although they may also choose to provide a certificate from elsewhere. callback will be called when the operation completes. Alternatively the user may abort this certificate request, which will usually abort the TLS connection. - New in version 2.40. 
- connection (
 - 
do_request_certificate_finish(result) virtual¶
- Parameters: - result ( - Gio.AsyncResult) – the result passed to the callback- Returns: - The status of the request certificate interaction. - Return type: - Gio.TlsInteractionResult- Complete a request certificate user interaction request. This should be once the - Gio.TlsInteraction.request_certificate_async() completion callback is called.- If - Gio.TlsInteractionResult.HANDLEDis returned, then the- Gio.TlsConnectionpassed to- Gio.TlsInteraction.request_certificate_async() will have had its- Gio.TlsConnection- :certificatefilled in.- If the interaction is cancelled by the cancellation object, or by the user then - Gio.TlsInteractionResult.FAILEDwill be returned with an error that contains a- Gio.IOErrorEnum.CANCELLEDerror code.- New in version 2.40. 
 
-