1.97 <GTlsInteraction>

Class: <GTlsInteraction>

It derives from <GObject>.

<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 tls-connection: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 tls-interaction: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 unhandled. If a derived class implements an async method, it must also implement the corresponding finish method.

Procedures

Method: tls-interaction:ask-password self password [cancellable] ⇒ %return
Method: ask-password self password [cancellable] ⇒ %return

Run synchronous interaction to ask the user for a password. In general, tls-interaction: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 failed will be returned with an error that contains a cancelled error code. Certain implementations may not support immediate cancellation.

self

Passed: a <GTlsInteraction>.

a <GTlsInteraction> object

password

Passed: a <GTlsPassword>.

a <GTlsPassword> object

cancellable

Passed, or left out: a <GCancellable>, or #f.

an optional <GCancellable> cancellation object

%return

Returned: a <GTlsInteractionResult>.

The status of the ask password interaction.

Method: tls-interaction:ask-password-async self password [cancellable] [callback]
Method: ask-password-async self password [cancellable] [callback]

Run asynchronous interaction to ask the user for a password. In general, tls-interaction: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 failed will be returned with an error that contains a cancelled error code. Certain implementations may not support immediate cancellation.

Certain implementations may not support immediate cancellation.

self

Passed: a <GTlsInteraction>.

a <GTlsInteraction> object

password

Passed: a <GTlsPassword>.

a <GTlsPassword> object

cancellable

Passed, or left out: a <GCancellable>, or #f.

an optional <GCancellable> cancellation object

callback

Passed, or left out: a procedure, or #f.

will be called when the interaction completes

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data to pass to the callback

Method: tls-interaction:ask-password-finish self result ⇒ %return
Method: ask-password-finish self result ⇒ %return

Complete an ask password user interaction request. This should be once the tls-interaction:ask-password-async completion callback is called.

If handled is returned, then the <GTlsPassword> passed to tls-interaction:ask-password will have its password filled in.

If the interaction is cancelled by the cancellation object, or by the user then failed will be returned with an error that contains a cancelled error code.

self

Passed: a <GTlsInteraction>.

a <GTlsInteraction> object

result

Passed: a <GAsyncResult>.

the result passed to the callback

%return

Returned: a <GTlsInteractionResult>.

The status of the ask password interaction.

Method: tls-interaction:invoke-ask-password self password [cancellable] ⇒ %return
Method: invoke-ask-password self password [cancellable] ⇒ %return

Invoke the interaction to ask the user for a password. It invokes this interaction in the main loop, specifically the <GMainContext> returned by 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 failed will be returned with an error that contains a cancelled error code. Certain implementations may not support immediate cancellation.

self

Passed: a <GTlsInteraction>.

a <GTlsInteraction> object

password

Passed: a <GTlsPassword>.

a <GTlsPassword> object

cancellable

Passed, or left out: a <GCancellable>, or #f.

an optional <GCancellable> cancellation object

%return

Returned: a <GTlsInteractionResult>.

The status of the ask password interaction.

Method: tls-interaction:invoke-request-certificate self connection flags [cancellable] ⇒ %return
Method: invoke-request-certificate self connection flags [cancellable] ⇒ %return

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 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.

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 failed will be returned with an error that contains a cancelled error code. Certain implementations may not support immediate cancellation.

self

Passed: a <GTlsInteraction>.

a <GTlsInteraction> object

connection

Passed: a <GTlsConnection>.

a <GTlsConnection> object

flags

Passed: a <GTlsCertificateRequestFlags>, or a list of its symbols, or one of them.

flags providing more information about the request

cancellable

Passed, or left out: a <GCancellable>, or #f.

an optional <GCancellable> cancellation object

%return

Returned: a <GTlsInteractionResult>.

The status of the certificate request interaction.

Method: tls-interaction:request-certificate self connection flags [cancellable] ⇒ %return
Method: request-certificate self connection flags [cancellable] ⇒ %return

Run synchronous interaction to ask the user to choose a certificate to use with the connection. In general, tls-interaction: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 handled is returned, then the <GTlsConnection> passed to tls-interaction:request-certificate will have had its tls-connection:certificate filled in.

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

self

Passed: a <GTlsInteraction>.

a <GTlsInteraction> object

connection

Passed: a <GTlsConnection>.

a <GTlsConnection> object

flags

Passed: a <GTlsCertificateRequestFlags>, or a list of its symbols, or one of them.

flags providing more information about the request

cancellable

Passed, or left out: a <GCancellable>, or #f.

an optional <GCancellable> cancellation object

%return

Returned: a <GTlsInteractionResult>.

The status of the request certificate interaction.

Method: tls-interaction:request-certificate-async self connection flags [cancellable] [callback]
Method: request-certificate-async self connection flags [cancellable] [callback]

Run asynchronous interaction to ask the user for a certificate to use with the connection. In general, tls-interaction: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.

self

Passed: a <GTlsInteraction>.

a <GTlsInteraction> object

connection

Passed: a <GTlsConnection>.

a <GTlsConnection> object

flags

Passed: a <GTlsCertificateRequestFlags>, or a list of its symbols, or one of them.

flags providing more information about the request

cancellable

Passed, or left out: a <GCancellable>, or #f.

an optional <GCancellable> cancellation object

callback

Passed, or left out: a procedure, or #f.

will be called when the interaction completes

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data to pass to the callback

Method: tls-interaction:request-certificate-finish self result ⇒ %return
Method: request-certificate-finish self result ⇒ %return

Complete a request certificate user interaction request. This should be once the tls-interaction:request-certificate-async completion callback is called.

If handled is returned, then the <GTlsConnection> passed to tls-interaction:request-certificate-async will have had its tls-connection:certificate filled in.

If the interaction is cancelled by the cancellation object, or by the user then failed will be returned with an error that contains a cancelled error code.

self

Passed: a <GTlsInteraction>.

a <GTlsInteraction> object

result

Passed: a <GAsyncResult>.

the result passed to the callback

%return

Returned: a <GTlsInteractionResult>.

The status of the request certificate interaction.

Virtual methods

Virtual method: tls-interaction:do-ask-password implementor self password [cancellable] ⇒ %return

Run synchronous interaction to ask the user for a password. In general, tls-interaction: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 failed will be returned with an error that contains a cancelled error code. Certain implementations may not support immediate cancellation.

To override it in a new class, give register-type #:vfuncs `((ask-password . ,procedure)). The procedure is called as (procedure self password cancellable) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GTlsInteraction>, or a class that derives from it, or its GType number.

self

Passed: a <GTlsInteraction>.

a <GTlsInteraction> object

password

Passed: a <GTlsPassword>.

a <GTlsPassword> object

cancellable

Passed, or left out: a <GCancellable>, or #f.

an optional <GCancellable> cancellation object

%return

Returned: a <GTlsInteractionResult>.

The status of the ask password interaction.

Virtual method: tls-interaction:do-ask-password-async implementor self password [cancellable] [callback]

Run asynchronous interaction to ask the user for a password. In general, tls-interaction: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 failed will be returned with an error that contains a cancelled error code. Certain implementations may not support immediate cancellation.

Certain implementations may not support immediate cancellation.

To override it in a new class, give register-type #:vfuncs `((ask-password-async . ,procedure)). The procedure is called as (procedure self password cancellable callback user-data).

implementor

Passed: the class whose implementation to call: <GTlsInteraction>, or a class that derives from it, or its GType number.

self

Passed: a <GTlsInteraction>.

a <GTlsInteraction> object

password

Passed: a <GTlsPassword>.

a <GTlsPassword> object

cancellable

Passed, or left out: a <GCancellable>, or #f.

an optional <GCancellable> cancellation object

callback

Passed, or left out: a procedure, or #f.

will be called when the interaction completes

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data to pass to the callback

Virtual method: tls-interaction:do-ask-password-finish implementor self result ⇒ %return

Complete an ask password user interaction request. This should be once the tls-interaction:ask-password-async completion callback is called.

If handled is returned, then the <GTlsPassword> passed to tls-interaction:ask-password will have its password filled in.

If the interaction is cancelled by the cancellation object, or by the user then failed will be returned with an error that contains a cancelled error code.

To override it in a new class, give register-type #:vfuncs `((ask-password-finish . ,procedure)). The procedure is called as (procedure self result) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GTlsInteraction>, or a class that derives from it, or its GType number.

self

Passed: a <GTlsInteraction>.

a <GTlsInteraction> object

result

Passed: a <GAsyncResult>.

the result passed to the callback

%return

Returned: a <GTlsInteractionResult>.

The status of the ask password interaction.

Virtual method: tls-interaction:do-request-certificate implementor self connection flags [cancellable] ⇒ %return

Run synchronous interaction to ask the user to choose a certificate to use with the connection. In general, tls-interaction: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 handled is returned, then the <GTlsConnection> passed to tls-interaction:request-certificate will have had its tls-connection:certificate filled in.

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

To override it in a new class, give register-type #:vfuncs `((request-certificate . ,procedure)). The procedure is called as (procedure self connection flags cancellable) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GTlsInteraction>, or a class that derives from it, or its GType number.

self

Passed: a <GTlsInteraction>.

a <GTlsInteraction> object

connection

Passed: a <GTlsConnection>.

a <GTlsConnection> object

flags

Passed: a <GTlsCertificateRequestFlags>, or a list of its symbols, or one of them.

flags providing more information about the request

cancellable

Passed, or left out: a <GCancellable>, or #f.

an optional <GCancellable> cancellation object

%return

Returned: a <GTlsInteractionResult>.

The status of the request certificate interaction.

Virtual method: tls-interaction:do-request-certificate-async implementor self connection flags [cancellable] [callback]

Run asynchronous interaction to ask the user for a certificate to use with the connection. In general, tls-interaction: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.

To override it in a new class, give register-type #:vfuncs `((request-certificate-async . ,procedure)). The procedure is called as (procedure self connection flags cancellable callback user-data).

implementor

Passed: the class whose implementation to call: <GTlsInteraction>, or a class that derives from it, or its GType number.

self

Passed: a <GTlsInteraction>.

a <GTlsInteraction> object

connection

Passed: a <GTlsConnection>.

a <GTlsConnection> object

flags

Passed: a <GTlsCertificateRequestFlags>, or a list of its symbols, or one of them.

flags providing more information about the request

cancellable

Passed, or left out: a <GCancellable>, or #f.

an optional <GCancellable> cancellation object

callback

Passed, or left out: a procedure, or #f.

will be called when the interaction completes

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data to pass to the callback

Virtual method: tls-interaction:do-request-certificate-finish implementor self result ⇒ %return

Complete a request certificate user interaction request. This should be once the tls-interaction:request-certificate-async completion callback is called.

If handled is returned, then the <GTlsConnection> passed to tls-interaction:request-certificate-async will have had its tls-connection:certificate filled in.

If the interaction is cancelled by the cancellation object, or by the user then failed will be returned with an error that contains a cancelled error code.

To override it in a new class, give register-type #:vfuncs `((request-certificate-finish . ,procedure)). The procedure is called as (procedure self result) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GTlsInteraction>, or a class that derives from it, or its GType number.

self

Passed: a <GTlsInteraction>.

a <GTlsInteraction> object

result

Passed: a <GAsyncResult>.

the result passed to the callback

%return

Returned: a <GTlsInteractionResult>.

The status of the request certificate interaction.