glibmm: Gio::TlsPassword Class Reference

glibmm 2.88.0

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Symbols | List of all members
Gio::TlsPassword Class Reference

TlsPassword - TLS Passwords for prompting. More...

`#include <giomm/tlspassword.h>`

Inheritance diagram for Gio::TlsPassword:
[legend]

## Public Types
enum class | Flags { Flags::NONE = 0x0 , Flags::RETRY = 1 << 1 , Flags::MANY_TRIES = 1 << 2 , Flags::FINAL_TRY = 1 << 3 , Flags::PKCS11_USER = 1 << 4 , Flags::PKCS11_SECURITY_OFFICER = 1 << 5 , Flags::PKCS11_CONTEXT_SPECIFIC = 1 << 6 }
| Various flags for the password. More...
Public Types inherited from Glib::Object
using | DestroyNotify = void (*)(gpointer data)

## Public Member Functions
| TlsPassword (TlsPassword && src) noexcept
TlsPassword & | operator= (TlsPassword && src) noexcept
| ~TlsPassword () noexcept override
GTlsPassword * | gobj ()
| Provides access to the underlying C GObject.
const GTlsPassword * | gobj () const
| Provides access to the underlying C GObject.
GTlsPassword * | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
const guchar * | get_value (gsize & length) const
| Get the password value.
const guchar * | get_value () const
| A get_value() convenience overload.
void | set_value (const guchar * value, gssize length=-1)
| Set the value for this password.
Glib::ustring | get_description () const
| Get a description string about what the password will be used for.
void | set_description (const Glib::ustring & description)
| Set a description string about what the password will be used for.
Flags | get_flags () const
| Get flags about the password.
void | set_flags (Flags flags)
| Set flags about the password.
Glib::ustring | get_warning () const
| Get a user readable translated warning.
void | set_warning (const Glib::ustring & warning)
| Set a user readable translated warning.
Glib::PropertyProxy< Glib::ustring > | property_description ()
| Description of what the password is for.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_description () const
| Description of what the password is for.
Glib::PropertyProxy< Flags > | property_flags ()
| Flags about the password.
Glib::PropertyProxy_ReadOnly< Flags > | property_flags () const
| Flags about the password.
Glib::PropertyProxy< Glib::ustring > | property_warning ()
| Warning about the password.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_warning () const
| Warning about the password.
Public Member Functions inherited from Glib::Object
| Object (const Object &)=delete
Object & | operator= (const Object &)=delete
| Object (Object && src) noexcept
Object & | operator= (Object && src) noexcept
void * | get_data (const QueryQuark & key)
void | set_data (const Quark & key, void *data)
void | set_data_with_c_callback (const Quark & key, void *data, GDestroyNotify notify)
void | set_data (const Quark & key, void *data, DestroyNotify notify)
| Prefer set_data_with_c_callback() with a callback with C linkage.
void | remove_data (const QueryQuark & quark)
void * | steal_data (const QueryQuark & quark)
Public Member Functions inherited from Glib::ObjectBase
| ObjectBase (const ObjectBase &)=delete
ObjectBase & | operator= (const ObjectBase &)=delete
void | set_property_value (const Glib::ustring & property_name, const Glib::ValueBase & value)
| You probably want to use a specific property_*() accessor method instead.
void | get_property_value (const Glib::ustring & property_name, Glib::ValueBase & value) const
| You probably want to use a specific property_*() accessor method instead.
template<class PropertyType>
void | set_property (const Glib::ustring & property_name, const PropertyType & value)
| You probably want to use a specific property_*() accessor method instead.
template<class PropertyType>
void | get_property (const Glib::ustring & property_name, PropertyType & value) const
| You probably want to use a specific property_*() accessor method instead.
template<class PropertyType>
PropertyType | get_property (const Glib::ustring & property_name) const
| You probably want to use a specific property_*() accessor method instead.
sigc::connection | connect_property_changed (const Glib::ustring & property_name, const sigc::slot< void()> & slot)
| You can use the signal_changed() signal of the property proxy instead.
sigc::connection | connect_property_changed (const Glib::ustring & property_name, sigc::slot< void()> && slot)
| You can use the signal_changed() signal of the property proxy instead.
void | freeze_notify ()
| Increases the freeze count on object.
void | thaw_notify ()
| Reverts the effect of a previous call to freeze_notify().
virtual void | reference () const
| Increment the reference count for this object.
virtual void | unreference () const
| Decrement the reference count for this object.
GObject * | gobj ()
| Provides access to the underlying C GObject.
const GObject * | gobj () const
| Provides access to the underlying C GObject.
GObject * | gobj_copy () const
| Give a ref-ed copy to someone. Use for direct struct access.

## Static Public Member Functions
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system.
static Glib::RefPtr< TlsPassword > | create (const Glib::ustring & description, Flags flags=Flags::NONE)
| Create a new TlsPassword object.

## Protected Member Functions
| TlsPassword (const Glib::ustring & description, Flags flags=Flags::NONE)
virtual const guchar * | get_value_vfunc (gsize & length) const
virtual Glib::ustring | get_default_warning_vfunc () const
Protected Member Functions inherited from Glib::Object
| Object ()
| Object (const Glib::ConstructParams & construct_params)
| Object (GObject * castitem)
| ~Object () noexcept override
Protected Member Functions inherited from Glib::ObjectBase
| ObjectBase ()
| This default constructor is called implicitly from the constructor of user-derived classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor.
| ObjectBase (const char * custom_type_name)
| A derived constructor always overrides this choice.
| ObjectBase (const std::type_info & custom_type_info)
| This constructor is a special feature to allow creation of derived types on the fly, without having to use g_object_new() manually.
| ObjectBase (ObjectBase && src) noexcept
ObjectBase & | operator= (ObjectBase && src) noexcept
virtual | ~ObjectBase () noexcept=0
void | initialize (GObject * castitem)
void | initialize_move (GObject * castitem, Glib::ObjectBase * previous_wrapper)

## Related Symbols
(Note that these are not member symbols.)
Glib::RefPtr< Gio::TlsPassword > | wrap (GTlsPassword * object, bool take_copy=false)
| A Glib::wrap() method for this object.
Related Symbols inherited from Glib::Object
Glib::RefPtr< Glib::Object > | wrap (GObject * object, bool take_copy=false)

## Detailed Description

TlsPassword - TLS Passwords for prompting.

Holds a password used in TLS.

Since glibmm 2.36

## Constructor & Destructor Documentation

## ◆ TlsPassword() [1/2]

Gio::TlsPassword::TlsPassword | ( | TlsPassword && | src | ) |
| noexcept

## ◆ ~TlsPassword()

Gio::TlsPassword::~TlsPassword | ( |  | ) |
| overridenoexcept

## ◆ TlsPassword() [2/2]

Gio::TlsPassword::TlsPassword | ( | const Glib::ustring & | description,
|  | Flags | flags = Flags::NONE )
| explicitprotected

## Member Function Documentation

## ◆ create()

Glib::RefPtr< TlsPassword > Gio::TlsPassword::create | ( | const Glib::ustring & | description,
|  | Flags | flags = Flags::NONE )
| static

Create a new TlsPassword object.

Parameters

  flags | The password flags.
  description | Description of what the password is for.

Returns
  The newly allocated password object.

## ◆ get_default_warning_vfunc()

virtual Glib::ustring Gio::TlsPassword::get_default_warning_vfunc | ( |  | ) | const
| protectedvirtual

## ◆ get_description()

Glib::ustring Gio::TlsPassword::get_description | ( |  | ) | const

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

Since glibmm 2.30

Returns
  The description of the password.

## ◆ get_flags()

Flags Gio::TlsPassword::get_flags | ( |  | ) | const

Get flags about the password.

Since glibmm 2.30

Returns
  The flags about the password.

## ◆ get_type()

GType Gio::TlsPassword::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

## ◆ get_value() [1/2]

const guchar * Gio::TlsPassword::get_value | ( |  | ) | const

A get_value() convenience overload.

## ◆ get_value() [2/2]

const guchar * Gio::TlsPassword::get_value | ( | gsize & | length | ) | const

Get the password value.

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

Since glibmm 2.30

Parameters

  length | Location to place the length of the password.

Returns
  The password value (owned by the password object).

## ◆ get_value_vfunc()

virtual const guchar * Gio::TlsPassword::get_value_vfunc | ( | gsize & | length | ) | const
| protectedvirtual

## ◆ get_warning()

Glib::ustring Gio::TlsPassword::get_warning | ( |  | ) | const

Get a user readable translated warning.

Usually this warning is a representation of the password flags returned from g_tls_password_get_flags().

Since glibmm 2.30

Returns
  The warning.

## ◆ gobj() [1/2]

GTlsPassword * Gio::TlsPassword::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const GTlsPassword * Gio::TlsPassword::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ gobj_copy()

GTlsPassword * Gio::TlsPassword::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

## ◆ operator=()

TlsPassword & Gio::TlsPassword::operator= | ( | TlsPassword && | src | ) |
| noexcept

## ◆ property_description() [1/2]

Glib::PropertyProxy< Glib::ustring > Gio::TlsPassword::property_description | ( |  | ) |

Description of what the password is for.

Since glibmm 2.30

Default value: ""

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_description() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gio::TlsPassword::property_description | ( |  | ) | const

Description of what the password is for.

Since glibmm 2.30

Default value: ""

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_flags() [1/2]

Glib::PropertyProxy< Flags > Gio::TlsPassword::property_flags | ( |  | ) |

Flags about the password.

Since glibmm 2.30

Default value: Gio::TlsPassword::Flags::NONE

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_flags() [2/2]

Glib::PropertyProxy_ReadOnly< Flags > Gio::TlsPassword::property_flags | ( |  | ) | const

Flags about the password.

Since glibmm 2.30

Default value: Gio::TlsPassword::Flags::NONE

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ property_warning() [1/2]

Glib::PropertyProxy< Glib::ustring > Gio::TlsPassword::property_warning | ( |  | ) |

Warning about the password.

Since glibmm 2.30

Default value: ""

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## ◆ property_warning() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gio::TlsPassword::property_warning | ( |  | ) | const

Warning about the password.

Since glibmm 2.30

Default value: ""

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## ◆ set_description()

void Gio::TlsPassword::set_description | ( | const Glib::ustring & | description | ) |

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

Since glibmm 2.30

Parameters

  description | The description of the password.

## ◆ set_flags()

void Gio::TlsPassword::set_flags | ( | Flags | flags | ) |

Set flags about the password.

Since glibmm 2.30

Parameters

  flags | The flags about the password.

## ◆ set_value()

void Gio::TlsPassword::set_value | ( | const guchar * | value,
|  | gssize | length = -1 )

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 glibmm 2.30

Parameters

  value | The new password value.
  length | The length of the password, or -1.

## ◆ set_warning()

void Gio::TlsPassword::set_warning | ( | const Glib::ustring & | 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 glibmm 2.30

Parameters

  warning | The user readable warning.

## Friends And Related Symbol Documentation

## ◆ wrap()

Glib::RefPtr< Gio::TlsPassword > wrap | ( | GTlsPassword * | object,
|  | bool | take_copy = false )
| related

A Glib::wrap() method for this object.

Parameters

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns
  A C++ instance that wraps this C instance.