00001 #ifndef SST_RSA_H
00002 #define SST_RSA_H
00003
00004 #include <openssl/rsa.h>
00005
00006 #include "sign.h"
00007
00008 namespace SST {
00009
00010 class RSAKey : public SignKey
00011 {
00012 RSA *rsa;
00013
00014 RSAKey(RSA *rsa);
00015
00016 public:
00017 RSAKey(const QByteArray &key);
00018 RSAKey(int bits = 0, unsigned e = 65537);
00019 ~RSAKey();
00020
00021 QByteArray id() const;
00022 QByteArray key(bool getPrivateKey = false) const;
00023
00024 SecureHash *newHash(QObject *parent = NULL) const;
00025
00026 QByteArray sign(const QByteArray &digest) const;
00027 bool verify(const QByteArray &digest, const QByteArray &sig) const;
00028
00029 private:
00030 void dump() const;
00031 };
00032
00033 }
00034
00035 #endif // SST_RSA_H