diff options
Diffstat (limited to 'kopete/protocols/jabber/libiris/qca/src/qca.h')
-rw-r--r-- | kopete/protocols/jabber/libiris/qca/src/qca.h | 150 |
1 files changed, 75 insertions, 75 deletions
diff --git a/kopete/protocols/jabber/libiris/qca/src/qca.h b/kopete/protocols/jabber/libiris/qca/src/qca.h index 1a52a826..46b25cc9 100644 --- a/kopete/protocols/jabber/libiris/qca/src/qca.h +++ b/kopete/protocols/jabber/libiris/qca/src/qca.h @@ -21,12 +21,12 @@ #ifndef QCA_H #define QCA_H -#include<qstring.h> -#include<qcstring.h> -#include<qdatetime.h> -#include<qmap.h> -#include<qptrlist.h> -#include<qobject.h> +#include<tqstring.h> +#include<tqcstring.h> +#include<tqdatetime.h> +#include<tqmap.h> +#include<tqptrlist.h> +#include<tqobject.h> #ifdef Q_OS_WIN32 # ifndef QCA_STATIC @@ -91,8 +91,8 @@ namespace QCA QCA_EXPORT void insertProvider(QCAProvider *); QCA_EXPORT void unloadAllPlugins(); - QCA_EXPORT QString arrayToHex(const QByteArray &); - QCA_EXPORT QByteArray hexToArray(const QString &); + QCA_EXPORT TQString arrayToHex(const TQByteArray &); + QCA_EXPORT TQByteArray hexToArray(const TQString &); class QCA_EXPORT Hash { @@ -102,8 +102,8 @@ namespace QCA ~Hash(); void clear(); - void update(const QByteArray &a); - QByteArray final(); + void update(const TQByteArray &a); + TQByteArray final(); protected: Hash(QCA_HashContext *); @@ -119,26 +119,26 @@ namespace QCA public: HashStatic<T>() {} - static QByteArray hash(const QByteArray &a) + static TQByteArray hash(const TQByteArray &a) { T obj; obj.update(a); return obj.final(); } - static QByteArray hash(const QCString &cs) + static TQByteArray hash(const TQCString &cs) { - QByteArray a(cs.length()); + TQByteArray a(cs.length()); memcpy(a.data(), cs.data(), a.size()); return hash(a); } - static QString hashToString(const QByteArray &a) + static TQString hashToString(const TQByteArray &a) { return arrayToHex(hash(a)); } - static QString hashToString(const QCString &cs) + static TQString hashToString(const TQCString &cs) { return arrayToHex(hash(cs)); } @@ -151,14 +151,14 @@ namespace QCA Cipher & operator=(const Cipher &); ~Cipher(); - QByteArray dyn_generateKey(int size=-1) const; - QByteArray dyn_generateIV() const; - void reset(int dir, int mode, const QByteArray &key, const QByteArray &iv, bool pad=true); - bool update(const QByteArray &a); - QByteArray final(bool *ok=0); + TQByteArray dyn_generateKey(int size=-1) const; + TQByteArray dyn_generateIV() const; + void reset(int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad=true); + bool update(const TQByteArray &a); + TQByteArray final(bool *ok=0); protected: - Cipher(QCA_CipherContext *, int dir, int mode, const QByteArray &key, const QByteArray &iv, bool pad); + Cipher(QCA_CipherContext *, int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad); private: class Private; @@ -171,13 +171,13 @@ namespace QCA public: CipherStatic<T>() {} - static QByteArray generateKey(int size=-1) + static TQByteArray generateKey(int size=-1) { T obj; return obj.dyn_generateKey(size); } - static QByteArray generateIV() + static TQByteArray generateIV() { T obj; return obj.dyn_generateIV(); @@ -205,25 +205,25 @@ namespace QCA class QCA_EXPORT BlowFish : public Cipher, public CipherStatic<BlowFish> { public: - BlowFish(int dir=Encrypt, int mode=CBC, const QByteArray &key=QByteArray(), const QByteArray &iv=QByteArray(), bool pad=true); + BlowFish(int dir=Encrypt, int mode=CBC, const TQByteArray &key=TQByteArray(), const TQByteArray &iv=TQByteArray(), bool pad=true); }; class QCA_EXPORT TripleDES : public Cipher, public CipherStatic<TripleDES> { public: - TripleDES(int dir=Encrypt, int mode=CBC, const QByteArray &key=QByteArray(), const QByteArray &iv=QByteArray(), bool pad=true); + TripleDES(int dir=Encrypt, int mode=CBC, const TQByteArray &key=TQByteArray(), const TQByteArray &iv=TQByteArray(), bool pad=true); }; class QCA_EXPORT AES128 : public Cipher, public CipherStatic<AES128> { public: - AES128(int dir=Encrypt, int mode=CBC, const QByteArray &key=QByteArray(), const QByteArray &iv=QByteArray(), bool pad=true); + AES128(int dir=Encrypt, int mode=CBC, const TQByteArray &key=TQByteArray(), const TQByteArray &iv=TQByteArray(), bool pad=true); }; class QCA_EXPORT AES256 : public Cipher, public CipherStatic<AES256> { public: - AES256(int dir=Encrypt, int mode=CBC, const QByteArray &key=QByteArray(), const QByteArray &iv=QByteArray(), bool pad=true); + AES256(int dir=Encrypt, int mode=CBC, const TQByteArray &key=TQByteArray(), const TQByteArray &iv=TQByteArray(), bool pad=true); }; class RSA; @@ -239,11 +239,11 @@ namespace QCA bool havePublic() const; bool havePrivate() const; - QByteArray toDER(bool publicOnly=false) const; - bool fromDER(const QByteArray &a); + TQByteArray toDER(bool publicOnly=false) const; + bool fromDER(const TQByteArray &a); - QString toPEM(bool publicOnly=false) const; - bool fromPEM(const QString &); + TQString toPEM(bool publicOnly=false) const; + bool fromPEM(const TQString &); // only call if you know what you are doing bool fromNative(void *); @@ -254,8 +254,8 @@ namespace QCA friend class RSA; friend class TLS; - bool encrypt(const QByteArray &a, QByteArray *out, bool oaep) const; - bool decrypt(const QByteArray &a, QByteArray *out, bool oaep) const; + bool encrypt(const TQByteArray &a, TQByteArray *out, bool oaep) const; + bool decrypt(const TQByteArray &a, TQByteArray *out, bool oaep) const; bool generate(unsigned int bits); }; @@ -268,8 +268,8 @@ namespace QCA RSAKey key() const; void setKey(const RSAKey &); - bool encrypt(const QByteArray &a, QByteArray *out, bool oaep=false) const; - bool decrypt(const QByteArray &a, QByteArray *out, bool oaep=false) const; + bool encrypt(const TQByteArray &a, TQByteArray *out, bool oaep=false) const; + bool decrypt(const TQByteArray &a, TQByteArray *out, bool oaep=false) const; static RSAKey generateKey(unsigned int bits); @@ -277,7 +277,7 @@ namespace QCA RSAKey v_key; }; - typedef QMap<QString, QString> CertProperties; + typedef TQMap<TQString, TQString> CertProperties; class QCA_EXPORT Cert { public: @@ -288,20 +288,20 @@ namespace QCA bool isNull() const; - QString commonName() const; - QString serialNumber() const; - QString subjectString() const; - QString issuerString() const; + TQString commonName() const; + TQString serialNumber() const; + TQString subjectString() const; + TQString issuerString() const; CertProperties subject() const; CertProperties issuer() const; - QDateTime notBefore() const; - QDateTime notAfter() const; + TQDateTime notBefore() const; + TQDateTime notAfter() const; - QByteArray toDER() const; - bool fromDER(const QByteArray &a); + TQByteArray toDER() const; + bool fromDER(const TQByteArray &a); - QString toPEM() const; - bool fromPEM(const QString &); + TQString toPEM() const; + bool fromPEM(const TQString &); private: class Private; @@ -332,26 +332,26 @@ namespace QCA }; enum Error { ErrHandshake, ErrCrypt }; - TLS(QObject *parent=0); + TLS(TQObject *parent=0); ~TLS(); void setCertificate(const Cert &cert, const RSAKey &key); - void setCertificateStore(const QPtrList<Cert> &store); // note: store must persist + void setCertificateStore(const TQPtrList<Cert> &store); // note: store must persist void reset(); - bool startClient(const QString &host=""); + bool startClient(const TQString &host=""); bool startServer(); void close(); bool isHandshaken() const; // plain (application side) - void write(const QByteArray &a); - QByteArray read(); + void write(const TQByteArray &a); + TQByteArray read(); // encoded (socket side) - void writeIncoming(const QByteArray &a); - QByteArray readOutgoing(); - QByteArray readUnprocessed(); + void writeIncoming(const TQByteArray &a); + TQByteArray readOutgoing(); + TQByteArray readUnprocessed(); // cert related const Cert & peerCertificate() const; @@ -390,10 +390,10 @@ namespace QCA NoUser, RemoteUnavail }; - SASL(QObject *parent=0); + SASL(TQObject *parent=0); ~SASL(); - static void setAppName(const QString &name); + static void setAppName(const TQString &name); void reset(); int errorCondition() const; @@ -409,40 +409,40 @@ namespace QCA void setMinimumSSF(int); void setMaximumSSF(int); - void setExternalAuthID(const QString &authid); + void setExternalAuthID(const TQString &authid); void setExternalSSF(int); - void setLocalAddr(const QHostAddress &addr, Q_UINT16 port); - void setRemoteAddr(const QHostAddress &addr, Q_UINT16 port); + void setLocalAddr(const TQHostAddress &addr, Q_UINT16 port); + void setRemoteAddr(const TQHostAddress &addr, Q_UINT16 port); // initialize - bool startClient(const QString &service, const QString &host, const QStringList &mechlist, bool allowClientSendFirst=true); - bool startServer(const QString &service, const QString &host, const QString &realm, QStringList *mechlist); + bool startClient(const TQString &service, const TQString &host, const TQStringList &mechlist, bool allowClientSendFirst=true); + bool startServer(const TQString &service, const TQString &host, const TQString &realm, TQStringList *mechlist); // authentication - void putStep(const QByteArray &stepData); - void putServerFirstStep(const QString &mech); - void putServerFirstStep(const QString &mech, const QByteArray &clientInit); - void setUsername(const QString &user); - void setAuthzid(const QString &auth); - void setPassword(const QString &pass); - void setRealm(const QString &realm); + void putStep(const TQByteArray &stepData); + void putServerFirstStep(const TQString &mech); + void putServerFirstStep(const TQString &mech, const TQByteArray &clientInit); + void setUsername(const TQString &user); + void setAuthzid(const TQString &auth); + void setPassword(const TQString &pass); + void setRealm(const TQString &realm); void continueAfterParams(); void continueAfterAuthCheck(); // security layer int ssf() const; - void write(const QByteArray &a); - QByteArray read(); - void writeIncoming(const QByteArray &a); - QByteArray readOutgoing(); + void write(const TQByteArray &a); + TQByteArray read(); + void writeIncoming(const TQByteArray &a); + TQByteArray readOutgoing(); signals: // for authentication - void clientFirstStep(const QString &mech, const QByteArray *clientInit); - void nextStep(const QByteArray &stepData); + void clientFirstStep(const TQString &mech, const TQByteArray *clientInit); + void nextStep(const TQByteArray &stepData); void needParams(bool user, bool authzid, bool pass, bool realm); - void authCheck(const QString &user, const QString &authzid); + void authCheck(const TQString &user, const TQString &authzid); void authenticated(); // for security layer |