NMA4.CertChooser

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Grid Gtk.Grid NMA4.CertChooser NMA4.CertChooser Gtk.Grid->NMA4.CertChooser Gtk.Orientable->Gtk.Grid Gtk.Widget->Gtk.Grid

Subclasses:

None

Methods

Inherited:

Gtk.Grid (23), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Orientable (2)

Structs:

Gtk.WidgetClass (18), 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.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Gtk.Grid (5), Gtk.Widget (34), Gtk.Accessible (1), Gtk.Orientable (1)

Name

Type

Flags

Short Description

flags

int

w/co

Certificate Chooser Flags

title

str

w/co

Certificate Chooser Title

Signals

Inherited:

Gtk.Widget (13), 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.Widget (13), GObject.Object (1)

Class Details

class NMA4.CertChooser(**kwargs)
Bases:

Gtk.Grid

Abstract:

No

Structure:

NMA4.CertChooserClass

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

  • flags (NMA4.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 NMA4.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 NMA4.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 NMA4.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 NMA4.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 NMA4.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 NMA4.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 NMA4.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

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

cert-password-validate

Flags:

RUN_LAST

Parameters:

cert_chooser (NMA4.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 NMA4.CertChooser.validate() to fail.

New in version 1.8.0.

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

cert-validate

Flags:

RUN_LAST

Parameters:

cert_chooser (NMA4.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 NMA4.CertChooser.validate() to fail.

New in version 1.8.0.

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

changed

Flags:

RUN_LAST, NO_RECURSE

Parameters:

cert_chooser (NMA4.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.

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

key-password-validate

Flags:

RUN_LAST

Parameters:

cert_chooser (NMA4.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 NMA4.CertChooser.validate() to fail.

New in version 1.8.0.

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

key-validate

Flags:

RUN_LAST

Parameters:

cert_chooser (NMA4.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 NMA4.CertChooser.validate() to fail.

New in version 1.8.0.

Property Details

NMA4.CertChooser.props.flags
Name:

flags

Type:

int

Default Value:

0

Flags:

WRITABLE, CONSTRUCT_ONLY

Certificate Chooser Flags

NMA4.CertChooser.props.title
Name:

title

Type:

str

Default Value:

None

Flags:

WRITABLE, CONSTRUCT_ONLY

Certificate Chooser Title