diff -r 30e048a7b597 -r bad0cc58d154 securitysettings/cpwlansecurityuiplugins/cpwpacmnui/inc/wpakeyvalidator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/securitysettings/cpwlansecurityuiplugins/cpwpacmnui/inc/wpakeyvalidator.h Tue Aug 31 15:16:37 2010 +0300 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * Validation methods for WPA/WPA2 & WPA2 only keys + * + */ + +/* + * %version: tr1cfwln#3 % + */ + +#ifndef WPAKEYVALIDATOR_H +#define WPAKEYVALIDATOR_H + +/*! + * @addtogroup group_wpa_key_validator + * @{ + */ + +class WpaKeyValidator +{ +public: + enum KeyStatus + { + KeyStatusOk, + KeyStatusIllegalCharacters, + KeyStatusWpaTooShort, + KeyStatusWpaTooLong + }; + + static const int WpaMaxLenght = 64; + static const int WpaMinLenght = 8; + +public: + + static KeyStatus validateWpaKey(const QString &key); + static KeyStatus isAscii(const QString &key); + static KeyStatus isHex(const QString &key); +}; + +/*! @} */ + +#endif /* WPAKEYVALIDATOR_H */