2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file FNetWifiWifiSecurityInfo.h
19 * @brief This is the header file for the %WifiSecurityInfo class.
21 * This header file contains the declarations of the %WifiSecurityInfo class.
23 #ifndef _FNET_WIFI_WIFI_SECURITY_INFO_H_
24 #define _FNET_WIFI_WIFI_SECURITY_INFO_H_
26 #include <FBaseObject.h>
27 #include <FNetWifiWifiTypes.h>
29 namespace Tizen { namespace Net { namespace Wifi
31 class _WifiSecurityInfoImpl;
34 * @class WifiSecurityInfo
35 * @brief This class provides methods to manage the security information of a Wi-Fi network.
39 * The %WifiSecurityInfo class is used with the WifiNetAccountInfo class to set and get the security information of a Wi-Fi
42 * For more information on the class features, see
43 * <a href="../org.tizen.native.appprogramming/html/guide/net/wi-fi_connectivity.htm">Wi-Fi Connectivity</a>.
45 class _OSP_EXPORT_ WifiSecurityInfo
46 : public Tizen::Base::Object
50 * This is the default constructor for this class.
54 WifiSecurityInfo(void);
57 * Copying of objects using this copy constructor is allowed.
61 * @param[in] value An instance of %WifiSecurityInfo
63 WifiSecurityInfo(const WifiSecurityInfo& value);
66 * This destructor overrides Tizen::Base::Object::~Object().
70 virtual ~WifiSecurityInfo(void);
73 * Gets the authentication type of this account.
77 * @return The authentication type of this account
79 WifiAuthenticationType GetAuthenticationType(void) const;
82 * Gets the encryption type of this account.
86 * @return The encryption type
87 * @remarks If the encryption type is @c WIFI_ENCRYPTION_TKIP_AES_MIXED, either SetNetworkKeyAes() or
88 * SetNetworkKeyTkip() can be used to set the key.
90 WifiEncryptionType GetEncryptionType(void) const;
94 * Sets the Wired Equivalent Privacy (WEP) key data.
96 * @brief <i> [Deprecated] </i>
97 * @deprecated This method is deprecated because the key value does not need to set for each encryption type.
98 * Instead of using this method, use SetNetworkKey().
102 * @return An error code
103 * @param[in] keyLen A WifiWepKeyLen enumerator value
104 * @param[in] keyIndex The key index of WEP key to set
105 * @param[in] key The key data to set
106 * @exception E_SUCCESS The method is successful.
107 * @exception E_INVALID_ARG The length of the specified @c key exceeds @c 10 bytes when the value of @c keyLen
108 * is Wifi::WIFI_WEP_KEY_LEN_64BIT, or the length of the specified @c key exceeds
109 * @c 26 bytes when the value of @c keyLen is Wifi::WIFI_WEP_KEY_LEN_128BIT.
110 * @exception E_SYSTEM A system error has occurred.
113 result SetNetworkKeyWep(WifiWepKeyLen keyLen, WifiWepKeyIndex keyIndex, const Tizen::Base::String& key);
117 * Sets the Advanced Encryption Standard (AES) key data.
119 * @brief <i> [Deprecated] </i>
120 * @deprecated This method is deprecated because the key value does not need to set for each encryption type.
121 * Instead of using this method, use SetNetworkKey().
125 * @return An error code
126 * @param[in] key The key data to set
127 * @exception E_SUCCESS The method is successful.
128 * @exception E_INVALID_ARG The length of the specified @c key exceeds @c 64 bytes.
129 * @exception E_SYSTEM A system error has occurred.
132 result SetNetworkKeyAes(const Tizen::Base::String& key);
136 * Sets the Temporal Key Integrity Protocol (TKIP) key data.
138 * @brief <i> [Deprecated] </i>
139 * @deprecated This method is deprecated because the key value does not need to set for each encryption type.
140 * Instead of using this method, use SetNetworkKey().
144 * @return An error code
145 * @param[in] key The key data to set
146 * @exception E_SUCCESS The method is successful.
147 * @exception E_INVALID_ARG The length of the specified @c key exceeds @c 64 bytes.
148 * @exception E_SYSTEM A system error has occurred.
151 result SetNetworkKeyTkip(const Tizen::Base::String& key);
154 * Sets the Extensible Authentication Protocol (EAP) method information.
158 * @return An error code
159 * @param[in] type The EAP method type
160 * @param[in] userId The user ID to set @n
161 * Its length must not exceed @c 256 bytes.
162 * @param[in] password The password to set @n
163 * Its length must not exceed @c 256 bytes.
164 * @param[in] validateServerCertificate Set to @c true to determine the validation of the server certificate, @n
166 * @exception E_SUCCESS The method is successful.
167 * @exception E_INVALID_ARG The length of the specified @c userId or @c password exceeds @c 256 bytes.
168 * @exception E_UNSUPPORTED_TYPE The input @c type is not supported.
169 * @exception E_SYSTEM A system error has occurred.
171 result SetEapMethodInfo(WifiEapType type, const Tizen::Base::String& userId, const Tizen::Base::String& password, bool validateServerCertificate = true);
174 * Sets the network key.
178 * @param[in] key The network key
180 void SetNetworkKey(const Tizen::Base::String& key);
183 * Sets the authentication type.
187 * @param[in] authType The authentication type
189 void SetAuthenticationType(WifiAuthenticationType authType);
192 * Checks whether the specified instance of %WifiSecurityInfo equals the current instance.
196 * @return @c true if the specified instance equals the current instance, @n
198 * @param[in] obj An instance of %WifiSecurityInfo
199 * @remarks This method returns @c false if the specified object is not %WifiSecurityInfo.
201 virtual bool Equals(const Tizen::Base::Object& obj) const;
204 * Gets the hash value of the current instance.
208 * @return The hash value of the current instance
210 virtual int GetHashCode(void) const;
213 * Assigns the value of the specified instance to the current instance of %WifiSecurityInfo.
217 * @return The reference of this instance
218 * @param[in] rhs An instance of %WifiSecurityInfo
220 WifiSecurityInfo& operator=(const WifiSecurityInfo& rhs);
223 _WifiSecurityInfoImpl* __pWifiSecurityInfoImpl;
225 friend class _WifiSecurityInfoImpl;
226 }; // WifiSecurityInfo
228 } } } //Tizen::Net::Wifi
229 #endif // _FNET_WIFI_WIFI_SECURITY_INFO_H_