QXmpp  Version:0.4.92
 All Classes Functions Enumerations Enumerator Properties Groups
QXmppSaslAuth.h
1 /*
2  * Copyright (C) 2008-2011 The QXmpp developers
3  *
4  * Authors:
5  * Manjeet Dahiya
6  * Jeremy LainĂ©
7  *
8  * Source:
9  * http://code.google.com/p/qxmpp
10  *
11  * This file is a part of QXmpp library.
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Lesser General Public
15  * License as published by the Free Software Foundation; either
16  * version 2.1 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  * Lesser General Public License for more details.
22  *
23  */
24 
25 #ifndef QXMPPSASLAUTH_H
26 #define QXMPPSASLAUTH_H
27 
28 #include <QByteArray>
29 #include <QMap>
30 
31 #include "QXmppGlobal.h"
32 
33 class QXMPP_EXPORT QXmppSaslDigestMd5
34 {
35 public:
36  QByteArray authzid() const;
37  void setAuthzid(const QByteArray &cnonce);
38 
39  QByteArray cnonce() const;
40  void setCnonce(const QByteArray &cnonce);
41 
42  QByteArray digestUri() const;
43  void setDigestUri(const QByteArray &digestUri);
44 
45  QByteArray nc() const;
46  void setNc(const QByteArray &nc);
47 
48  QByteArray nonce() const;
49  void setNonce(const QByteArray &nonce);
50 
51  QByteArray qop() const;
52  void setQop(const QByteArray &qop);
53 
54  void setSecret(const QByteArray &secret);
55 
56  QByteArray calculateDigest(const QByteArray &A2) const;
57  QByteArray calculateDigest(const QByteArray &A1, const QByteArray &A2) const;
58  static QByteArray generateNonce();
59 
60  // message parsing and serialization
61  static QMap<QByteArray, QByteArray> parseMessage(const QByteArray &ba);
62  static QByteArray serializeMessage(const QMap<QByteArray, QByteArray> &map);
63 
64 private:
65  QByteArray m_authzid;
66  QByteArray m_cnonce;
67  QByteArray m_digestUri;
68  QByteArray m_nc;
69  QByteArray m_nonce;
70  QByteArray m_qop;
71  QByteArray m_secret;
72 };
73 
74 #endif