home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / ksslutils.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.0 KB  |  78 lines

  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.  
  23. #include <kdemacros.h>
  24.  
  25. #ifdef Q_WS_WIN
  26. #include "ksslconfig_win.h"
  27. #else
  28. #include "ksslconfig.h"
  29. #endif
  30.  
  31. #include <unistd.h>
  32. #ifdef KSSL_HAVE_SSL
  33. #define crypt _openssl_crypt
  34. #include <openssl/x509.h>
  35. #undef crypt
  36. #endif
  37. class QString;
  38. class QDateTime;
  39.  
  40.  
  41. #ifdef KSSL_HAVE_SSL
  42. // This functionality is missing in OpenSSL
  43. /**
  44.  *  Convert an ASN1 UTCTIME value to a string.  Uses KLocale settings.
  45.  *
  46.  *  @param tm the OpenSSL ASN1_UTCTIME pointer
  47.  *
  48.  *  @return the date formatted in a QString
  49.  *  @see ASN1_UTCTIME_QDateTime
  50.  */
  51. KDE_EXPORT QString ASN1_UTCTIME_QString(ASN1_UTCTIME *tm);
  52.  
  53. /**
  54.  *  Convert an ASN1 UTCTIME value to a QDateTime.  Uses KLocale settings.
  55.  *
  56.  *  @param tm the OpenSSL ASN1_UTCTIME pointer
  57.  *  @param isGmt set to 1 if the date is set to GMT
  58.  *
  59.  *  @return the date formatted in a QDateTime
  60.  */
  61. KDE_EXPORT QDateTime ASN1_UTCTIME_QDateTime(ASN1_UTCTIME *tm, int *isGmt);
  62.  
  63.  
  64. /**
  65.  *  Convert an ASN1 INTEGER value to a string.
  66.  *
  67.  *  @param aint the OpenSSL ASN1_INTEGER pointer
  68.  *
  69.  *  @return the number formatted in a QString
  70.  */
  71. KDE_EXPORT QString ASN1_INTEGER_QString(ASN1_INTEGER *aint);
  72. #endif
  73.  
  74.  
  75.  
  76.  
  77. #endif
  78.