securitysettings/cpwlansecurityuiplugins/cpwpacmnui/inc/wpakeyvalidator.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 23 Jun 2010 18:14:55 +0300
changeset 38 7a0216d033ac
parent 33 938269283a16
child 34 ad1f037f1ac2
permissions -rw-r--r--
Revision: 201023 Kit: 2010125

/*
 * 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 the License "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: 1 %
 */

#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 */