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.

96 lines
2.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 _KSSLKEYGEN_H
  21. #define _KSSLKEYGEN_H
  22. #include <tqstring.h>
  23. #include <tqstringlist.h>
  24. #include <kwizard.h>
  25. class KOpenSSLProxy;
  26. class KGWizardPage1;
  27. class KGWizardPage2;
  28. /**
  29. * KDE Key Generation dialog
  30. *
  31. * This is used to display a key generation dialog for cases such as the
  32. * html \<keygen\> tag. It also does the certificate signing request generation.
  33. *
  34. * @author George Staikos <staikos@kde.org>
  35. * @see KSSL, KSSLCertificate, KSSLPKCS12
  36. * @short KDE Key Generation Dialog
  37. */
  38. class TDEIO_EXPORT KSSLKeyGen : public KWizard {
  39. Q_OBJECT
  40. public:
  41. /**
  42. * Construct a keygen dialog.
  43. * @param parent the parent widget
  44. * @param name the internal name of this instance
  45. * @param modal true if the dialog should be modal
  46. */
  47. KSSLKeyGen(TQWidget *parent=0L, const char *name=0L, bool modal=false);
  48. /**
  49. * Destroy this dialog.
  50. */
  51. virtual ~KSSLKeyGen();
  52. /**
  53. * List the supported key sizes.
  54. * @return the supported key sizes
  55. */
  56. static TQStringList supportedKeySizes();
  57. /**
  58. * Generate the certificate signing request.
  59. * @param name the name for the certificate
  60. * @param pass the password for the request
  61. * @param bits the bitsize for the key
  62. * @param e the value of the "e" parameter in RSA
  63. * @return 0 on success, non-zero on error
  64. */
  65. int generateCSR(const TQString& name, const TQString& pass, int bits, int e = 0x10001);
  66. /**
  67. * Set the key size.
  68. * @param idx an index into supportedKeySizes()
  69. */
  70. void setKeySize(int idx) { _idx = idx; }
  71. private slots:
  72. void slotPassChanged();
  73. void slotGenerate();
  74. private:
  75. class KSSLKeyGenPrivate;
  76. KSSLKeyGenPrivate *d;
  77. int _idx;
  78. KGWizardPage1 *page1;
  79. KGWizardPage2 *page2;
  80. };
  81. #endif