TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ksslinfodlg.h 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /* This file is part of the KDE project
  2. *
  3. * Copyright (C) 2000-2003 George Staikos <staikos@kde.org>
  4. * Copyright (C) 2000 Malte Starostik <malte@kde.org>
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Library General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Library General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Library General Public License
  17. * along with this library; see the file COPYING.LIB. If not, write to
  18. * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  19. * Boston, MA 02110-1301, USA.
  20. */
  21. #ifndef _KSSLINFODLG_H
  22. #define _KSSLINFODLG_H
  23. #include <kdialog.h>
  24. #include "ksslx509map.h"
  25. #include "ksslcertificate.h"
  26. #include "kssl.h"
  27. #include <tqscrollview.h>
  28. class TQWidget;
  29. class KSSLCertBox;
  30. class KSSLCertChain;
  31. /**
  32. * KDE SSL Information Dialog
  33. *
  34. * This class creates a dialog that can be used to display information about
  35. * an SSL session.
  36. *
  37. * There are NO GUARANTEES that KSSLInfoDlg will remain binary compatible/
  38. * Contact staikos@kde.org for details if needed.
  39. *
  40. * @author George Staikos <staikos@kde.org>
  41. * @see KSSL
  42. * @short KDE SSL Information Dialog
  43. */
  44. class TDEIO_EXPORT KSSLInfoDlg : public KDialog {
  45. Q_OBJECT
  46. public:
  47. /**
  48. * Construct a KSSL Information Dialog
  49. *
  50. * @param secureConnection true if the connection is secured with SSL
  51. * @param parent the parent widget
  52. * @param name the internal name of this instance
  53. * @param modal true if the dialog should be modal
  54. */
  55. KSSLInfoDlg(bool secureConnection, TQWidget *parent=0L, const char *name=0L, bool modal=false);
  56. /**
  57. * Destroy this dialog
  58. */
  59. virtual ~KSSLInfoDlg();
  60. /**
  61. * Tell the dialog if the connection has portions that may not be
  62. * secure (ie. a mixture of secure and insecure frames)
  63. *
  64. * @param isIt true if security is in question
  65. */
  66. void setSecurityInQuestion(bool isIt);
  67. /**
  68. * Setup the dialog before showing it.
  69. *
  70. * @param cert the certificate presented by the site
  71. * @param ip the ip of the remote host
  72. * @param url the url being accessed
  73. * @param cipher the cipher in use
  74. * @param cipherdesc text description of the cipher in use
  75. * @param sslversion the version of SSL in use (SSLv2, SSLv3, TLSv1, etc)
  76. * @param usedbits the number of bits in the cipher key being used
  77. * @param bits the bit-size of the cipher in use
  78. * @param certState the certificate state (valid, invalid, etc)
  79. */
  80. void setup(KSSLCertificate *cert,
  81. const TQString& ip, const TQString& url,
  82. const TQString& cipher, const TQString& cipherdesc,
  83. const TQString& sslversion, int usedbits, int bits,
  84. KSSLCertificate::KSSLValidation certState);
  85. /**
  86. * Setup the dialog before showing it. This is a convenience version
  87. * of the above method, and obtains the same information using the
  88. * @param ssl parameter instead.
  89. *
  90. * @param ssl the ssl connection
  91. * @param ip the ip of the remote host
  92. * @param url the url being accessed
  93. */
  94. void setup( KSSL & ssl, const TQString & ip, const TQString & url );
  95. /**
  96. * Set the errors that were encountered while validating the site
  97. * certificate.
  98. */
  99. void setCertState(const TQString &errorNrs);
  100. /**
  101. * Utility function to generate the widget which displays the detailed
  102. * information about an X.509 certificate.
  103. *
  104. * @param parent the parent widget
  105. * @param certName the name (subject) of the certificate
  106. * @param mailCatcher the class which catches click events on e-mail
  107. * addresses
  108. */
  109. static KSSLCertBox *certInfoWidget(TQWidget *parent, const TQString &certName, TQWidget *mailCatcher=0);
  110. private:
  111. TQScrollView *buildCertInfo(const TQString &certName);
  112. void displayCert(KSSLCertificate *x);
  113. class KSSLInfoDlgPrivate;
  114. KSSLInfoDlgPrivate *d;
  115. private slots:
  116. void launchConfig();
  117. void urlClicked(const TQString &url);
  118. void mailClicked(const TQString &url);
  119. void slotChain(int x);
  120. };
  121. /**
  122. * KDE SSL Certificate Box
  123. *
  124. * This class creates a widget which formats and displays the contents of an
  125. * SSL X.509 certificate. That is, it takes the "subject" of the certificate
  126. * and displays everything contained therein.
  127. *
  128. * @author George Staikos <staikos@kde.org>
  129. * @see KSSLInfoDlg
  130. * @short KDE SSL Certificate Box
  131. */
  132. class TDEIO_EXPORT KSSLCertBox : public TQScrollView {
  133. public:
  134. /**
  135. * Construct a certificate box
  136. *
  137. * @param parent the parent widget
  138. * @param name the internal name of this instance
  139. * @param f widget flags for the object
  140. */
  141. KSSLCertBox(TQWidget *parent=0L, const char *name=0L, WFlags f=0);
  142. /**
  143. * Change the contents of the widget
  144. *
  145. * @param certName the name ("subject") of the certificate
  146. * @param mailCatcher the widget which catches the url open events
  147. */
  148. void setValues(TQString certName, TQWidget *mailCatcher=0L);
  149. private:
  150. TQFrame *_frame;
  151. };
  152. #endif