Top | ![]() |
![]() |
![]() |
![]() |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkGrid ╰── NMACertChooser
Certificate chooser allows for selection of a certificate or various schemes optionally accompanied with a key and passwords or PIN.
The widgets that implement this interface may allow selecting the certificates from various sources such as files or cryptographic tokens.
void nma_cert_chooser_set_cert (NMACertChooser *cert_chooser
,const gchar *value
,NMSetting8021xCKScheme scheme
);
Sets the certificate location for the chooser button.
cert_chooser |
certificate chooser button instance |
|
value |
the path or URI of a certificate |
|
scheme |
the scheme of the certificate path |
Since: 1.8.0
void nma_cert_chooser_set_cert_uri (NMACertChooser *cert_chooser
,const gchar *uri
);
Sets the certificate URI for the chooser button.
Since: 1.8.0
gchar * nma_cert_chooser_get_cert (NMACertChooser *cert_chooser
,NMSetting8021xCKScheme *scheme
);
Gets the real certificate location from the chooser button along with the scheme.
cert_chooser |
certificate chooser button instance |
|
scheme |
the scheme of the returned certificate path. |
[out] |
Since: 1.8.0
gchar *
nma_cert_chooser_get_cert_uri (NMACertChooser *cert_chooser
);
Gets the real certificate URI from the chooser button along with the scheme.
Since: 1.8.0
void nma_cert_chooser_set_cert_password (NMACertChooser *cert_chooser
,const gchar *password
);
Sets the password or a PIN that might be required to access the certificate.
cert_chooser |
certificate chooser button instance |
|
password |
the certificate PIN or password |
Since: 1.8.0
const gchar *
nma_cert_chooser_get_cert_password (NMACertChooser *cert_chooser
);
Obtains the password or a PIN that was be required to access the certificate.
Since: 1.8.0
void nma_cert_chooser_set_key (NMACertChooser *cert_chooser
,const gchar *value
,NMSetting8021xCKScheme scheme
);
Sets the key location for the chooser button.
cert_chooser |
certificate chooser button instance |
|
value |
the path or URI of a key |
|
scheme |
the scheme of the key path |
Since: 1.8.0
void nma_cert_chooser_set_key_uri (NMACertChooser *cert_chooser
,const gchar *uri
);
Sets the key URI for the chooser button.
Since: 1.8.0
gchar * nma_cert_chooser_get_key (NMACertChooser *cert_chooser
,NMSetting8021xCKScheme *scheme
);
Gets the real key location from the chooser button along with the scheme.
cert_chooser |
certificate chooser button instance |
|
scheme |
the scheme of the returned key path. |
[out] |
Since: 1.8.0
gchar *
nma_cert_chooser_get_key_uri (NMACertChooser *cert_chooser
);
Gets the real key URI from the chooser button along with the scheme.
Since: 1.8.0
void nma_cert_chooser_set_key_password (NMACertChooser *cert_chooser
,const gchar *password
);
Sets the password or a PIN that might be required to access the key.
Since: 1.8.0
const gchar *
nma_cert_chooser_get_key_password (NMACertChooser *cert_chooser
);
Obtains the password or a PIN that was be required to access the key.
Since: 1.8.0
GtkWidget * nma_cert_chooser_new (const gchar *title
,NMACertChooserFlags flags
);
Constructs the button that is capable of selecting a certificate and a key.
title |
title of the certificate chooser dialog |
|
flags |
the flags that configure the capabilities of the button |
Since: 1.8.0
void nma_cert_chooser_add_to_size_group (NMACertChooser *cert_chooser
,GtkSizeGroup *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 NMACertChooser is a GtkGrid with two columns with the labels in the first one.
Since: 1.8.0
gboolean nma_cert_chooser_validate (NMACertChooser *cert_chooser
,GError **error
);
Validates whether the chosen values make sense. The users can do further validation by subscribing to the "*-changed" signals and returning an error themselves.
Since: 1.8.0
void nma_cert_chooser_setup_cert_password_storage (NMACertChooser *cert_chooser
,NMSettingSecretFlags initial_flags
,NMSetting *setting
,const char *password_flags_name
,gboolean with_not_required
,gboolean ask_mode
);
This method basically calls nma_utils_setup_password_storage()
on the certificate password entry, in case one is present.
cert_chooser |
certificate chooser button instance |
|
initial_flags |
initial secret flags to setup password menu from |
|
setting |
NMSetting containing the password, or NULL |
|
password_flags_name |
name of the secret flags (like psk-flags), or NULL |
|
with_not_required |
whether to include "Not required" menu item |
|
ask_mode |
|
Since: 1.8.0
void nma_cert_chooser_update_cert_password_storage (NMACertChooser *cert_chooser
,NMSettingSecretFlags secret_flags
,NMSetting *setting
,const char *password_flags_name
);
This method basically calls nma_utils_update_password_storage()
on the certificate password entry, in case one is present.
cert_chooser |
certificate chooser button instance |
|
secret_flags |
secret flags to set |
|
setting |
NMSetting containing the password, or NULL |
|
password_flags_name |
name of the secret flags (like psk-flags), or NULL |
Since: 1.8.0
NMSettingSecretFlags
nma_cert_chooser_get_cert_password_flags
(NMACertChooser *cert_chooser
);
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.
Since: 1.8.0
void nma_cert_chooser_setup_key_password_storage (NMACertChooser *cert_chooser
,NMSettingSecretFlags initial_flags
,NMSetting *setting
,const char *password_flags_name
,gboolean with_not_required
,gboolean ask_mode
);
This method basically calls nma_utils_setup_password_storage()
on the key password entry, in case one is present.
cert_chooser |
certificate chooser button instance |
|
initial_flags |
initial secret flags to setup password menu from |
|
setting |
NMSetting containing the password, or NULL |
|
password_flags_name |
name of the secret flags (like psk-flags), or NULL |
|
with_not_required |
whether to include "Not required" menu item |
|
ask_mode |
|
Since: 1.8.0
void nma_cert_chooser_update_key_password_storage (NMACertChooser *cert_chooser
,NMSettingSecretFlags secret_flags
,NMSetting *setting
,const char *password_flags_name
);
This method basically calls nma_utils_update_password_storage()
on the key password entry, in case one is present.
cert_chooser |
certificate chooser button instance |
|
secret_flags |
secret flags to set |
|
setting |
NMSetting containing the password, or NULL |
|
password_flags_name |
name of the secret flags (like psk-flags), or NULL |
Since: 1.8.0
NMSettingSecretFlags
nma_cert_chooser_get_key_password_flags
(NMACertChooser *cert_chooser
);
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.
Since: 1.8.0
Flags that controls what is the certificate chooser button able to pick. Currently only local files are supported, but might be extended to use URIs, such as PKCS#11 certificate URIs in future as well.
Since: 1.8.0
“flags”
property“flags” guint
Certificate Chooser Flags.
Flags: Write / Construct Only
Allowed values: <= 7
Default value: 0
“title”
property“title” gchar *
Certificate Chooser Title.
Flags: Write / Construct Only
Default value: NULL
“cert-password-validate”
signalGError* user_function (NMACertChooser *nmacertchooser, gpointer user_data)
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_cert_chooser_validate()
to fail.
Flags: Run Last
Since: 1.8.0
“cert-validate”
signalGError* user_function (NMACertChooser *nmacertchooser, gpointer user_data)
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_cert_chooser_validate()
to fail.
Flags: Run Last
Since: 1.8.0
“changed”
signalvoid user_function (NMACertChooser *nmacertchooser, gpointer user_data)
Emitted when anything changes in the certificate chooser, be it a certificate, a key or associated passwords.
Flags: No Recursion
Since: 1.8.0
“key-password-validate”
signalGError* user_function (NMACertChooser *nmacertchooser, gpointer user_data)
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_cert_chooser_validate()
to fail.
Flags: Run Last
Since: 1.8.0
“key-validate”
signalGError* user_function (NMACertChooser *nmacertchooser, gpointer user_data)
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_cert_chooser_validate()
to fail.
Flags: Run Last
Since: 1.8.0