NM.SettingWirelessSecurity

g GObject.Object GObject.Object NM.Setting NM.Setting GObject.Object->NM.Setting NM.SettingWirelessSecurity NM.SettingWirelessSecurity NM.Setting->NM.SettingWirelessSecurity

Subclasses:

None

Methods

Inherited:

NM.Setting (21), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_group (group)

add_pairwise (pairwise)

add_proto (proto)

clear_groups ()

clear_pairwise ()

clear_protos ()

get_auth_alg ()

get_fils ()

get_group (i)

get_key_mgmt ()

get_leap_password ()

get_leap_password_flags ()

get_leap_username ()

get_num_groups ()

get_num_pairwise ()

get_num_protos ()

get_pairwise (i)

get_pmf ()

get_proto (i)

get_psk ()

get_psk_flags ()

get_wep_key (idx)

get_wep_key_flags ()

get_wep_key_type ()

get_wep_tx_keyidx ()

get_wps_method ()

remove_group (i)

remove_group_by_value (group)

remove_pairwise (i)

remove_pairwise_by_value (pairwise)

remove_proto (i)

remove_proto_by_value (proto)

set_wep_key (idx, key)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

NM.Setting (1)

Name

Type

Flags

Short Description

auth-alg

str

r/w/en

fils

int

r/w/en

group

[str]

r/w

key-mgmt

str

r/w/en

leap-password

str

r/w/en

leap-password-flags

NM.SettingSecretFlags

r/w/en

leap-username

str

r/w/en

pairwise

[str]

r/w

pmf

int

r/w/en

proto

[str]

r/w

psk

str

r/w/en

psk-flags

NM.SettingSecretFlags

r/w/en

wep-key0

str

r/w/en

wep-key1

str

r/w/en

wep-key2

str

r/w/en

wep-key3

str

r/w/en

wep-key-flags

NM.SettingSecretFlags

r/w/en

wep-key-type

NM.WepKeyType

r/w

wep-tx-keyidx

int

r/w/en

wps-method

int

r/w/en

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class NM.SettingWirelessSecurity(**kwargs)
Bases:

NM.Setting

Abstract:

No

Structure:

NM.SettingWirelessSecurityClass

Wi-Fi Security Settings

classmethod new()
Returns:

the new empty NM.SettingWirelessSecurity object

Return type:

NM.Setting

Creates a new NM.SettingWirelessSecurity object with default values.

add_group(group)
Parameters:

group (str) – the encryption algorithm to add, one of “wep40”, “wep104”, “tkip”, or “ccmp”

Returns:

True if the algorithm was added to the list, False if it was already in the list

Return type:

bool

Adds an encryption algorithm to the list of allowed groupwise encryption algorithms. If the list is not empty, then only access points that support one or more of the encryption algorithms in the list will be considered compatible with this connection.

add_pairwise(pairwise)
Parameters:

pairwise (str) – the encryption algorithm to add, one of “tkip” or “ccmp”

Returns:

True if the algorithm was added to the list, False if it was already in the list

Return type:

bool

Adds an encryption algorithm to the list of allowed pairwise encryption algorithms. If the list is not empty, then only access points that support one or more of the encryption algorithms in the list will be considered compatible with this connection.

add_proto(proto)
Parameters:

proto (str) – the protocol to add, one of “wpa” or “rsn”

Returns:

True if the protocol was new and was added to the allowed protocol list, or False if it was already in the list

Return type:

bool

Adds a Wi-Fi security protocol (one of “wpa” or “rsn”) to the allowed list; only protocols in this list will be used when finding and connecting to the Wi-Fi network specified by this connection. For example, if the protocol list contains only “wpa” but the access point for the SSID specified by this connection only supports WPA2/RSN, the connection cannot be used with the access point.

clear_groups()

Removes all algorithms from the allowed list. If there are no algorithms specified then all groupwise encryption algorithms are allowed.

clear_pairwise()

Removes all algorithms from the allowed list. If there are no algorithms specified then all pairwise encryption algorithms are allowed.

clear_protos()

Removes all protocols from the allowed list. If there are no protocols specified then all protocols are allowed.

get_auth_alg()
Returns:

the NM.SettingWirelessSecurity :auth-alg property of the setting

Return type:

str

get_fils()
Returns:

the NM.SettingWirelessSecurity :fils property of the setting

Return type:

NM.SettingWirelessSecurityFils

New in version 1.12.

get_group(i)
Parameters:

i (int) – index of an item in the allowed groupwise encryption algorithm list

Returns:

the groupwise encryption algorithm at index i

Return type:

str

Returns the allowed groupwise encryption algorithm from allowed algorithm list.

get_key_mgmt()
Returns:

the NM.SettingWirelessSecurity :key-mgmt property of the setting

Return type:

str

get_leap_password()
Returns:

the NM.SettingWirelessSecurity :leap-password property of the setting

Return type:

str

get_leap_password_flags()
Returns:

the NM.SettingSecretFlags pertaining to the NM.SettingWirelessSecurity :leap-password

Return type:

NM.SettingSecretFlags

get_leap_username()
Returns:

the NM.SettingWirelessSecurity :leap-username property of the setting

Return type:

str

get_num_groups()
Returns:

the number of groupwise encryption algorithms in the allowed list

Return type:

int

get_num_pairwise()
Returns:

the number of pairwise encryption algorithms in the allowed list

Return type:

int

get_num_protos()
Returns:

the number of security protocols this connection allows when connecting to secure Wi-Fi networks

Return type:

int

get_pairwise(i)
Parameters:

i (int) – index of an item in the allowed pairwise encryption algorithm list

Returns:

the pairwise encryption algorithm at index i

Return type:

str

Returns the allowed pairwise encryption algorithm from allowed algorithm list.

get_pmf()
Returns:

the NM.SettingWirelessSecurity :pmf property of the setting

Return type:

NM.SettingWirelessSecurityPmf

New in version 1.10.

get_proto(i)
Parameters:

i (int) – an index into the protocol list

Returns:

the protocol at index i

Return type:

str

get_psk()
Returns:

the NM.SettingWirelessSecurity :psk property of the setting

Return type:

str

get_psk_flags()
Returns:

the NM.SettingSecretFlags pertaining to the NM.SettingWirelessSecurity :psk

Return type:

NM.SettingSecretFlags

get_wep_key(idx)
Parameters:

idx (int) – the WEP key index (0..3 inclusive)

Returns:

the WEP key at the given index

Return type:

str

get_wep_key_flags()
Returns:

the NM.SettingSecretFlags pertaining to the all WEP keys

Return type:

NM.SettingSecretFlags

get_wep_key_type()
Returns:

the NM.SettingWirelessSecurity :wep-key-type property of the setting

Return type:

NM.WepKeyType

get_wep_tx_keyidx()
Returns:

the NM.SettingWirelessSecurity :wep-tx-keyidx property of the setting

Return type:

int

get_wps_method()
Returns:

the NM.SettingWirelessSecurity :wps-method property of the setting

Return type:

NM.SettingWirelessSecurityWpsMethod

New in version 1.10.

remove_group(i)
Parameters:

i (int) – the index of an item in the allowed groupwise encryption algorithm list

Removes an encryption algorithm from the allowed groupwise encryption algorithm list.

remove_group_by_value(group)
Parameters:

group (str) – the encryption algorithm to remove, one of “wep40”, “wep104”, “tkip”, or “ccmp”

Returns:

True if the algorithm was found and removed; False if it was not.

Return type:

bool

Removes an encryption algorithm from the allowed groupwise encryption algorithm list.

remove_pairwise(i)
Parameters:

i (int) – the index of an item in the allowed pairwise encryption algorithm list

Removes an encryption algorithm from the allowed pairwise encryption algorithm list.

remove_pairwise_by_value(pairwise)
Parameters:

pairwise (str) – the encryption algorithm to remove, one of “tkip” or “ccmp”

Returns:

True if the encryption algorithm was found and removed; False if it was not.

Return type:

bool

Removes an encryption algorithm from the allowed pairwise encryption algorithm list.

remove_proto(i)
Parameters:

i (int) – index of the protocol to remove

Removes a protocol from the allowed protocol list.

remove_proto_by_value(proto)
Parameters:

proto (str) – the protocol to remove, one of “wpa” or “rsn”

Returns:

True if the protocol was found and removed; False if it was not.

Return type:

bool

Removes a protocol from the allowed protocol list.

set_wep_key(idx, key)
Parameters:
  • idx (int) – the index of the key (0..3 inclusive)

  • key (str) – the WEP key as a string, in either hexadecimal, ASCII, or passphrase form as determined by the value of the NM.SettingWirelessSecurity :wep-key-type property.

Sets a WEP key in the given index.

Property Details

NM.SettingWirelessSecurity.props.auth_alg
Name:

auth-alg

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

When WEP is used (ie, key-mgmt = “none” or “ieee8021x”) indicate the 802.11 authentication algorithm required by the AP here. One of “open” for Open System, “shared” for Shared Key, or “leap” for Cisco LEAP. When using Cisco LEAP (ie, key-mgmt = “ieee8021x” and auth-alg = “leap”) the “leap-username” and “leap-password” properties must be specified.

NM.SettingWirelessSecurity.props.fils
Name:

fils

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Indicates whether Fast Initial Link Setup (802.11ai) must be enabled for the connection. One of NM.SettingWirelessSecurityFils.DEFAULT (use global default value), NM.SettingWirelessSecurityFils.DISABLE (disable FILS), NM.SettingWirelessSecurityFils.OPTIONAL (enable FILS if the supplicant and the access point support it) or NM.SettingWirelessSecurityFils.REQUIRED (enable FILS and fail if not supported). When set to NM.SettingWirelessSecurityFils.DEFAULT and no global default is set, FILS will be optionally enabled.

New in version 1.12.

NM.SettingWirelessSecurity.props.group
Name:

group

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

A list of group/broadcast encryption algorithms which prevents connections to Wi-Fi networks that do not utilize one of the algorithms in the list. For maximum compatibility leave this property empty. Each list element may be one of “wep40”, “wep104”, “tkip”, or “ccmp”.

NM.SettingWirelessSecurity.props.key_mgmt
Name:

key-mgmt

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Key management used for the connection. One of “none” (WEP or no password protection), “ieee8021x” (Dynamic WEP), “owe” (Opportunistic Wireless Encryption), “wpa-psk” (WPA2 + WPA3 personal), “sae” (WPA3 personal only), “wpa-eap” (WPA2 + WPA3 enterprise) or “wpa-eap-suite-b-192” (WPA3 enterprise only).

This property must be set for any Wi-Fi connection that uses security.

NM.SettingWirelessSecurity.props.leap_password
Name:

leap-password

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The login password for legacy LEAP connections (ie, key-mgmt = “ieee8021x” and auth-alg = “leap”).

NM.SettingWirelessSecurity.props.leap_password_flags
Name:

leap-password-flags

Type:

NM.SettingSecretFlags

Default Value:

NM.SettingSecretFlags.NONE

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Flags indicating how to handle the NM.SettingWirelessSecurity :leap-password property.

NM.SettingWirelessSecurity.props.leap_username
Name:

leap-username

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The login username for legacy LEAP connections (ie, key-mgmt = “ieee8021x” and auth-alg = “leap”).

NM.SettingWirelessSecurity.props.pairwise
Name:

pairwise

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

A list of pairwise encryption algorithms which prevents connections to Wi-Fi networks that do not utilize one of the algorithms in the list. For maximum compatibility leave this property empty. Each list element may be one of “tkip” or “ccmp”.

NM.SettingWirelessSecurity.props.pmf
Name:

pmf

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Indicates whether Protected Management Frames (802.11w) must be enabled for the connection. One of NM.SettingWirelessSecurityPmf.DEFAULT (use global default value), NM.SettingWirelessSecurityPmf.DISABLE (disable PMF), NM.SettingWirelessSecurityPmf.OPTIONAL (enable PMF if the supplicant and the access point support it) or NM.SettingWirelessSecurityPmf.REQUIRED (enable PMF and fail if not supported). When set to NM.SettingWirelessSecurityPmf.DEFAULT and no global default is set, PMF will be optionally enabled.

New in version 1.10.

NM.SettingWirelessSecurity.props.proto
Name:

proto

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

List of strings specifying the allowed WPA protocol versions to use. Each element may be one “wpa” (allow WPA) or “rsn” (allow WPA2/RSN). If not specified, both WPA and RSN connections are allowed.

NM.SettingWirelessSecurity.props.psk
Name:

psk

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Pre-Shared-Key for WPA networks. For WPA-PSK, it’s either an ASCII passphrase of 8 to 63 characters that is (as specified in the 802.11i standard) hashed to derive the actual key, or the key in form of 64 hexadecimal character. The WPA3-Personal networks use a passphrase of any length for SAE authentication.

NM.SettingWirelessSecurity.props.psk_flags
Name:

psk-flags

Type:

NM.SettingSecretFlags

Default Value:

NM.SettingSecretFlags.NONE

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Flags indicating how to handle the NM.SettingWirelessSecurity :psk property.

NM.SettingWirelessSecurity.props.wep_key0
Name:

wep-key0

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Index 0 WEP key. This is the WEP key used in most networks. See the “wep-key-type” property for a description of how this key is interpreted.

NM.SettingWirelessSecurity.props.wep_key1
Name:

wep-key1

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Index 1 WEP key. This WEP index is not used by most networks. See the “wep-key-type” property for a description of how this key is interpreted.

NM.SettingWirelessSecurity.props.wep_key2
Name:

wep-key2

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Index 2 WEP key. This WEP index is not used by most networks. See the “wep-key-type” property for a description of how this key is interpreted.

NM.SettingWirelessSecurity.props.wep_key3
Name:

wep-key3

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Index 3 WEP key. This WEP index is not used by most networks. See the “wep-key-type” property for a description of how this key is interpreted.

NM.SettingWirelessSecurity.props.wep_key_flags
Name:

wep-key-flags

Type:

NM.SettingSecretFlags

Default Value:

NM.SettingSecretFlags.NONE

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Flags indicating how to handle the NM.SettingWirelessSecurity :wep-key0, NM.SettingWirelessSecurity :wep-key1, NM.SettingWirelessSecurity :wep-key2, and NM.SettingWirelessSecurity :wep-key3 properties.

NM.SettingWirelessSecurity.props.wep_key_type
Name:

wep-key-type

Type:

NM.WepKeyType

Default Value:

NM.WepKeyType.UNKNOWN

Flags:

READABLE, WRITABLE

Controls the interpretation of WEP keys. Allowed values are NM.WepKeyType.KEY, in which case the key is either a 10- or 26-character hexadecimal string, or a 5- or 13-character ASCII password; or NM.WepKeyType.PASSPHRASE, in which case the passphrase is provided as a string and will be hashed using the de-facto MD5 method to derive the actual WEP key.

NM.SettingWirelessSecurity.props.wep_tx_keyidx
Name:

wep-tx-keyidx

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

When static WEP is used (ie, key-mgmt = “none”) and a non-default WEP key index is used by the AP, put that WEP key index here. Valid values are 0 (default key) through 3. Note that some consumer access points (like the Linksys WRT54G) number the keys 1 - 4.

NM.SettingWirelessSecurity.props.wps_method
Name:

wps-method

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Flags indicating which mode of WPS is to be used if any.

There’s little point in changing the default setting as NetworkManager will automatically determine whether it’s feasible to start WPS enrollment from the Access Point capabilities.

WPS can be disabled by setting this property to a value of 1.

New in version 1.10.