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.

ksslpeerinfo.h 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 _KSSLPEERINFO_H
  21. #define _KSSLPEERINFO_H
  22. class KSSL;
  23. #include <tqglobal.h>
  24. #include <tqstringlist.h>
  25. #include <ksslcertificate.h>
  26. class KSSLPeerInfoPrivate;
  27. class KInetSocketAddress;
  28. /**
  29. * KDE SSL Peer Data
  30. *
  31. * This class contains data about the peer of an SSL connection.
  32. *
  33. * @author George Staikos <staikos@kde.org>
  34. * @see KSSL
  35. * @short KDE SSL Peer Data
  36. */
  37. class TDEIO_EXPORT KSSLPeerInfo {
  38. friend class KSSL;
  39. public:
  40. /**
  41. * Destroy this instance
  42. */
  43. ~KSSLPeerInfo();
  44. /**
  45. * Get a reference to the peer's certificate
  46. *
  47. * @return a reference to the peer's certificate
  48. * @see KSSLCertificate
  49. */
  50. KSSLCertificate& getPeerCertificate();
  51. /**
  52. * Determine if the peer's certificate matches the address set with
  53. * setPeerHost(). Note that this is a match in the "https"
  54. * sense, taking into account, for instance, wildcards.
  55. *
  56. * @return true if it matches
  57. * @see setPeerHost
  58. */
  59. bool certMatchesAddress();
  60. /**
  61. * Determine if the given "common name" matches the address set with
  62. * setPeerHost(). Note that this is a match in the "https"
  63. * sense, taking into account, for instance, wildcards.
  64. *
  65. * @return true if it matches
  66. * @see setPeerHost
  67. */
  68. bool cnMatchesAddress(TQString cn);
  69. /**
  70. * Set the host that we are connected to. This is generally set by
  71. * KSSL, and should be exactly what the user -thinks- he is connected
  72. * to. (for instance, the host name in the url)
  73. *
  74. * @param host the hostname
  75. */
  76. void setPeerHost(TQString host = TQString::null);
  77. /**
  78. * Returns the host we are connected to.
  79. */
  80. const TQString& peerHost() const;
  81. /**
  82. * Clear out the host name.
  83. */
  84. void reset();
  85. protected:
  86. KSSLPeerInfo();
  87. KSSLCertificate m_cert;
  88. private:
  89. KSSLPeerInfoPrivate *d;
  90. };
  91. #endif