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.

ksslutils.h 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* This file is part of the KDE project
  2. *
  3. * Copyright (C) 2000-2003 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_KSSLUTILS_H
  21. #define _INCLUDE_KSSLUTILS_H
  22. #include <kdemacros.h>
  23. #ifdef Q_WS_WIN
  24. #include "ksslconfig_win.h"
  25. #else
  26. #include "ksslconfig.h"
  27. #endif
  28. #include <unistd.h>
  29. #ifdef KSSL_HAVE_SSL
  30. #define crypt _openssl_crypt
  31. #include <openssl/x509.h>
  32. #undef crypt
  33. #endif
  34. class TQString;
  35. class TQDateTime;
  36. #ifdef KSSL_HAVE_SSL
  37. // This functionality is missing in OpenSSL
  38. /**
  39. * Convert an ASN1 UTCTIME value to a string. Uses TDELocale settings.
  40. *
  41. * @param tm the OpenSSL ASN1_UTCTIME pointer
  42. *
  43. * @return the date formatted in a QString
  44. * @see ASN1_UTCTIME_QDateTime
  45. */
  46. KDE_EXPORT TQString ASN1_UTCTIME_QString(ASN1_UTCTIME *tm);
  47. /**
  48. * Convert an ASN1 UTCTIME value to a TQDateTime. Uses TDELocale settings.
  49. *
  50. * @param tm the OpenSSL ASN1_UTCTIME pointer
  51. * @param isGmt set to 1 if the date is set to GMT
  52. *
  53. * @return the date formatted in a QDateTime
  54. */
  55. KDE_EXPORT TQDateTime ASN1_UTCTIME_QDateTime(ASN1_UTCTIME *tm, int *isGmt);
  56. /**
  57. * Convert an ASN1 INTEGER value to a string.
  58. *
  59. * @param aint the OpenSSL ASN1_INTEGER pointer
  60. *
  61. * @return the number formatted in a QString
  62. */
  63. KDE_EXPORT TQString ASN1_INTEGER_QString(ASN1_INTEGER *aint);
  64. #endif
  65. #endif