libnm-util Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <nm-setting-8021x.h> enum NMSetting8021xCKFormat; enum NMSetting8021xCKScheme; #define NM_SETTING_802_1X_SETTING_NAME enum NMSetting8021xError; #define NM_TYPE_SETTING_802_1X_ERROR #define NM_SETTING_802_1X_ERROR GQuark nm_setting_802_1x_error_quark (void
); #define NM_SETTING_802_1X_EAP #define NM_SETTING_802_1X_IDENTITY #define NM_SETTING_802_1X_ANONYMOUS_IDENTITY #define NM_SETTING_802_1X_CA_CERT #define NM_SETTING_802_1X_CA_PATH #define NM_SETTING_802_1X_CLIENT_CERT #define NM_SETTING_802_1X_PHASE1_PEAPVER #define NM_SETTING_802_1X_PHASE1_PEAPLABEL #define NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING #define NM_SETTING_802_1X_PHASE2_AUTH #define NM_SETTING_802_1X_PHASE2_AUTHEAP #define NM_SETTING_802_1X_PHASE2_CA_CERT #define NM_SETTING_802_1X_PHASE2_CA_PATH #define NM_SETTING_802_1X_PHASE2_CLIENT_CERT #define NM_SETTING_802_1X_PASSWORD #define NM_SETTING_802_1X_PASSWORD_FLAGS #define NM_SETTING_802_1X_PRIVATE_KEY #define NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD #define NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD_FLAGS #define NM_SETTING_802_1X_PHASE2_PRIVATE_KEY #define NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD #define NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS #define NM_SETTING_802_1X_PIN #define NM_SETTING_802_1X_PIN_FLAGS #define NM_SETTING_802_1X_SYSTEM_CA_CERTS NMSetting8021x; NMSetting8021xClass; GType nm_setting_802_1x_get_type (void
); NMSetting * nm_setting_802_1x_new (void
); guint32 nm_setting_802_1x_get_num_eap_methods (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_eap_method (NMSetting8021x *setting
,guint32 i
); gboolean nm_setting_802_1x_add_eap_method (NMSetting8021x *setting
,const char *eap
); void nm_setting_802_1x_remove_eap_method (NMSetting8021x *setting
,guint32 i
); void nm_setting_802_1x_clear_eap_methods (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_identity (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_anonymous_identity (NMSetting8021x *setting
); gboolean nm_setting_802_1x_get_system_ca_certs (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_ca_path (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_phase2_ca_path (NMSetting8021x *setting
); NMSetting8021xCKScheme nm_setting_802_1x_get_ca_cert_scheme (NMSetting8021x *setting
); const GByteArray * nm_setting_802_1x_get_ca_cert_blob (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_ca_cert_path (NMSetting8021x *setting
); gboolean nm_setting_802_1x_set_ca_cert (NMSetting8021x *setting
,const char *cert_path
,NMSetting8021xCKScheme scheme
,NMSetting8021xCKFormat *out_format
,GError **error
); NMSetting8021xCKScheme nm_setting_802_1x_get_client_cert_scheme (NMSetting8021x *setting
); const GByteArray * nm_setting_802_1x_get_client_cert_blob (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_client_cert_path (NMSetting8021x *setting
); gboolean nm_setting_802_1x_set_client_cert (NMSetting8021x *setting
,const char *cert_path
,NMSetting8021xCKScheme scheme
,NMSetting8021xCKFormat *out_format
,GError **error
); const char * nm_setting_802_1x_get_phase1_peapver (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_phase1_peaplabel (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_phase1_fast_provisioning (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_phase2_auth (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_phase2_autheap (NMSetting8021x *setting
); NMSetting8021xCKScheme nm_setting_802_1x_get_phase2_ca_cert_scheme (NMSetting8021x *setting
); const GByteArray * nm_setting_802_1x_get_phase2_ca_cert_blob (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_phase2_ca_cert_path (NMSetting8021x *setting
); gboolean nm_setting_802_1x_set_phase2_ca_cert (NMSetting8021x *setting
,const char *cert_path
,NMSetting8021xCKScheme scheme
,NMSetting8021xCKFormat *out_format
,GError **error
); NMSetting8021xCKScheme nm_setting_802_1x_get_phase2_client_cert_scheme (NMSetting8021x *setting
); const GByteArray * nm_setting_802_1x_get_phase2_client_cert_blob (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_phase2_client_cert_path (NMSetting8021x *setting
); gboolean nm_setting_802_1x_set_phase2_client_cert (NMSetting8021x *setting
,const char *cert_path
,NMSetting8021xCKScheme scheme
,NMSetting8021xCKFormat *out_format
,GError **error
); const char * nm_setting_802_1x_get_password (NMSetting8021x *setting
); NMSettingSecretFlags nm_setting_802_1x_get_password_flags (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_pin (NMSetting8021x *setting
); NMSettingSecretFlags nm_setting_802_1x_get_pin_flags (NMSetting8021x *setting
); NMSetting8021xCKScheme nm_setting_802_1x_get_private_key_scheme (NMSetting8021x *setting
); const GByteArray * nm_setting_802_1x_get_private_key_blob (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_private_key_path (NMSetting8021x *setting
); gboolean nm_setting_802_1x_set_private_key (NMSetting8021x *setting
,const char *key_path
,const char *password
,NMSetting8021xCKScheme scheme
,NMSetting8021xCKFormat *out_format
,GError **error
); const char * nm_setting_802_1x_get_private_key_password (NMSetting8021x *setting
); NMSettingSecretFlags nm_setting_802_1x_get_private_key_password_flags (NMSetting8021x *setting
); NMSetting8021xCKFormat nm_setting_802_1x_get_private_key_format (NMSetting8021x *setting
); NMSetting8021xCKScheme nm_setting_802_1x_get_phase2_private_key_scheme (NMSetting8021x *setting
); const GByteArray * nm_setting_802_1x_get_phase2_private_key_blob (NMSetting8021x *setting
); const char * nm_setting_802_1x_get_phase2_private_key_path (NMSetting8021x *setting
); gboolean nm_setting_802_1x_set_phase2_private_key (NMSetting8021x *setting
,const char *key_path
,const char *password
,NMSetting8021xCKScheme scheme
,NMSetting8021xCKFormat *out_format
,GError **error
); const char * nm_setting_802_1x_get_phase2_private_key_password (NMSetting8021x *setting
); NMSettingSecretFlags nm_setting_802_1x_get_phase2_private_key_password_flags (NMSetting8021x *setting
); NMSetting8021xCKFormat nm_setting_802_1x_get_phase2_private_key_format (NMSetting8021x *setting
);
"anonymous-identity" gchar* : Read / Write "ca-cert" GArray_guchar_* : Read / Write "ca-path" gchar* : Read / Write "client-cert" GArray_guchar_* : Read / Write "eap" GSList_gchararray_* : Read / Write "identity" gchar* : Read / Write "password" gchar* : Read / Write "password-flags" guint : Read / Write "phase1-fast-provisioning" gchar* : Read / Write "phase1-peaplabel" gchar* : Read / Write "phase1-peapver" gchar* : Read / Write "phase2-auth" gchar* : Read / Write "phase2-autheap" gchar* : Read / Write "phase2-ca-cert" GArray_guchar_* : Read / Write "phase2-ca-path" gchar* : Read / Write "phase2-client-cert" GArray_guchar_* : Read / Write "phase2-private-key" GArray_guchar_* : Read / Write "phase2-private-key-password" gchar* : Read / Write "phase2-private-key-password-flags" guint : Read / Write "private-key" GArray_guchar_* : Read / Write "private-key-password" gchar* : Read / Write "private-key-password-flags" guint : Read / Write "system-ca-certs" gboolean : Read / Write / Construct
The NMSetting8021x object is a NMSetting subclass that describes properties necessary for connection to 802.1x-authenticated networks, such as WPA and WPA2 Enterprise WiFi networks and wired 802.1x networks. 802.1x connections typically use certificates and/or EAP authentication methods to securely verify, identify, and authenticate the client to the network itself, instead of simply relying on a widely shared static key.
It's a good idea to read up on wpa_supplicant configuration before using this setting extensively, since most of the options here correspond closely with the relevant wpa_supplicant configuration options.
Furthermore, to get a good idea of 802.1x, EAP, TLS, TTLS, etc and their applications to WiFi and wired networks, you'll want to get copies of the following books.
802.11 Wireless Networks: The Definitive Guide, Second Edition Author: Matthew Gast ISBN: 978-0596100520
Cisco Wireless LAN Security Authors: Krishna Sankar, Sri Sundaralingam, Darrin Miller, and Andrew Balinsky ISBN: 978-1587051548
typedef enum { NM_SETTING_802_1X_CK_FORMAT_UNKNOWN = 0, NM_SETTING_802_1X_CK_FORMAT_X509, NM_SETTING_802_1X_CK_FORMAT_RAW_KEY, NM_SETTING_802_1X_CK_FORMAT_PKCS12 } NMSetting8021xCKFormat;
NMSetting8021xCKFormat values indicate the general type of a certificate or private key
unknown file format | |
file contains an X.509 format certificate | |
file contains an old-style OpenSSL PEM or DER private key | |
file contains a PKCS12 certificate and private key |
typedef enum { NM_SETTING_802_1X_CK_SCHEME_UNKNOWN = 0, NM_SETTING_802_1X_CK_SCHEME_BLOB, NM_SETTING_802_1X_CK_SCHEME_PATH } NMSetting8021xCKScheme;
NMSetting8021xCKScheme values indicate how a certificate or private key is stored in the setting properties, either as a blob of the item's data, or as a path to a certificate or private key file on the filesystem
typedef enum { NM_SETTING_802_1X_ERROR_UNKNOWN = 0, NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, NM_SETTING_802_1X_ERROR_MISSING_PROPERTY } NMSetting8021xError;
#define NM_TYPE_SETTING_802_1X_ERROR (nm_setting_802_1x_error_get_type ())
GQuark nm_setting_802_1x_error_quark (void
);
Registers an error quark for NMSetting8021x if necessary.
Returns : |
the error quark used for NMSetting8021x errors. |
#define NM_SETTING_802_1X_ANONYMOUS_IDENTITY "anonymous-identity"
#define NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING "phase1-fast-provisioning"
#define NM_SETTING_802_1X_PHASE2_CLIENT_CERT "phase2-client-cert"
#define NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD "private-key-password"
#define NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD_FLAGS "private-key-password-flags"
#define NM_SETTING_802_1X_PHASE2_PRIVATE_KEY "phase2-private-key"
#define NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD "phase2-private-key-password"
#define NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS "phase2-private-key-password-flags"
typedef struct { NMSettingClass parent; /* Padding for future expansion */ void (*_reserved1) (void); void (*_reserved2) (void); void (*_reserved3) (void); void (*_reserved4) (void); } NMSetting8021xClass;
NMSetting * nm_setting_802_1x_new (void
);
Creates a new NMSetting8021x object with default values.
Returns : |
the new empty NMSetting8021x object |
guint32 nm_setting_802_1x_get_num_eap_methods
(NMSetting8021x *setting
);
Returns the number of eap methods allowed for use when connecting to the
network. Generally only one EAP method is used. Use the functions
nm_setting_802_1x_get_eap_method()
, nm_setting_802_1x_add_eap_method()
,
and nm_setting_802_1x_remove_eap_method()
for adding, removing, and retrieving
allowed EAP methods.
|
the NMSetting8021x |
Returns : |
the number of allowed EAP methods |
const char * nm_setting_802_1x_get_eap_method (NMSetting8021x *setting
,guint32 i
);
Returns the name of the allowed EAP method at index i
.
|
the NMSetting8021x |
|
the index of the EAP method name to return |
Returns : |
the name of the allowed EAP method at index i
|
gboolean nm_setting_802_1x_add_eap_method (NMSetting8021x *setting
,const char *eap
);
Adds an allowed EAP method. The setting is not valid until at least one EAP method has been added. See "eap" property for a list of allowed EAP methods.
|
the NMSetting8021x |
|
the name of the EAP method to allow for this connection |
Returns : |
TRUE if the EAP method was successfully added, FALSE if it was not a valid method or if it was already allowed. |
void nm_setting_802_1x_remove_eap_method (NMSetting8021x *setting
,guint32 i
);
Removes the allowed EAP method at the specified index.
|
the NMSetting8021x |
|
the index of the EAP method to remove |
void nm_setting_802_1x_clear_eap_methods (NMSetting8021x *setting
);
Clears all allowed EAP methods.
|
the NMSetting8021x |
const char * nm_setting_802_1x_get_identity (NMSetting8021x *setting
);
Returns the identifier used by some EAP methods (like TLS) to authenticate the user. Often this is a username or login name.
|
the NMSetting8021x |
Returns : |
the user identifier |
const char * nm_setting_802_1x_get_anonymous_identity
(NMSetting8021x *setting
);
Returns the anonymous identifier used by some EAP methods (like TTLS) to authenticate the user in the outer unencrypted "phase 1" authentication. The inner "phase 2" authentication will use the "identity" in a secure form, if applicable for that EAP method.
|
the NMSetting8021x |
Returns : |
the anonymous identifier |
gboolean nm_setting_802_1x_get_system_ca_certs
(NMSetting8021x *setting
);
Sets the "system-ca-certs" property. The "ca-path" and "phase2-ca-path" properties are ignored if the "system-ca-certs" property is TRUE, in which case a system-wide CA certificate directory specified at compile time (using the --system-ca-path configure option) is used in place of these properties.
|
the NMSetting8021x |
Returns : |
TRUE if a system CA certificate path should be used, FALSE if not |
const char * nm_setting_802_1x_get_ca_path (NMSetting8021x *setting
);
Returns the path of the CA certificate directory if previously set. Systems will often have a directory that contains multiple individual CA certificates which the supplicant can then add to the verification chain. This may be used in addition to the "ca-cert" property to add more CA certificates for verifying the network to client.
|
the NMSetting8021x |
Returns : |
the CA certificate directory path |
const char * nm_setting_802_1x_get_phase2_ca_path
(NMSetting8021x *setting
);
Returns the path of the "phase 2" CA certificate directory if previously set. Systems will often have a directory that contains multiple individual CA certificates which the supplicant can then add to the verification chain. This may be used in addition to the "phase2-ca-cert" property to add more CA certificates for verifying the network to client.
|
the NMSetting8021x |
Returns : |
the "phase 2" CA certificate directory path |
NMSetting8021xCKScheme nm_setting_802_1x_get_ca_cert_scheme
(NMSetting8021x *setting
);
Returns the scheme used to store the CA certificate. If the returned scheme
is NM_SETTING_802_1X_CK_SCHEME_BLOB
, use nm_setting_802_1x_get_ca_cert_blob()
;
if NM_SETTING_802_1X_CK_SCHEME_PATH
, use nm_setting_802_1x_get_ca_cert_path()
.
|
the NMSetting8021x |
Returns : |
scheme used to store the CA certificate (blob or path) |
const GByteArray * nm_setting_802_1x_get_ca_cert_blob
(NMSetting8021x *setting
);
Returns the CA certificate blob if the CA certificate is stored using the
NM_SETTING_802_1X_CK_SCHEME_BLOB
scheme. Not all EAP methods use a
CA certificate (LEAP for example), and those that can take advantage of the
CA certificate allow it to be unset. Note that lack of a CA certificate
reduces security by allowing man-in-the-middle attacks, because the identity
of the network cannot be confirmed by the client.
|
the NMSetting8021x |
Returns : |
the CA certificate data |
const char * nm_setting_802_1x_get_ca_cert_path
(NMSetting8021x *setting
);
Returns the CA certificate path if the CA certificate is stored using the
NM_SETTING_802_1X_CK_SCHEME_PATH
scheme. Not all EAP methods use a
CA certificate (LEAP for example), and those that can take advantage of the
CA certificate allow it to be unset. Note that lack of a CA certificate
reduces security by allowing man-in-the-middle attacks, because the identity
of the network cannot be confirmed by the client.
|
the NMSetting8021x |
Returns : |
path to the CA certificate file |
gboolean nm_setting_802_1x_set_ca_cert (NMSetting8021x *setting
,const char *cert_path
,NMSetting8021xCKScheme scheme
,NMSetting8021xCKFormat *out_format
,GError **error
);
Reads a certificate from disk and sets the "ca-cert" property
with the raw certificate data if using the NM_SETTING_802_1X_CK_SCHEME_BLOB
scheme, or with the path to the certificate file if using the
NM_SETTING_802_1X_CK_SCHEME_PATH
scheme.
|
the NMSetting8021x |
|
when scheme is set to either NM_SETTING_802_1X_CK_SCHEME_PATH
or NM_SETTING_802_1X_CK_SCHEME_BLOB , pass the path of the CA certificate
file (PEM or DER format). The path must be UTF-8 encoded; use
g_filename_to_utf8() to convert if needed. Passing NULL with any scheme
clears the CA certificate. |
|
desired storage scheme for the certificate |
|
on successful return, the type of the certificate added |
|
on unsuccessful return, an error |
Returns : |
TRUE if the operation succeeded, FALSE if it was unsuccessful |
NMSetting8021xCKScheme nm_setting_802_1x_get_client_cert_scheme
(NMSetting8021x *setting
);
Returns the scheme used to store the client certificate. If the returned scheme
is NM_SETTING_802_1X_CK_SCHEME_BLOB
, use nm_setting_802_1x_get_client_cert_blob()
;
if NM_SETTING_802_1X_CK_SCHEME_PATH
, use nm_setting_802_1x_get_client_cert_path()
.
|
the NMSetting8021x |
Returns : |
scheme used to store the client certificate (blob or path) |
const GByteArray * nm_setting_802_1x_get_client_cert_blob
(NMSetting8021x *setting
);
Client certificates are used to identify the connecting client to the network when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.
|
the NMSetting8021x |
Returns : |
the client certificate data |
const char * nm_setting_802_1x_get_client_cert_path
(NMSetting8021x *setting
);
Client certificates are used to identify the connecting client to the network when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.
|
the NMSetting8021x |
Returns : |
path to the client certificate file |
gboolean nm_setting_802_1x_set_client_cert (NMSetting8021x *setting
,const char *cert_path
,NMSetting8021xCKScheme scheme
,NMSetting8021xCKFormat *out_format
,GError **error
);
Reads a certificate from disk and sets the "client-cert"
property with the raw certificate data if using the
NM_SETTING_802_1X_CK_SCHEME_BLOB
scheme, or with the path to the certificate
file if using the NM_SETTING_802_1X_CK_SCHEME_PATH
scheme.
Client certificates are used to identify the connecting client to the network when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.
|
the NMSetting8021x |
|
when scheme is set to either NM_SETTING_802_1X_CK_SCHEME_PATH
or NM_SETTING_802_1X_CK_SCHEME_BLOB , pass the path of the client
certificate file (PEM, DER, or PKCS12 format). The path must be UTF-8
encoded; use g_filename_to_utf8() to convert if needed. Passing NULL with
any scheme clears the client certificate. |
|
desired storage scheme for the certificate |
|
on successful return, the type of the certificate added |
|
on unsuccessful return, an error |
Returns : |
TRUE if the operation succeeded, FALSE if it was unsuccessful |
const char * nm_setting_802_1x_get_phase1_peapver
(NMSetting8021x *setting
);
|
the NMSetting8021x |
Returns : |
the "phase 1" PEAP version to be used when authenticating with EAP-PEAP as contained in the "phase1-peapver" property. Valid values are NULL (unset), "0" (PEAP version 0), and "1" (PEAP version 1). |
const char * nm_setting_802_1x_get_phase1_peaplabel
(NMSetting8021x *setting
);
|
the NMSetting8021x |
Returns : |
whether the "phase 1" PEAP label is new-style or old-style, to be used when authenticating with EAP-PEAP, as contained in the "phase1-peaplabel" property. Valid values are NULL (unset), "0" (use old-style label), and "1" (use new-style label). See the wpa_supplicant documentation for more details. |
const char * nm_setting_802_1x_get_phase1_fast_provisioning
(NMSetting8021x *setting
);
|
the NMSetting8021x |
Returns : |
whether "phase 1" PEAP fast provisioning should be used, as specified by the "phase1-fast-provisioning" property. See the wpa_supplicant documentation for more details. |
const char * nm_setting_802_1x_get_phase2_auth (NMSetting8021x *setting
);
|
the NMSetting8021x |
Returns : |
the "phase 2" non-EAP (ex MD5) allowed authentication method as specified by the "phase2-auth" property. |
const char * nm_setting_802_1x_get_phase2_autheap
(NMSetting8021x *setting
);
|
the NMSetting8021x |
Returns : |
the "phase 2" EAP-based (ex TLS) allowed authentication method as specified by the "phase2-autheap" property. |
NMSetting8021xCKScheme nm_setting_802_1x_get_phase2_ca_cert_scheme
(NMSetting8021x *setting
);
Returns the scheme used to store the "phase 2" CA certificate. If the
returned scheme is NM_SETTING_802_1X_CK_SCHEME_BLOB
, use
nm_setting_802_1x_get_ca_cert_blob()
; if NM_SETTING_802_1X_CK_SCHEME_PATH
,
use nm_setting_802_1x_get_ca_cert_path()
.
|
the NMSetting8021x |
Returns : |
scheme used to store the "phase 2" CA certificate (blob or path) |
const GByteArray * nm_setting_802_1x_get_phase2_ca_cert_blob
(NMSetting8021x *setting
);
Returns the "phase 2" CA certificate blob if the CA certificate is stored
using the NM_SETTING_802_1X_CK_SCHEME_BLOB
scheme. Not all EAP methods use
a CA certificate (LEAP for example), and those that can take advantage of the
CA certificate allow it to be unset. Note that lack of a CA certificate
reduces security by allowing man-in-the-middle attacks, because the identity
of the network cannot be confirmed by the client.
|
the NMSetting8021x |
Returns : |
the "phase 2" CA certificate data |
const char * nm_setting_802_1x_get_phase2_ca_cert_path
(NMSetting8021x *setting
);
Returns the "phase 2" CA certificate path if the CA certificate is stored
using the NM_SETTING_802_1X_CK_SCHEME_PATH
scheme. Not all EAP methods use
a CA certificate (LEAP for example), and those that can take advantage of the
CA certificate allow it to be unset. Note that lack of a CA certificate
reduces security by allowing man-in-the-middle attacks, because the identity
of the network cannot be confirmed by the client.
|
the NMSetting8021x |
Returns : |
path to the "phase 2" CA certificate file |
gboolean nm_setting_802_1x_set_phase2_ca_cert (NMSetting8021x *setting
,const char *cert_path
,NMSetting8021xCKScheme scheme
,NMSetting8021xCKFormat *out_format
,GError **error
);
Reads a certificate from disk and sets the "phase2-ca-cert"
property with the raw certificate data if using the
NM_SETTING_802_1X_CK_SCHEME_BLOB
scheme, or with the path to the certificate
file if using the NM_SETTING_802_1X_CK_SCHEME_PATH
scheme.
|
the NMSetting8021x |
|
when scheme is set to either NM_SETTING_802_1X_CK_SCHEME_PATH
or NM_SETTING_802_1X_CK_SCHEME_BLOB , pass the path of the "phase2" CA
certificate file (PEM or DER format). The path must be UTF-8 encoded; use
g_filename_to_utf8() to convert if needed. Passing NULL with any scheme
clears the "phase2" CA certificate. |
|
desired storage scheme for the certificate |
|
on successful return, the type of the certificate added |
|
on unsuccessful return, an error |
Returns : |
TRUE if the operation succeeded, FALSE if it was unsuccessful |
NMSetting8021xCKScheme nm_setting_802_1x_get_phase2_client_cert_scheme
(NMSetting8021x *setting
);
Returns the scheme used to store the "phase 2" client certificate. If the
returned scheme is NM_SETTING_802_1X_CK_SCHEME_BLOB
, use
nm_setting_802_1x_get_client_cert_blob()
; if
NM_SETTING_802_1X_CK_SCHEME_PATH
, use
nm_setting_802_1x_get_client_cert_path()
.
|
the NMSetting8021x |
Returns : |
scheme used to store the "phase 2" client certificate (blob or path) |
const GByteArray * nm_setting_802_1x_get_phase2_client_cert_blob
(NMSetting8021x *setting
);
Client certificates are used to identify the connecting client to the network when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.
|
the NMSetting8021x |
Returns : |
the "phase 2" client certificate data |
const char * nm_setting_802_1x_get_phase2_client_cert_path
(NMSetting8021x *setting
);
Client certificates are used to identify the connecting client to the network when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.
|
the NMSetting8021x |
Returns : |
path to the "phase 2" client certificate file |
gboolean nm_setting_802_1x_set_phase2_client_cert (NMSetting8021x *setting
,const char *cert_path
,NMSetting8021xCKScheme scheme
,NMSetting8021xCKFormat *out_format
,GError **error
);
Reads a certificate from disk and sets the "phase2-client-cert"
property with the raw certificate data if using the
NM_SETTING_802_1X_CK_SCHEME_BLOB
scheme, or with the path to the certificate
file if using the NM_SETTING_802_1X_CK_SCHEME_PATH
scheme.
Client certificates are used to identify the connecting client to the network when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.
|
the NMSetting8021x |
|
when scheme is set to either NM_SETTING_802_1X_CK_SCHEME_PATH
or NM_SETTING_802_1X_CK_SCHEME_BLOB , pass the path of the "phase2" client
certificate file (PEM, DER, or PKCS12 format). The path must be UTF-8
encoded; use g_filename_to_utf8() to convert if needed. Passing NULL with
any scheme clears the "phase2" client certificate. |
|
desired storage scheme for the certificate |
|
on successful return, the type of the certificate added |
|
on unsuccessful return, an error |
Returns : |
TRUE if the operation succeeded, FALSE if it was unsuccessful |
const char * nm_setting_802_1x_get_password (NMSetting8021x *setting
);
|
the NMSetting8021x |
Returns : |
the password used by the authentication method, if any, as specified by the "password" property |
NMSettingSecretFlags nm_setting_802_1x_get_password_flags
(NMSetting8021x *setting
);
|
the NMSetting8021x |
Returns : |
the NMSettingSecretFlags pertaining to the "password" |
const char * nm_setting_802_1x_get_pin (NMSetting8021x *setting
);
|
the NMSetting8021x |
Returns : |
the PIN used by the authentication method, if any, as specified by the "pin" property |
NMSettingSecretFlags nm_setting_802_1x_get_pin_flags (NMSetting8021x *setting
);
|
the NMSetting8021x |
Returns : |
the NMSettingSecretFlags pertaining to the "pin" |
NMSetting8021xCKScheme nm_setting_802_1x_get_private_key_scheme
(NMSetting8021x *setting
);
Returns the scheme used to store the private key. If the returned scheme is
NM_SETTING_802_1X_CK_SCHEME_BLOB
, use
nm_setting_802_1x_get_client_cert_blob()
; if
NM_SETTING_802_1X_CK_SCHEME_PATH
, use
nm_setting_802_1x_get_client_cert_path()
.
|
the NMSetting8021x |
Returns : |
scheme used to store the private key (blob or path) |
const GByteArray * nm_setting_802_1x_get_private_key_blob
(NMSetting8021x *setting
);
Private keys are used to authenticate the connecting client to the network when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.
WARNING: the private key property is not a "secret" property, and thus unencrypted private key data may be readable by unprivileged users. Private keys should always be encrypted with a private key password.
|
the NMSetting8021x |
Returns : |
the private key data |
const char * nm_setting_802_1x_get_private_key_path
(NMSetting8021x *setting
);
Private keys are used to authenticate the connecting client to the network when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.
|
the NMSetting8021x |
Returns : |
path to the private key file |
gboolean nm_setting_802_1x_set_private_key (NMSetting8021x *setting
,const char *key_path
,const char *password
,NMSetting8021xCKScheme scheme
,NMSetting8021xCKFormat *out_format
,GError **error
);
Private keys are used to authenticate the connecting client to the network when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.
This function reads a private key from disk and sets the
"private-key" property with the private key file data if using
the NM_SETTING_802_1X_CK_SCHEME_BLOB
scheme, or with the path to the private
key file if using the NM_SETTING_802_1X_CK_SCHEME_PATH
scheme.
If password
is given, this function attempts to decrypt the private key to
verify that password
is correct, and if it is, updates the
"private-key-password" property with the given password
. If
the decryption is unsuccessful, FALSE
is returned, error
is set, and no
internal data is changed. If no password
is given, the private key is
assumed to be valid, no decryption is performed, and the password may be set
at a later time.
WARNING: the private key property is not a "secret" property, and thus unencrypted private key data using the BLOB scheme may be readable by unprivileged users. Private keys should always be encrypted with a private key password to prevent unauthorized access to unencrypted private key data.
|
the NMSetting8021x |
|
when scheme is set to either NM_SETTING_802_1X_CK_SCHEME_PATH or
NM_SETTING_802_1X_CK_SCHEME_BLOB , pass the path of the private key file
(PEM, DER, or PKCS12 format). The path must be UTF-8 encoded; use
g_filename_to_utf8() to convert if needed. Passing NULL with any scheme
clears the private key. |
|
password used to decrypt the private key, or NULL if the password
is unknown. If the password is given but fails to decrypt the private key,
an error is returned. |
|
desired storage scheme for the private key |
|
on successful return, the type of the private key added |
|
on unsuccessful return, an error |
Returns : |
TRUE if the operation succeeded, FALSE if it was unsuccessful |
const char * nm_setting_802_1x_get_private_key_password
(NMSetting8021x *setting
);
|
the NMSetting8021x |
Returns : |
the private key password used to decrypt the private key if
previously set with nm_setting_802_1x_set_private_key_from_file() ,
nm_setting_802_1x_set_private_key_path() , or the
"private-key-password" property. |
NMSettingSecretFlags nm_setting_802_1x_get_private_key_password_flags
(NMSetting8021x *setting
);
|
the NMSetting8021x |
Returns : |
the NMSettingSecretFlags pertaining to the "private-key-password" |
NMSetting8021xCKFormat nm_setting_802_1x_get_private_key_format
(NMSetting8021x *setting
);
|
the NMSetting8021x |
Returns : |
the data format of the private key data stored in the "private-key" property |
NMSetting8021xCKScheme nm_setting_802_1x_get_phase2_private_key_scheme
(NMSetting8021x *setting
);
Returns the scheme used to store the "phase 2" private key. If the returned
scheme is NM_SETTING_802_1X_CK_SCHEME_BLOB
, use
nm_setting_802_1x_get_client_cert_blob()
; if
NM_SETTING_802_1X_CK_SCHEME_PATH
, use
nm_setting_802_1x_get_client_cert_path()
.
|
the NMSetting8021x |
Returns : |
scheme used to store the "phase 2" private key (blob or path) |
const GByteArray * nm_setting_802_1x_get_phase2_private_key_blob
(NMSetting8021x *setting
);
Private keys are used to authenticate the connecting client to the network when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.
WARNING: the phase2 private key property is not a "secret" property, and thus unencrypted private key data may be readable by unprivileged users. Private keys should always be encrypted with a private key password.
|
the NMSetting8021x |
Returns : |
the "phase 2" private key data |
const char * nm_setting_802_1x_get_phase2_private_key_path
(NMSetting8021x *setting
);
Private keys are used to authenticate the connecting client to the network when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.
|
the NMSetting8021x |
Returns : |
path to the "phase 2" private key file |
gboolean nm_setting_802_1x_set_phase2_private_key (NMSetting8021x *setting
,const char *key_path
,const char *password
,NMSetting8021xCKScheme scheme
,NMSetting8021xCKFormat *out_format
,GError **error
);
Private keys are used to authenticate the connecting client to the network when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.
This function reads a private key from disk and sets the
"phase2-private-key" property with the private key file data if
using the NM_SETTING_802_1X_CK_SCHEME_BLOB
scheme, or with the path to the
private key file if using the NM_SETTING_802_1X_CK_SCHEME_PATH
scheme.
If password
is given, this function attempts to decrypt the private key to
verify that password
is correct, and if it is, updates the
"phase2-private-key-password" property with the given
password
. If the decryption is unsuccessful, FALSE
is returned, error
is
set, and no internal data is changed. If no password
is given, the private
key is assumed to be valid, no decryption is performed, and the password may
be set at a later time.
WARNING: the "phase2" private key property is not a "secret" property, and thus unencrypted private key data using the BLOB scheme may be readable by unprivileged users. Private keys should always be encrypted with a private key password to prevent unauthorized access to unencrypted private key data.
|
the NMSetting8021x |
|
when scheme is set to either NM_SETTING_802_1X_CK_SCHEME_PATH or
NM_SETTING_802_1X_CK_SCHEME_BLOB , pass the path of the "phase2" private
key file (PEM, DER, or PKCS12 format). The path must be UTF-8 encoded;
use g_filename_to_utf8() to convert if needed. Passing NULL with any
scheme clears the private key. |
|
password used to decrypt the private key, or NULL if the password
is unknown. If the password is given but fails to decrypt the private key,
an error is returned. |
|
desired storage scheme for the private key |
|
on successful return, the type of the private key added |
|
on unsuccessful return, an error |
Returns : |
TRUE if the operation succeeded, FALSE if it was unsuccessful |
const char * nm_setting_802_1x_get_phase2_private_key_password
(NMSetting8021x *setting
);
|
the NMSetting8021x |
Returns : |
the private key password used to decrypt the private key if
previously set with nm_setting_802_1x_set_phase2_private_key_from_file() ,
nm_setting_802_1x_set_phase2_private_key_path() , or the
"phase2-private-key-password" property. |
NMSettingSecretFlags nm_setting_802_1x_get_phase2_private_key_password_flags
(NMSetting8021x *setting
);
|
the NMSetting8021x |
Returns : |
the NMSettingSecretFlags pertaining to the "phase2-private-key-password" |
NMSetting8021xCKFormat nm_setting_802_1x_get_phase2_private_key_format
(NMSetting8021x *setting
);
|
the NMSetting8021x |
Returns : |
the data format of the "phase 2" private key data stored in the "phase2-private-key" property |
"anonymous-identity"
property"anonymous-identity" gchar* : Read / Write
Anonymous identity string for EAP authentication methods. Used as the unencrypted identity with EAP types that support different tunneled identity like EAP-TTLS.
Default value: NULL
"ca-cert"
property "ca-cert" GArray_guchar_* : Read / Write
Contains the CA certificate if used by the EAP method specified in the
"eap" property. Setting this property directly is
discouraged; use the nm_setting_802_1x_set_ca_cert()
function instead.
"ca-path"
property"ca-path" gchar* : Read / Write
UTF-8 encoded path to a directory containing PEM or DER formatted certificates to be added to the verification chain in addition to the certificate specified in the "ca-cert" property.
Default value: NULL
"client-cert"
property "client-cert" GArray_guchar_* : Read / Write
Contains the client certificate if used by the EAP method specified in
the "eap" property. Setting this property directly is
discouraged; use the nm_setting_802_1x_set_client_cert()
function instead.
"eap"
property "eap" GSList_gchararray_* : Read / Write
The allowed EAP method to be used when authenticating to the network with 802.1x. Valid methods are: "leap", "md5", "tls", "peap", "ttls", and "fast". Each method requires different configuration using the properties of this object; refer to wpa_supplicant documentation for the allowed combinations.
"identity"
property"identity" gchar* : Read / Write
Identity string for EAP authentication methods. Often the user's user or login name.
Default value: NULL
"password"
property"password" gchar* : Read / Write
Password used for EAP authentication methods.
Default value: NULL
"password-flags"
property"password-flags" guint : Read / Write
Flags indicating how to handle "password":.
Allowed values: <= 7
Default value: 0
"phase1-fast-provisioning"
property"phase1-fast-provisioning" gchar* : Read / Write
Enables or disables in-line provisioning of EAP-FAST credentials when FAST is specified as the EAP method in the "eap" property. Recognized values are "0" (disabled), "1" (allow unauthenticated provisioning), "2" (allow authenticated provisioning), and "3" (allow both authenticated and unauthenticated provisioning). See the wpa_supplicant documentation for more details.
Default value: NULL
"phase1-peaplabel"
property"phase1-peaplabel" gchar* : Read / Write
Forces use of the new PEAP label during key derivation. Some RADIUS servers may require forcing the new PEAP label to interoperate with PEAPv1. Set to "1" to force use of the new PEAP label. See the wpa_supplicant documentation for more details.
Default value: NULL
"phase1-peapver"
property"phase1-peapver" gchar* : Read / Write
Forces which PEAP version is used when PEAP is set as the EAP method in the "eap" property. When unset, the version reported by the server will be used. Sometimes when using older RADIUS servers, it is necessary to force the client to use a particular PEAP version. To do so, this property may be set to "0" or "1" to force that specific PEAP version.
Default value: NULL
"phase2-auth"
property"phase2-auth" gchar* : Read / Write
Specifies the allowed "phase 2" inner non-EAP authentication methods when an EAP method that uses an inner TLS tunnel is specified in the "eap" property. Recognized non-EAP phase2 methods are "pap", "chap", "mschap", "mschapv2", "gtc", "otp", "md5", and "tls". Each 'phase 2' inner method requires specific parameters for successful authentication; see the wpa_supplicant documentation for more details.
Default value: NULL
"phase2-autheap"
property"phase2-autheap" gchar* : Read / Write
Specifies the allowed "phase 2" inner EAP-based authentication methods when an EAP method that uses an inner TLS tunnel is specified in the "eap" property. Recognized EAP-based phase2 methods are "md5", "mschapv2", "otp", "gtc", and "tls". Each 'phase 2' inner method requires specific parameters for successful authentication; see the wpa_supplicant documentation for more details.
Default value: NULL
"phase2-ca-cert"
property "phase2-ca-cert" GArray_guchar_* : Read / Write
Contains the CA certificate if used by the EAP method specified in the
"phase2-auth" or "phase2-autheap" properties.
Setting this property directly is discouraged; use the
nm_setting_802_1x_set_phase2_ca_cert()
function instead.
"phase2-ca-path"
property"phase2-ca-path" gchar* : Read / Write
UTF-8 encoded path to a directory containing PEM or DER formatted certificates to be added to the verification chain in addition to the certificate specified in the "phase2-ca-cert" property.
Default value: NULL
"phase2-client-cert"
property "phase2-client-cert" GArray_guchar_* : Read / Write
Contains the client certificate if used by the EAP method specified in
the "phase2-auth" or "phase2-autheap"
properties. Setting this property directly is discouraged; use the
nm_setting_802_1x_set_phase2_client_cert()
function instead.
"phase2-private-key"
property "phase2-private-key" GArray_guchar_* : Read / Write
Private key data used by "phase 2" inner authentication methods.
Contains the "phase 2" inner private key if the "auth" or
"phase2-autheap" property is set to 'tls'. Setting this
property directly is discouraged; use the
nm_setting_802_1x_set_phase2_private_key()
function instead.
"phase2-private-key-password"
property"phase2-private-key-password" gchar* : Read / Write
The password used to decrypt the private key specified in
"phase2-private-key" when the private key either uses the
path scheme, or if the private key is a PKCS12 format key. Setting this
property directly is not generally necessary except when returning
secrets to NetworkManager; it is generally set automatically when setting
the private key by the nm_setting_802_1x_set_phase2_private_key()
function.
Default value: NULL
"phase2-private-key-password-flags"
property"phase2-private-key-password-flags" guint : Read / Write
Flags indicating how to handle "phase2-private-key-password":.
Allowed values: <= 7
Default value: 0
"private-key"
property "private-key" GArray_guchar_* : Read / Write
Contains the private key if the "eap" property is set to
'tls'. Setting this property directly is discouraged; use the
nm_setting_802_1x_set_private_key()
function instead.
WARNING: "private-key" is not a "secret" property, and thus unencrypted private key data using the BLOB scheme may be readable by unprivileged users. Private keys should always be encrypted with a private key password to prevent unauthorized access to unencrypted private key data.
"private-key-password"
property"private-key-password" gchar* : Read / Write
The password used to decrypt the private key specified in
"private-key" when the private key either uses the path
scheme, or if the private key is a PKCS12 format key. Setting this
property directly is not generally necessary except when returning
secrets to NetworkManager; it is generally set automatically when setting
the private key by the nm_setting_802_1x_set_private_key()
function.
Default value: NULL
"private-key-password-flags"
property"private-key-password-flags" guint : Read / Write
Flags indicating how to handle "private-key-password":.
Allowed values: <= 7
Default value: 0
"system-ca-certs"
property"system-ca-certs" gboolean : Read / Write / Construct
When TRUE, overrides "ca-path" and "phase2-ca-path" properties using the system CA directory specified at configure time with the --system-ca-path switch. The certificates in this directory are added to the verification chain in addition to any certificates specified by the "ca-cert", "ca-cert-path", "phase2-ca-cert" and "phase2-ca-cert-path" properties.
Default value: FALSE