MagicSmoke  $VERSION$
keygen.h
Go to the documentation of this file.
1 //
2 // C++ Interface: keygen
3 //
4 // Description:
5 //
6 //
7 // Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2007-2011
8 //
9 // Copyright: See README/COPYING.GPL files that come with this distribution
10 //
11 //
12 
13 #ifndef MAGICSMOKE_KEYGEN_H
14 #define MAGICSMOKE_KEYGEN_H
15 
16 #include <QDialog>
17 #include <QByteArray>
18 
19 class QLabel;
20 class QPushButton;
21 
22 #include "commonexport.h"
23 
24 class MAGICSMOKE_COMMON_EXPORT MKeyGen:public QDialog
25 {
26  Q_OBJECT
27  public:
28  MKeyGen(QWidget*parent=0);
29  ~MKeyGen();
30 
31  QString getKey(int len=40);
32 
33  private:
34  QLabel*randlab;
35  int randstat;
36 
37  QPushButton *okbtn,*ccbtn;
38 
39  private slots:
40  void updateProps();
41 };
42 
43 class MAGICSMOKE_COMMON_EXPORT EFilter:public QObject
44 {
45  Q_OBJECT
46  public:
47  EFilter();
48  ~EFilter();
49 
50  static EFilter*instance();
51 
52  int entropy();
53  QByteArray getRandom(int);
54  signals:
55  void moreBits();
56  protected:
57  bool eventFilter(QObject*,QEvent*);
58  private:
59  QByteArray randbuf,randlast;
60  int randent,randctr;
61  void addBit(int);
62 };
63 
64 //shortcut:
65 MAGICSMOKE_COMMON_EXPORT QByteArray getRandom(int);
67 
68 #endif
#define MAGICSMOKE_COMMON_EXPORT
Definition: commonexport.h:7
Definition: keygen.h:24
Definition: keygen.h:43
MAGICSMOKE_COMMON_EXPORT QByteArray getRandom(int)
Definition: keygen.cpp:225
MAGICSMOKE_COMMON_EXPORT int getEntropy()
Definition: keygen.cpp:231