: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` :Constructors: :: TlsPassword(**properties) new(flags:Gio.TlsPasswordFlags, description:str) -> Gio.TlsPassword 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:: 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() -> bytes 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: ~typing.Sequence[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: ~typing.Sequence[int], destroy: ~typing.Callable[[None], 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 Description of what the password is for. .. versionadded:: 2.30 .. attribute:: props.flags :type: ~gi.repository.Gio.TlsPasswordFlags Flags about the password. .. versionadded:: 2.30 .. attribute:: props.warning :type: str Warning about the password. .. versionadded:: 2.30 Virtual Methods --------------- .. rst-class:: interim-class .. class:: TlsPassword :no-index: .. method:: do_get_default_warning() -> str virtual method for :func:`~gi.repository.Gio.TlsPassword.get_warning` if no value has been set using :func:`~gi.repository.Gio.TlsPassword.set_warning` .. method:: do_get_value() -> bytes 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: ~typing.Sequence[int], destroy: ~typing.Callable[[None], 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