Object Hierarchy:

Object hierarchy for Credentials


[ CCode ( type_id = "g_credentials_get_type ()" ) ]
[ Version ( since = "2.26" ) ]
public class Credentials : Object

The Credentials type is a reference-counted wrapper for native credentials.

This information is typically used for identifying, authenticating and authorizing other processes.

Some operating systems supports looking up the credentials of the remote peer of a communication endpoint - see e.g. get_credentials.

Some operating systems supports securely sending and receiving credentials over a Unix Domain Socket, see GUnixCredentialsMessage, g_unix_connection_send_credentials and g_unix_connection_receive_credentials for details.

On Linux, the native credential type is a `struct ucred` - see the unix(7) man page for details. This corresponds to g_credentials_type_linux_ucred.

On Apple operating systems (including iOS, tvOS, and macOS), the native credential type is a `struct xucred`. This corresponds to g_credentials_type_apple_xucred.

On FreeBSD, Debian GNU/kFreeBSD, and GNU/Hurd, the native credential type is a `struct cmsgcred`. This corresponds to g_credentials_type_freebsd_cmsgcred.

On NetBSD, the native credential type is a `struct unpcbid`. This corresponds to g_credentials_type_netbsd_unpcbid .

On OpenBSD, the native credential type is a `struct sockpeercred`. This corresponds to g_credentials_type_openbsd_sockpeercred.

On Solaris (including OpenSolaris and its derivatives), the native credential type is a `ucred_t`. This corresponds to g_credentials_type_solaris_ucred.

Since GLib 2.72, on Windows, the native credentials may contain the PID of a process. This corresponds to g_credentials_type_win32_pid.

Namespace: GLib
Package: gio-2.0


Creation methods:


Inherited Members: