Trait gio::prelude::TlsInteractionExt[][src]

pub trait TlsInteractionExt: 'static {
    fn ask_password<P: IsA<TlsPassword>, Q: IsA<Cancellable>>(
        &self,
        password: &P,
        cancellable: Option<&Q>
    ) -> Result<TlsInteractionResult, Error>;
fn ask_password_async<P: IsA<TlsPassword>, Q: IsA<Cancellable>, R: FnOnce(Result<TlsInteractionResult, Error>) + Send + 'static>(
        &self,
        password: &P,
        cancellable: Option<&Q>,
        callback: R
    );
fn ask_password_async_future<P: IsA<TlsPassword> + Clone + 'static>(
        &self,
        password: &P
    ) -> Pin<Box_<dyn Future<Output = Result<TlsInteractionResult, Error>> + 'static>>;
fn invoke_ask_password<P: IsA<TlsPassword>, Q: IsA<Cancellable>>(
        &self,
        password: &P,
        cancellable: Option<&Q>
    ) -> Result<TlsInteractionResult, Error>;
fn invoke_request_certificate<P: IsA<TlsConnection>, Q: IsA<Cancellable>>(
        &self,
        connection: &P,
        flags: TlsCertificateRequestFlags,
        cancellable: Option<&Q>
    ) -> Result<TlsInteractionResult, Error>;
fn request_certificate<P: IsA<TlsConnection>, Q: IsA<Cancellable>>(
        &self,
        connection: &P,
        flags: TlsCertificateRequestFlags,
        cancellable: Option<&Q>
    ) -> Result<TlsInteractionResult, Error>;
fn request_certificate_async<P: IsA<TlsConnection>, Q: IsA<Cancellable>, R: FnOnce(Result<TlsInteractionResult, Error>) + Send + 'static>(
        &self,
        connection: &P,
        flags: TlsCertificateRequestFlags,
        cancellable: Option<&Q>,
        callback: R
    );
fn request_certificate_async_future<P: IsA<TlsConnection> + Clone + 'static>(
        &self,
        connection: &P,
        flags: TlsCertificateRequestFlags
    ) -> Pin<Box_<dyn Future<Output = Result<TlsInteractionResult, Error>> + 'static>>; }
Expand description

Trait containing all TlsInteraction methods.

Implementors

TlsInteraction

Required methods

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

password

a TlsPassword object

cancellable

an optional Cancellable cancellation object

Returns

The status of the ask password interaction.

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

Certain implementations may not support immediate cancellation.

password

a TlsPassword object

cancellable

an optional Cancellable cancellation object

callback

will be called when the interaction completes

Invoke the interaction to ask the user for a password. It invokes this interaction in the main loop, specifically the glib::MainContext returned by glib::MainContext::thread_default() when the interaction is created. This is called by called by TlsConnection or TlsDatabase 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 TlsInteractionResult::Failed will be returned with an error that contains a IOErrorEnum::Cancelled error code. Certain implementations may not support immediate cancellation.

password

a TlsPassword object

cancellable

an optional Cancellable cancellation object

Returns

The status of the ask password interaction.

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::MainContext returned by glib::MainContext::thread_default() when the interaction is created. This is called by called by TlsConnection 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 TlsInteractionResult::Failed will be returned with an error that contains a IOErrorEnum::Cancelled error code. Certain implementations may not support immediate cancellation.

connection

a TlsConnection object

flags

flags providing more information about the request

cancellable

an optional Cancellable cancellation object

Returns

The status of the certificate request interaction.

Run synchronous interaction to ask the user to choose a certificate to use with the connection. In general, 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 TlsInteractionResult::Handled is returned, then the TlsConnection passed to request_certificate() will have had its property::TlsConnection::certificate filled in.

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

connection

a TlsConnection object

flags

flags providing more information about the request

cancellable

an optional Cancellable cancellation object

Returns

The status of the request certificate interaction.

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

connection

a TlsConnection object

flags

flags providing more information about the request

cancellable

an optional Cancellable cancellation object

callback

will be called when the interaction completes

Implementors