NMA.CertChooser

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Grid Gtk.Grid Gtk.Container->Gtk.Grid NMA.CertChooser NMA.CertChooser Gtk.Grid->NMA.CertChooser Gtk.Orientable->Gtk.Grid Gtk.Widget->Gtk.Container

Subclasses:

None

Methods

Inherited:

Gtk.Grid (21), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new (title, flags)

add_to_size_group (group)

get_cert ()

get_cert_password ()

get_cert_password_flags ()

get_cert_uri ()

get_key ()

get_key_password ()

get_key_password_flags ()

get_key_uri ()

set_cert (value, scheme)

set_cert_password (password)

set_cert_uri (uri)

set_key (value, scheme)

set_key_password (password)

set_key_uri (uri)

setup_cert_password_storage (initial_flags, setting, password_flags_name, with_not_required, ask_mode)

setup_key_password_storage (initial_flags, setting, password_flags_name, with_not_required, ask_mode)

update_cert_password_storage (secret_flags, setting, password_flags_name)

update_key_password_storage (secret_flags, setting, password_flags_name)

validate ()

Virtual Methods

Inherited:

Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

Properties

Inherited:

Gtk.Grid (5), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1)

Name

Type

Flags

Short Description

flags

int

w/co

Certificate Chooser Flags

title

str

w/co

Certificate Chooser Title

Child Properties

Inherited:

Gtk.Grid (4)

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Short Description

cert-password-validate

Emitted when the certificate password needs validation.

cert-validate

Emitted when the certificate needs validation.

changed

Emitted when anything changes in the certificate chooser, be it a certificate, a key or associated passwords.

key-password-validate

Emitted when the key password needs validation.

key-validate

Emitted when the key needs validation.

Fields

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Class Details

class NMA.CertChooser(**kwargs)
Bases:

Gtk.Grid

Abstract:

No

Structure:

NMA.CertChooserClass

classmethod new(title, flags)
Parameters:
  • title (str) – title of the certificate chooser dialog

  • flags (NMA.CertChooserFlags) – the flags that configure the capabilities of the button

Returns:

the certificate chooser button instance

Return type:

Gtk.Widget

Constructs the button that is capable of selecting a certificate and a key.

New in version 1.8.0.

add_to_size_group(group)
Parameters:

group (Gtk.SizeGroup) – a size group

Adds the labels to the specified size group so that they are aligned nicely with other entries in a form.

It is expected that the NMA.CertChooser is a Gtk.Grid with two columns with the labels in the first one.

New in version 1.8.0.

get_cert()
Returns:

the certificate path

scheme:

the scheme of the returned certificate path

Return type:

(str or None, scheme: NM.Setting8021xCKScheme)

Gets the real certificate location from the chooser button along with the scheme.

New in version 1.8.0.

get_cert_password()
Returns:

the certificate PIN or password

Return type:

str

Obtains the password or a PIN that was be required to access the certificate.

New in version 1.8.0.

get_cert_password_flags()
Returns:

secret flags corresponding to the certificate password

Return type:

NM.SettingSecretFlags

Returns secret flags corresponding to the certificate password if one is present. The chooser would typically call into NMA.utils_menu_to_secret_flags() for the certificate password entry.

New in version 1.8.0.

get_cert_uri()
Returns:

the certificate URI

Return type:

str or None

Gets the real certificate URI from the chooser button along with the scheme.

New in version 1.8.0.

get_key()
Returns:

the key path

scheme:

the scheme of the returned key path

Return type:

(str or None, scheme: NM.Setting8021xCKScheme)

Gets the real key location from the chooser button along with the scheme.

New in version 1.8.0.

get_key_password()
Returns:

the key PIN or password

Return type:

str

Obtains the password or a PIN that was be required to access the key.

New in version 1.8.0.

get_key_password_flags()
Returns:

secret flags corresponding to the key password

Return type:

NM.SettingSecretFlags

Returns secret flags corresponding to the key password if one is present. The chooser would typically call into NMA.utils_menu_to_secret_flags() for the key password entry.

New in version 1.8.0.

get_key_uri()
Returns:

the key URI

Return type:

str or None

Gets the real key URI from the chooser button along with the scheme.

New in version 1.8.0.

set_cert(value, scheme)
Parameters:

Sets the certificate location for the chooser button.

New in version 1.8.0.

set_cert_password(password)
Parameters:

password (str) – the certificate PIN or password

Sets the password or a PIN that might be required to access the certificate.

New in version 1.8.0.

set_cert_uri(uri)
Parameters:

uri (str) – the path or URI of a certificate

Sets the certificate URI for the chooser button.

New in version 1.8.0.

set_key(value, scheme)
Parameters:

Sets the key location for the chooser button.

New in version 1.8.0.

set_key_password(password)
Parameters:

password (str) – the key PIN or password

Sets the password or a PIN that might be required to access the key.

New in version 1.8.0.

set_key_uri(uri)
Parameters:

uri (str) – the URI of a key

Sets the key URI for the chooser button.

New in version 1.8.0.

setup_cert_password_storage(initial_flags, setting, password_flags_name, with_not_required, ask_mode)
Parameters:
  • initial_flags (NM.SettingSecretFlags) – initial secret flags to setup password menu from

  • setting (NM.Setting) – NM.Setting containing the password, or None

  • password_flags_name (str) – name of the secret flags (like psk-flags), or None

  • with_not_required (bool) – whether to include “Not required” menu item

  • ask_mode (bool) – True if the entry is shown in ASK mode

This method basically calls NMA.utils_setup_password_storage() on the certificate password entry, in case one is present.

New in version 1.8.0.

setup_key_password_storage(initial_flags, setting, password_flags_name, with_not_required, ask_mode)
Parameters:
  • initial_flags (NM.SettingSecretFlags) – initial secret flags to setup password menu from

  • setting (NM.Setting) – NM.Setting containing the password, or None

  • password_flags_name (str) – name of the secret flags (like psk-flags), or None

  • with_not_required (bool) – whether to include “Not required” menu item

  • ask_mode (bool) – True if the entry is shown in ASK mode

This method basically calls NMA.utils_setup_password_storage() on the key password entry, in case one is present.

New in version 1.8.0.

update_cert_password_storage(secret_flags, setting, password_flags_name)
Parameters:

This method basically calls NMA.utils_update_password_storage() on the certificate password entry, in case one is present.

New in version 1.8.0.

update_key_password_storage(secret_flags, setting, password_flags_name)
Parameters:

This method basically calls NMA.utils_update_password_storage() on the key password entry, in case one is present.

New in version 1.8.0.

validate()
Raises:

GLib.Error

Returns:

True if validation passes, False otherwise

Return type:

bool

Validates whether the chosen values make sense. The users can do further validation by subscribing to the “*-changed” signals and returning an error themselves.

New in version 1.8.0.

Signal Details

NMA.CertChooser.signals.cert_password_validate(cert_chooser)
Signal Name:

cert-password-validate

Flags:

RUN_LAST

Parameters:

cert_chooser (NMA.CertChooser) – The object which received the signal

Return type:

GLib.Error

Emitted when the certificate password needs validation. The handlers can indicate that the password is invalid by returning an error, which blocks further signal processing and causes a call to NMA.CertChooser.validate() to fail.

New in version 1.8.0.

NMA.CertChooser.signals.cert_validate(cert_chooser)
Signal Name:

cert-validate

Flags:

RUN_LAST

Parameters:

cert_chooser (NMA.CertChooser) – The object which received the signal

Return type:

GLib.Error

Emitted when the certificate needs validation. The handlers can indicate that the certificate is invalid by returning an error, which blocks further signal processing and causes a call to NMA.CertChooser.validate() to fail.

New in version 1.8.0.

NMA.CertChooser.signals.changed(cert_chooser)
Signal Name:

changed

Flags:

RUN_LAST, NO_RECURSE

Parameters:

cert_chooser (NMA.CertChooser) – The object which received the signal

Emitted when anything changes in the certificate chooser, be it a certificate, a key or associated passwords.

New in version 1.8.0.

NMA.CertChooser.signals.key_password_validate(cert_chooser)
Signal Name:

key-password-validate

Flags:

RUN_LAST

Parameters:

cert_chooser (NMA.CertChooser) – The object which received the signal

Return type:

GLib.Error

Emitted when the key password needs validation. The handlers can indicate that the password is invalid by returning an error, which blocks further signal processing and causes a call to NMA.CertChooser.validate() to fail.

New in version 1.8.0.

NMA.CertChooser.signals.key_validate(cert_chooser)
Signal Name:

key-validate

Flags:

RUN_LAST

Parameters:

cert_chooser (NMA.CertChooser) – The object which received the signal

Return type:

GLib.Error

Emitted when the key needs validation. The handlers can indicate that the key is invalid by returning an error, which blocks further signal processing and causes a call to NMA.CertChooser.validate() to fail.

New in version 1.8.0.

Property Details

NMA.CertChooser.props.flags
Name:

flags

Type:

int

Default Value:

0

Flags:

WRITABLE, CONSTRUCT_ONLY

Certificate Chooser Flags

NMA.CertChooser.props.title
Name:

title

Type:

str

Default Value:

None

Flags:

WRITABLE, CONSTRUCT_ONLY

Certificate Chooser Title