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.

140 lines
3.5KB

  1. /* This file is part of the KDE project
  2. *
  3. * Copyright (C) 2001 George Staikos <staikos@kde.org>
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Library General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library 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 GNU
  13. * Library General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Library General Public License
  16. * along with this library; see the file COPYING.LIB. If not, write to
  17. * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18. * Boston, MA 02110-1301, USA.
  19. */
  20. #ifndef _INCLUDE_TDECERTPART_H
  21. #define _INCLUDE_TDECERTPART_H
  22. #ifdef HAVE_CONFIG_H
  23. #include <config.h>
  24. #endif
  25. #include <tdeparts/part.h>
  26. #include <tqptrlist.h>
  27. #include <tqlistview.h>
  28. #include <tdelistview.h>
  29. class KSSLCertBox;
  30. class TQFrame;
  31. class TQLabel;
  32. class KCertPartPrivate;
  33. class KComboBox;
  34. class TQButton;
  35. class KSSLSigners;
  36. class KSSLPKCS12;
  37. class KSSLCertificate;
  38. class TQTabWidget;
  39. class TQMultiLineEdit;
  40. class TDEAboutData;
  41. class TQGridLayout;
  42. class KX509Item : public TDEListViewItem {
  43. public:
  44. KX509Item(TDEListViewItem *parent, KSSLCertificate *x);
  45. KX509Item(TDEListView *parent, KSSLCertificate *x);
  46. void setup(KSSLCertificate *x);
  47. ~KX509Item();
  48. virtual int rtti() const { return 1; }
  49. KSSLCertificate *cert;
  50. TQString _prettyName;
  51. };
  52. class KPKCS12Item : public TDEListViewItem {
  53. public:
  54. KPKCS12Item(TDEListViewItem *parent, KSSLPKCS12 *x);
  55. ~KPKCS12Item();
  56. KSSLPKCS12 *cert;
  57. TQString _prettyName;
  58. };
  59. class KCertPart : public KParts::ReadWritePart {
  60. Q_OBJECT
  61. public:
  62. KCertPart(TQWidget *parentWidget, const char *widgetName,
  63. TQObject *parent = 0L, const char *name = 0L,
  64. const TQStringList &args = TQStringList() );
  65. virtual ~KCertPart();
  66. virtual void setReadWrite(bool readwrite);
  67. static TDEAboutData *createAboutData();
  68. protected slots:
  69. void slotChain(int c);
  70. void slotImport();
  71. void slotSave();
  72. void slotDone();
  73. void slotLaunch();
  74. void slotSelectionChanged(TQListViewItem *x);
  75. void slotImportAll();
  76. protected:
  77. virtual bool openFile();
  78. virtual bool saveFile();
  79. void displayPKCS12Cert(KSSLCertificate *c);
  80. void displayCACert(KSSLCertificate *c);
  81. TDEListView *_sideList;
  82. TDEListViewItem *_parentCA, *_parentP12;
  83. TQFrame *_pkcsFrame, *_blankFrame, *_x509Frame, *_frame;
  84. // for the PKCS12 widget
  85. TQLabel *_p12_filenameLabel, *_p12_validFrom, *_p12_validUntil,
  86. *_p12_serialNum, *_p12_certState;
  87. TQLabel *_p12_digest;
  88. KComboBox *_p12_chain;
  89. TQMultiLineEdit *_p12_pubkey, *_p12_sig;
  90. KSSLCertBox *_p12_subject, *_p12_issuer;
  91. // for the CA widget
  92. TQLabel *_ca_filenameLabel, *_ca_validFrom, *_ca_validUntil,
  93. *_ca_serialNum, *_ca_certState;
  94. TQLabel *_ca_digest;
  95. TQMultiLineEdit *_ca_pubkey, *_ca_sig;
  96. KSSLCertBox *_ca_subject, *_ca_issuer;
  97. // The rest
  98. TDEInstance *_instance;
  99. TQButton *_import, *_save, *_done, *_launch, *_importAll;
  100. // Store the pointer to the current item
  101. KSSLPKCS12 *_p12;
  102. KSSLCertificate *_ca;
  103. TQTabWidget *_tabs;
  104. TQGridLayout *_baseGrid;
  105. KSSLSigners *_signers;
  106. bool _silentImport;
  107. TQString _curName;
  108. private:
  109. KCertPartPrivate *d;
  110. void displayPKCS12();
  111. };
  112. #endif