Click or drag to resize

wclWiFiHostedNetworkGetKey Method

Reads the secondary security key that is configured to be used by the wireless Hosted Network.

Namespace: wclWiFi
Assembly: wclWiFiFramework (in wclWiFiFramework.dll) Version: 7.13.1.0 (7.13.1.0)
Syntax
public int GetKey(
	out byte[] KeyData,
	out bool IsPassPhrase,
	out bool Persistent
)

Parameters

KeyData  Byte
A value that receives a buffer returned with the secondary security key data, if the call to the method succeeds.
IsPassPhrase  Boolean

A Boolean value that indicates if the key data array pointed to by the KeyData parameter is in passphrase format.

If this parameter is True, the key data array is in passphrase format. If this parameter is False, the key data array is not in passphrase format.

Persistent  Boolean

A Boolean value that indicates if the key data array pointed to by the KeyData parameter is to be stored and reused later or is for one-time use only.

If this parameter is True, the key data array is to be stored and reused later. If this parameter is False, the key data array is for one-time use only.

Return Value

Int32
If the function succeeds, the return value is WCL_E_SUCCESS. If the function fails, the return value may be one of the WCL return codes.
Remarks

A client application calls the GetKey method to query the secondary security key that will be used by the wireless Hosted Network. This function will return the key information including key data, key length, whether it is a passphrase, and whether it is persistent or for one-time use. This function does not change the state or properties of the wireless Hosted Network.

The secondary security key is a passphrase if the value of the IsPassPhrase parameter is True. The secondary security key is a binary key if the value of the "IsPassPhrase" parameter is False.

The secondary security key returned in the buffer pointed to by the KeyData parameter is used with WPA2-Personal authentication and is in one of the following formats:

  • A key passphrase that consists of an array of ASCII characters from 8 to 63 characters.
  • A binary key that conists of 32 bytes of binary key data.

The secondary security key is persistent if the value of the Persistent parameter is True. When persistent, the secondary security key would be used immediately if the Hosted Network is already started, and also reused whenever Hosted Network is started in the future.

If secondary security key is not specified as persistent, it will be used immediately if the Hosted Network is already started, or only for the next time when the Hosted Network is started. After the Hosted Network is stopped, this secondary security key will never be used again and will be removed from the system.

If there is no secondary security key currently configured, the value returned in the KeyData parameter will be null. In such case, the value returned in the IsPassPhrase and Persistent parameters will be meaningless.

See Also