| Top |
| GTlsPassword * | g_tls_password_new () |
| const guchar * | g_tls_password_get_value () |
| void | g_tls_password_set_value () |
| void | g_tls_password_set_value_full () |
| const gchar * | g_tls_password_get_description () |
| void | g_tls_password_set_description () |
| GTlsPasswordFlags | g_tls_password_get_flags () |
| void | g_tls_password_set_flags () |
| const gchar * | g_tls_password_get_warning () |
| void | g_tls_password_set_warning () |
| gchar * | description | Read / Write |
| GTlsPasswordFlags | flags | Read / Write |
| gchar * | warning | Read / Write |
GTlsPassword * g_tls_password_new (GTlsPasswordFlags flags,const gchar *description);
Create a new GTlsPassword object.
const guchar * g_tls_password_get_value (GTlsPassword *password,gsize *length);
Get the password value. If length
is not NULL then it will be
filled in with the length of the password value. (Note that the
password value is not nul-terminated, so you can only pass NULL
for length
in contexts where you know the password will have a
certain fixed length.)
password |
a GTlsPassword object |
|
length |
location to place the length of the password. |
[nullable] |
Since: 2.30
void g_tls_password_set_value (GTlsPassword *password,const guchar *value,gssize length);
Set the value for this password. The value
will be copied by the password
object.
Specify the length
, for a non-nul-terminated password. Pass -1 as
length
if using a nul-terminated password, and length
will be
calculated automatically. (Note that the terminating nul is not
considered part of the password in this case.)
password |
a GTlsPassword object |
|
value |
the new password value. |
[array length=length] |
length |
the length of the password, or -1 |
Since: 2.30
void g_tls_password_set_value_full (GTlsPassword *password,guchar *value,gssize length,GDestroyNotify destroy);
Provide the value for this password.
The value
will be owned by the password object, and later freed using
the destroy
function callback.
Specify the length
, for a non-nul-terminated password. Pass -1 as
length
if using a nul-terminated password, and length
will be
calculated automatically. (Note that the terminating nul is not
considered part of the password in this case.)
Virtual: set_value
password |
a GTlsPassword object |
|
value |
the value for the password. |
[array length=length] |
length |
the length of the password, or -1 |
|
destroy |
a function to use to free the password. |
[nullable] |
Since: 2.30
const gchar *
g_tls_password_get_description (GTlsPassword *password);
Get a description string about what the password will be used for.
Since: 2.30
void g_tls_password_set_description (GTlsPassword *password,const gchar *description);
Set a description string about what the password will be used for.
Since: 2.30
GTlsPasswordFlags
g_tls_password_get_flags (GTlsPassword *password);
Get flags about the password.
Since: 2.30
void g_tls_password_set_flags (GTlsPassword *password,GTlsPasswordFlags flags);
Set flags about the password.
Since: 2.30
const gchar *
g_tls_password_get_warning (GTlsPassword *password);
Get a user readable translated warning. Usually this warning is a
representation of the password flags returned from
g_tls_password_get_flags().
Since: 2.30
void g_tls_password_set_warning (GTlsPassword *password,const gchar *warning);
Set a user readable translated warning. Usually this warning is a
representation of the password flags returned from
g_tls_password_get_flags().
Since: 2.30
typedef struct _GTlsPassword GTlsPassword;
An abstract interface representing a password used in TLS. Often used in user interaction such as unlocking a key storage token.
Since: 2.30
struct GTlsPasswordClass {
GObjectClass parent_class;
/* methods */
const guchar * ( *get_value) (GTlsPassword *password,
gsize *length);
void ( *set_value) (GTlsPassword *password,
guchar *value,
gssize length,
GDestroyNotify destroy);
const gchar* ( *get_default_warning) (GTlsPassword *password);
};
Class structure for GTlsPassword.
virtual method for |
||
virtual method for |
||
virtual method for |
Various flags for the password.
|
No flags |
||
|
The password was wrong, and the user should retry. |
||
|
Hint to the user that the password has been wrong many times, and the user may not have many chances left. |
||
|
Hint to the user that this is the last try to get this password right. |
Since: 2.30
“description” property “description” gchar *
Description of what the password is for.
Owner: GTlsPassword
Flags: Read / Write
Default value: NULL
“flags” property“flags” GTlsPasswordFlags
Flags about the password.
Owner: GTlsPassword
Flags: Read / Write