:right-sidebar: True TlsPassword =================================================================== .. currentmodule:: gi.repository.Gio .. versionadded:: 2.30 .. class:: TlsPassword(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` An abstract interface representing a password used in TLS. Often used in user interaction such as unlocking a key storage token. Constructors ------------ .. rst-class:: interim-class .. class:: TlsPassword :no-index: .. classmethod:: new(flags: ~gi.repository.Gio.TlsPasswordFlags, description: str) -> ~gi.repository.Gio.TlsPassword Create a new :obj:`~gi.repository.Gio.TlsPassword` object. :param flags: the password flags :param description: description of what the password is for Methods ------- .. rst-class:: interim-class .. class:: TlsPassword :no-index: .. method:: do_get_default_warning(self) -> str .. method:: do_get_value(self) -> list[int] .. method:: do_set_value(self, value: list[int], destroy: ~typing.Callable[[~typing.Any], None] | None = None) -> None :param value: :param destroy: .. method:: get_description() -> str Get a description string about what the password will be used for. .. versionadded:: 2.30 .. method:: get_flags() -> ~gi.repository.Gio.TlsPasswordFlags Get flags about the password. .. versionadded:: 2.30 .. method:: get_value() -> list[int] Get the password value. If ``length`` is not :const:`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 :const:`None` for ``length`` in contexts where you know the password will have a certain fixed length.) .. versionadded:: 2.30 .. method:: get_warning() -> str Get a user readable translated warning. Usually this warning is a representation of the password flags returned from :func:`~gi.repository.Gio.TlsPassword.get_flags`. .. versionadded:: 2.30 .. method:: set_description(description: str) -> None Set a description string about what the password will be used for. .. versionadded:: 2.30 :param description: The description of the password .. method:: set_flags(flags: ~gi.repository.Gio.TlsPasswordFlags) -> None Set flags about the password. .. versionadded:: 2.30 :param flags: The flags about the password .. method:: set_value(value: list[int]) -> None 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.) .. versionadded:: 2.30 :param value: the new password value .. method:: set_value_full(value: list[int], destroy: ~typing.Callable[[~typing.Any], None] | None = None) -> None 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.) .. versionadded:: 2.30 :param value: the value for the password :param destroy: a function to use to free the password. .. method:: set_warning(warning: str) -> None Set a user readable translated warning. Usually this warning is a representation of the password flags returned from :func:`~gi.repository.Gio.TlsPassword.get_flags`. .. versionadded:: 2.30 :param warning: The user readable warning Properties ---------- .. rst-class:: interim-class .. class:: TlsPassword :no-index: .. attribute:: props.description :type: str The type of the None singleton. .. versionadded:: 2.30 .. attribute:: props.flags :type: ~gi.repository.Gio.TlsPasswordFlags The type of the None singleton. .. versionadded:: 2.30 .. attribute:: props.warning :type: str The type of the None singleton. .. versionadded:: 2.30 Virtual Methods --------------- .. rst-class:: interim-class .. class:: TlsPassword :no-index: .. method:: do_get_default_warning() -> str The type of the None singleton. .. method:: do_get_value() -> list[int] Get the password value. If ``length`` is not :const:`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 :const:`None` for ``length`` in contexts where you know the password will have a certain fixed length.) .. versionadded:: 2.30 .. method:: do_set_value(value: list[int], destroy: ~typing.Callable[[~typing.Any], None] | None = None) -> None 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.) .. versionadded:: 2.30 :param value: the value for the password :param destroy: a function to use to free the password. Fields ------ .. rst-class:: interim-class .. class:: TlsPassword :no-index: .. attribute:: parent_instance .. attribute:: priv