Functions
g_tls_password_get_value ()
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.)
Returns
The password value (owned by the password object).
Since: 2.30
g_tls_password_set_value ()
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.)
Since: 2.30
g_tls_password_set_value_full ()
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
Since: 2.30
g_tls_password_get_description ()
const gchar *
g_tls_password_get_description (GTlsPassword *password);
Get a description string about what the password will be used for.
Returns
The description of the password.
Since: 2.30
g_tls_password_set_description ()
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
g_tls_password_get_flags ()
GTlsPasswordFlags
g_tls_password_get_flags (GTlsPassword *password);
Get flags about the password.
Returns
The flags about the password.
Since: 2.30
g_tls_password_get_warning ()
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
g_tls_password_set_warning ()
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
Types and Values
GTlsPassword
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
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.
enum GTlsPasswordFlags
Various flags for the password.
Since: 2.30