Gio.TlsPassword

g GObject.Object GObject.Object Gio.TlsPassword Gio.TlsPassword GObject.Object->Gio.TlsPassword

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (flags, description)

get_description ()

get_flags ()

get_value ()

get_warning ()

set_description (description)

set_flags (flags)

set_value (value)

set_value_full (value, destroy)

set_warning (warning)

Virtual Methods

Inherited:

GObject.Object (7)

do_get_default_warning ()

do_get_value ()

do_set_value (value, destroy)

Properties

Name

Type

Flags

Short Description

description

str

r/w

flags

Gio.TlsPasswordFlags

r/w

warning

str

r/w

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Gio.TlsPassword(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gio.TlsPasswordClass

An abstract interface representing a password used in TLS. Often used in user interaction such as unlocking a key storage token.

New in version 2.30.

classmethod new(flags, description)[source]
Parameters:
  • flags (Gio.TlsPasswordFlags) – the password flags

  • description (str) – description of what the password is for

Returns:

The newly allocated password object

Return type:

Gio.TlsPassword

Create a new Gio.TlsPassword object.

get_description()[source]
Returns:

The description of the password.

Return type:

str

Get a description string about what the password will be used for.

New in version 2.30.

get_flags()[source]
Returns:

The flags about the password.

Return type:

Gio.TlsPasswordFlags

Get flags about the password.

New in version 2.30.

get_value()[source]
Returns:

The password value (owned by the password object).

Return type:

bytes

Get the password value. If length is not None 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 None for length in contexts where you know the password will have a certain fixed length.)

New in version 2.30.

get_warning()[source]
Returns:

The warning.

Return type:

str

Get a user readable translated warning. Usually this warning is a representation of the password flags returned from Gio.TlsPassword.get_flags().

New in version 2.30.

set_description(description)[source]
Parameters:

description (str) – The description of the password

Set a description string about what the password will be used for.

New in version 2.30.

set_flags(flags)[source]
Parameters:

flags (Gio.TlsPasswordFlags) – The flags about the password

Set flags about the password.

New in version 2.30.

set_value(value)[source]
Parameters:

value (bytes) – the new password value

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.)

New in version 2.30.

set_value_full(value, destroy)[source]
Parameters:

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.)

New in version 2.30.

set_warning(warning)[source]
Parameters:

warning (str) – The user readable warning

Set a user readable translated warning. Usually this warning is a representation of the password flags returned from Gio.TlsPassword.get_flags().

New in version 2.30.

do_get_default_warning() virtual
Return type:

str

virtual method for Gio.TlsPassword.get_warning() if no value has been set using Gio.TlsPassword.set_warning()

do_get_value() virtual
Returns:

The password value (owned by the password object).

Return type:

bytes

Get the password value. If length is not None 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 None for length in contexts where you know the password will have a certain fixed length.)

New in version 2.30.

do_set_value(value, destroy) virtual
Parameters:

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.)

New in version 2.30.

Property Details

Gio.TlsPassword.props.description
Name:

description

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Description of what the password is for.

New in version 2.30.

Gio.TlsPassword.props.flags
Name:

flags

Type:

Gio.TlsPasswordFlags

Default Value:

Gio.TlsPasswordFlags.NONE

Flags:

READABLE, WRITABLE

Flags about the password.

New in version 2.30.

Gio.TlsPassword.props.warning
Name:

warning

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Warning about the password.

New in version 2.30.