QXmpp Version:0.3.91
QXmppSaslAuth.h
00001 /*
00002  * Copyright (C) 2008-2011 The QXmpp developers
00003  *
00004  * Authors:
00005  *  Manjeet Dahiya
00006  *  Jeremy Lainé
00007  *
00008  * Source:
00009  *  http://code.google.com/p/qxmpp
00010  *
00011  * This file is a part of QXmpp library.
00012  *
00013  * This library is free software; you can redistribute it and/or
00014  * modify it under the terms of the GNU Lesser General Public
00015  * License as published by the Free Software Foundation; either
00016  * version 2.1 of the License, or (at your option) any later version.
00017  *
00018  * This library is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021  * Lesser General Public License for more details.
00022  *
00023  */
00024 
00025 #ifndef QXMPPSASLAUTH_H
00026 #define QXMPPSASLAUTH_H
00027 
00028 #include <QByteArray>
00029 #include <QMap>
00030 
00031 class QXmppSaslDigestMd5
00032 {
00033 public:
00034     QByteArray authzid() const;
00035     void setAuthzid(const QByteArray &cnonce);
00036 
00037     QByteArray cnonce() const;
00038     void setCnonce(const QByteArray &cnonce);
00039 
00040     QByteArray digestUri() const;
00041     void setDigestUri(const QByteArray &digestUri);
00042 
00043     QByteArray nc() const;
00044     void setNc(const QByteArray &nc);
00045 
00046     QByteArray nonce() const;
00047     void setNonce(const QByteArray &nonce);
00048 
00049     QByteArray qop() const;
00050     void setQop(const QByteArray &qop);
00051 
00052     void setSecret(const QByteArray &secret);
00053 
00054     QByteArray calculateDigest(const QByteArray &A2) const;
00055     QByteArray calculateDigest(const QByteArray &A1, const QByteArray &A2) const;
00056     static QByteArray generateNonce();
00057 
00058     // message parsing and serialization
00059     static QMap<QByteArray, QByteArray> parseMessage(const QByteArray &ba);
00060     static QByteArray serializeMessage(const QMap<QByteArray, QByteArray> &map);
00061 
00062 private:
00063     QByteArray m_authzid;
00064     QByteArray m_cnonce;
00065     QByteArray m_digestUri;
00066     QByteArray m_nc;
00067     QByteArray m_nonce;
00068     QByteArray m_qop;
00069     QByteArray m_secret;
00070 };
00071 
00072 #endif
 All Classes Functions Enumerations Enumerator Properties