1 /***************************************************************************
2 * Copyright (C) 2005-08 by the Quassel Project *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #ifndef COREIDENTITY_H
22 #define COREIDENTITY_H
27 #include <QSslCertificate>
29 class CoreCertManager;
33 class CoreIdentity : public Identity {
37 CoreIdentity(IdentityId id, SignalProxy *proxy, CoreSession *parent);
38 CoreIdentity(const Identity &other, SignalProxy *proxy, CoreSession *parent);
40 inline const QSslKey &sslKey() const { return _sslKey; }
41 inline void setSslKey(const QSslKey &key) { _sslKey = key; }
42 void setSslKey(const QByteArray &encoded);
43 inline const QSslCertificate &sslCert() const { return _sslCert; }
44 inline void setSslCert(const QSslCertificate &cert) { _sslCert = cert; }
45 void setSslCert(const QByteArray &encoded);
48 virtual void update(const QVariantMap &properties);
53 QSslCertificate _sslCert;
55 CoreCertManager *_certManager;
56 CoreSession *_coreSession;
60 // ========================================
62 // ========================================
63 class CoreCertManager : public CertManager {
67 CoreCertManager(CoreIdentity *identity);
69 inline CoreIdentity *identity() const { return _identity; }
70 virtual inline const QSslKey &sslKey() const { return identity()->sslKey(); }
71 virtual inline const QSslCertificate &sslCert() const { return identity()->sslCert(); }
74 virtual void setSslKey(const QByteArray &encoded);
75 virtual void setSslCert(const QByteArray &encoded);
77 void setId(IdentityId id);
80 CoreIdentity *_identity;
83 #endif //COREIDENTITY_H