<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>glibmm: Gio::Credentials Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.2 --> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> </ul> </div> <div class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"> <ul> <li><a class="el" href="namespaceGio.html">Gio</a> </li> <li><a class="el" href="classGio_1_1Credentials.html">Credentials</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pub-static-methods">Static Public Member Functions</a> | <a href="#pro-methods">Protected Member Functions</a> | <a href="#related">Related Functions</a> </div> <div class="headertitle"> <h1>Gio::Credentials Class Reference</h1> </div> </div> <div class="contents"> <!-- doxytag: class="Gio::Credentials" --><!-- doxytag: inherits="Glib::Object" --> <p>An object containing credentials. <a href="#_details">More...</a></p> <p><code>#include <giomm/credentials.h></code></p> <!-- startSectionHeader --><div class="dynheader"> Inheritance diagram for Gio::Credentials:<!-- endSectionHeader --></div> <!-- startSectionSummary --><!-- endSectionSummary --><!-- startSectionContent --><div class="dyncontent"> <div class="center"><img src="classGio_1_1Credentials__inherit__graph.png" border="0" usemap="#Gio_1_1Credentials_inherit__map" alt="Inheritance graph"/></div> <map name="Gio_1_1Credentials_inherit__map" id="Gio_1_1Credentials_inherit__map"> <area shape="rect" id="node2" href="classGlib_1_1Object.html" title="Glib::Object" alt="" coords="21,160,115,189"/><area shape="rect" id="node4" href="classGlib_1_1ObjectBase.html" title="Glib::ObjectBase is a common base class for Objects and Interfaces." alt="" coords="5,83,131,112"/><area shape="rect" id="node6" href="../../../libsigc++-2.0/reference/html/structsigc_1_1trackable.html" title="sigc::trackable" alt="" coords="11,5,125,35"/></map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center><!-- endSectionContent --></div> <p><a href="classGio_1_1Credentials-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Credentials.html#a50da8ce90cb83b14f364b4ae30502458">~Credentials</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">GCredentials* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Credentials.html#a046b2268030f002af002310500000873">gobj</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Provides access to the underlying C GObject. <a href="#a046b2268030f002af002310500000873"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const GCredentials* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Credentials.html#ad27e3960d0694de6eb2cedc00dbcaa25">gobj</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Provides access to the underlying C GObject. <a href="#ad27e3960d0694de6eb2cedc00dbcaa25"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">GCredentials* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Credentials.html#ae88176bf9139ac2f8ec61fc2b243eddd">gobj_copy</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. <a href="#ae88176bf9139ac2f8ec61fc2b243eddd"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classGlib_1_1ustring.html">Glib::ustring</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Credentials.html#ae4852e93b213096b678584e5d90e0f0e">to_string</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a human-readable textual representation of <em>credentials</em> that can be used in logging and debug messages. <a href="#ae4852e93b213096b678584e5d90e0f0e"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">gpointer </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Credentials.html#a71bcd9f09372b9baeaebe515dfd98bf7">get_native</a> (<a class="el" href="group__giommEnums.html#gae498b021f21459dc83201f010ddf8dde">CredentialsType</a> native_type)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Gets a pointer to native credentials of type <em>native_type</em> from <em>credentials</em>. <a href="#a71bcd9f09372b9baeaebe515dfd98bf7"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Credentials.html#af513a0e52915235faf163d5de363a0bd">set_native</a> (<a class="el" href="group__giommEnums.html#gae498b021f21459dc83201f010ddf8dde">CredentialsType</a> native_type, gpointer native)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Copies the native credentials of type <em>native_type</em> from <em>native</em> into <em>credentials</em>. <a href="#af513a0e52915235faf163d5de363a0bd"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Credentials.html#a762d208e479db720c4e5124ed329131a">is_same_user</a> (const <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< const <a class="el" href="classGio_1_1Credentials.html">Credentials</a> >& other_credentials)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Checks if <em>credentials</em> and <em>other_credentials</em> is the same user. <a href="#a762d208e479db720c4e5124ed329131a"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="pub-static-methods"></a> Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGio_1_1Credentials.html">Credentials</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Credentials.html#ad1d94115b234e0db180e48509fa18fd8">create</a> ()</td></tr> <tr><td colspan="2"><h2><a name="pro-methods"></a> Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Credentials.html#a1aef06c5a74793011858b45cfd8d7898">Credentials</a> ()</td></tr> <tr><td colspan="2"><h2><a name="related"></a> Related Functions</h2></td></tr> <tr><td colspan="2"><p>(Note that these are not member functions.) </p> <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGio_1_1Credentials.html">Gio::Credentials</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Credentials.html#af140151edb8dd5ccf10f9decf594b731">wrap</a> (GCredentials* object, bool take_copy=false)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A <a class="el" href="namespaceGlib.html#a671306f4a3a0cae5ab4d7a9d54886592">Glib::wrap()</a> method for this object. <a href="#af140151edb8dd5ccf10f9decf594b731"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>An object containing credentials. </p> <p>The <a class="el" href="classGio_1_1Credentials.html" title="An object containing credentials.">Credentials</a> type is a reference-counted wrapper for native credentials. This information is typically used for identifying, authenticating and authorizing other processes.</p> <p>Some operating systems supports looking up the credentials of the remote peer of a communication endpoint - see e.g. <a class="el" href="classGio_1_1Socket.html#a2fcda0eba8fcb30bd020624ce3f14d8f" title="Returns the credentials of the foreign process connected to this socket, if any (e.g. it is only supported for SOCKET_FAMILY_UNIX sockets).">Gio::Socket::get_credentials()</a>.</p> <p>Some operating systems supports securely sending and receiving credentials over a Unix Domain <a class="el" href="classGio_1_1Socket.html" title="Low-level socket object.">Socket</a>, see <a class="el" href="classGio_1_1UnixCredentialsMessage.html" title="UnixCredentialsMessage - A SocketControlMessage containing credentials.">UnixCredentialsMessage</a>, <a class="el" href="classGio_1_1UnixConnection.html#abe2f3b0f09c25340816677fe34653c51" title="Passes the credentials of the current user the receiving side of the connection.">Gio::UnixConnection::send_credentials()</a> and <a class="el" href="classGio_1_1UnixConnection.html#ad50ee58c1df7c351358e003c70e17d56" title="Receives credentials from the sending end of the connection.">Gio::UnixConnection::receive_credentials()</a> for details.</p> <p>On Linux, the native credential type is a struct ucred - see the unix(7) man page for details. This corresponds to Gio::CREDENTIALS_TYPE_LINUX_UCRED.</p> <p>On FreeBSD, the native credential type is a struct cmsgcred. This corresponds to Gio::CREDENTIALS_TYPE_FREEBSD_CMSGCRED.</p> <dl class="since_2_28"><dt><b><a class="el" href="since_2_28.html#_since_2_28000061">Since glibmm 2.28:</a></b></dt><dd></dd></dl> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a50da8ce90cb83b14f364b4ae30502458"></a><!-- doxytag: member="Gio::Credentials::~Credentials" ref="a50da8ce90cb83b14f364b4ae30502458" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual Gio::Credentials::~Credentials </td> <td>(</td> <td class="paramname"> )</td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <a class="anchor" id="a1aef06c5a74793011858b45cfd8d7898"></a><!-- doxytag: member="Gio::Credentials::Credentials" ref="a1aef06c5a74793011858b45cfd8d7898" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Gio::Credentials::Credentials </td> <td>(</td> <td class="paramname"> )</td> <td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="ad1d94115b234e0db180e48509fa18fd8"></a><!-- doxytag: member="Gio::Credentials::create" ref="ad1d94115b234e0db180e48509fa18fd8" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><<a class="el" href="classGio_1_1Credentials.html">Credentials</a>> Gio::Credentials::create </td> <td>(</td> <td class="paramname"> )</td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <a class="anchor" id="a71bcd9f09372b9baeaebe515dfd98bf7"></a><!-- doxytag: member="Gio::Credentials::get_native" ref="a71bcd9f09372b9baeaebe515dfd98bf7" args="(CredentialsType native_type)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">gpointer Gio::Credentials::get_native </td> <td>(</td> <td class="paramtype"><a class="el" href="group__giommEnums.html#gae498b021f21459dc83201f010ddf8dde">CredentialsType</a> </td> <td class="paramname"> <em>native_type</em> )</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Gets a pointer to native credentials of type <em>native_type</em> from <em>credentials</em>. </p> <p>It is a programming error (which will cause an warning to be logged) to use this method if there is no <a class="el" href="classGio_1_1Credentials.html" title="An object containing credentials.">Credentials</a> support for the OS or if <em>native_type</em> isn't supported by the OS.</p> <dl class="since_2_26"><dt><b><a class="el" href="since_2_26.html#_since_2_26000018">Since glibmm 2.26:</a></b></dt><dd></dd></dl> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">native_type</td><td>The type of native credentials to get. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>The pointer to native credentials or <code>0</code> if the operation there is no <a class="el" href="classGio_1_1Credentials.html" title="An object containing credentials.">Credentials</a> support for the OS or if <em>native_type</em> isn't supported by the OS. Do not free the returned data, it is owned by <em>credentials</em>. </dd></dl> </div> </div> <a class="anchor" id="a046b2268030f002af002310500000873"></a><!-- doxytag: member="Gio::Credentials::gobj" ref="a046b2268030f002af002310500000873" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">GCredentials* Gio::Credentials::gobj </td> <td>(</td> <td class="paramname"> )</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Provides access to the underlying C GObject. </p> <p>Reimplemented from <a class="el" href="classGlib_1_1ObjectBase.html#a4c6efc18be8cb9c56e58fc0bd20fafbe">Glib::ObjectBase</a>.</p> </div> </div> <a class="anchor" id="ad27e3960d0694de6eb2cedc00dbcaa25"></a><!-- doxytag: member="Gio::Credentials::gobj" ref="ad27e3960d0694de6eb2cedc00dbcaa25" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const GCredentials* Gio::Credentials::gobj </td> <td>(</td> <td class="paramname"> )</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Provides access to the underlying C GObject. </p> <p>Reimplemented from <a class="el" href="classGlib_1_1ObjectBase.html#a778a94181132976bbfb0519793f3b32e">Glib::ObjectBase</a>.</p> </div> </div> <a class="anchor" id="ae88176bf9139ac2f8ec61fc2b243eddd"></a><!-- doxytag: member="Gio::Credentials::gobj_copy" ref="ae88176bf9139ac2f8ec61fc2b243eddd" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">GCredentials* Gio::Credentials::gobj_copy </td> <td>(</td> <td class="paramname"> )</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. </p> </div> </div> <a class="anchor" id="a762d208e479db720c4e5124ed329131a"></a><!-- doxytag: member="Gio::Credentials::is_same_user" ref="a762d208e479db720c4e5124ed329131a" args="(const Glib::RefPtr< const Credentials > &other_credentials)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Gio::Credentials::is_same_user </td> <td>(</td> <td class="paramtype">const <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< const <a class="el" href="classGio_1_1Credentials.html">Credentials</a> >& </td> <td class="paramname"> <em>other_credentials</em> )</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Checks if <em>credentials</em> and <em>other_credentials</em> is the same user. </p> <p>This operation can fail if <a class="el" href="classGio_1_1Credentials.html" title="An object containing credentials.">Credentials</a> is not supported on the the OS.</p> <dl class="since_2_26"><dt><b><a class="el" href="since_2_26.html#_since_2_26000020">Since glibmm 2.26:</a></b></dt><dd></dd></dl> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">other_credentials</td><td>A <a class="el" href="classGio_1_1Credentials.html" title="An object containing credentials.">Credentials</a>. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> if <em>credentials</em> and <em>other_credentials</em> has the same user, <code>false</code> otherwise or if <em>error</em> is set. </dd></dl> </div> </div> <a class="anchor" id="af513a0e52915235faf163d5de363a0bd"></a><!-- doxytag: member="Gio::Credentials::set_native" ref="af513a0e52915235faf163d5de363a0bd" args="(CredentialsType native_type, gpointer native)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Gio::Credentials::set_native </td> <td>(</td> <td class="paramtype"><a class="el" href="group__giommEnums.html#gae498b021f21459dc83201f010ddf8dde">CredentialsType</a> </td> <td class="paramname"> <em>native_type</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">gpointer </td> <td class="paramname"> <em>native</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Copies the native credentials of type <em>native_type</em> from <em>native</em> into <em>credentials</em>. </p> <p>It is a programming error (which will cause an warning to be logged) to use this method if there is no <a class="el" href="classGio_1_1Credentials.html" title="An object containing credentials.">Credentials</a> support for the OS or if <em>native_type</em> isn't supported by the OS.</p> <dl class="since_2_26"><dt><b><a class="el" href="since_2_26.html#_since_2_26000019">Since glibmm 2.26:</a></b></dt><dd></dd></dl> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">native_type</td><td>The type of native credentials to set. </td></tr> <tr><td class="paramname">native</td><td>A pointer to native credentials. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="ae4852e93b213096b678584e5d90e0f0e"></a><!-- doxytag: member="Gio::Credentials::to_string" ref="ae4852e93b213096b678584e5d90e0f0e" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classGlib_1_1ustring.html">Glib::ustring</a> Gio::Credentials::to_string </td> <td>(</td> <td class="paramname"> )</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Creates a human-readable textual representation of <em>credentials</em> that can be used in logging and debug messages. </p> <p>The format of the returned string may change in future GLib release.</p> <dl class="since_2_26"><dt><b><a class="el" href="since_2_26.html#_since_2_26000017">Since glibmm 2.26:</a></b></dt><dd></dd></dl> <dl class="return"><dt><b>Returns:</b></dt><dd>A string that should be freed with Glib::free(). </dd></dl> </div> </div> <hr/><h2>Friends And Related Function Documentation</h2> <a class="anchor" id="af140151edb8dd5ccf10f9decf594b731"></a><!-- doxytag: member="Gio::Credentials::wrap" ref="af140151edb8dd5ccf10f9decf594b731" args="(GCredentials *object, bool take_copy=false)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGio_1_1Credentials.html">Gio::Credentials</a> > wrap </td> <td>(</td> <td class="paramtype">GCredentials * </td> <td class="paramname"> <em>object</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"> <em>take_copy</em> = <code>false</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [related]</code></td> </tr> </table> </div> <div class="memdoc"> <p>A <a class="el" href="namespaceGlib.html#a671306f4a3a0cae5ab4d7a9d54886592">Glib::wrap()</a> method for this object. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">object</td><td>The C instance. </td></tr> <tr><td class="paramname">take_copy</td><td>False if the result should take ownership of the C instance. True if it should take a new copy or ref. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>A C++ instance that wraps this C instance. </dd></dl> </div> </div> </div> <hr class="footer"/><address class="footer"><small>Generated on Tue Apr 5 2011 16:07:12 for glibmm by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address> </body> </html>