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.

ksslcertchain.h 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /* This file is part of the KDE project
  2. *
  3. * Copyright (C) 2001-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 _KSSLCERTCHAIN_H
  21. #define _KSSLCERTCHAIN_H
  22. #include <tqglobal.h>
  23. #include <tqptrlist.h>
  24. #include <kdemacros.h>
  25. class TQString;
  26. class TQCString;
  27. class KSSL;
  28. class KSSLCertChainPrivate;
  29. class TQStringList;
  30. #include <ksslcertificate.h>
  31. /**
  32. * KDE Certificate Chain Representation Class
  33. *
  34. * This class provides a representation for an X.509 certificate chain.
  35. *
  36. * @author George Staikos <staikos@kde.org>
  37. * @see KSSL, KSSLCertificate, KSSLPeerInfo
  38. * @short KDE X.509 Certificate Chain
  39. */
  40. class TDEIO_EXPORT KSSLCertChain {
  41. friend class KSSL;
  42. friend class KSSLPeerInfo;
  43. public:
  44. /**
  45. * Construct a KSSLCertChain object
  46. */
  47. KSSLCertChain();
  48. /**
  49. * Destroy this KSSLCertChain object
  50. */
  51. ~KSSLCertChain();
  52. /**
  53. * Determine if this represents a valid certificate chain
  54. *
  55. * @return true if it is a valid certificate chain
  56. */
  57. bool isValid();
  58. /**
  59. * Do a deep copy of the certificate chain.
  60. *
  61. * @return pointer to a new certificate chain object
  62. *
  63. * This is an expensive operation, and you are responsible for deleting
  64. * the returned object yourself.
  65. */
  66. KSSLCertChain *replicate();
  67. /**
  68. * Set the raw chain from OpenSSL
  69. * @internal
  70. */
  71. void setChain(void *stack_of_x509);
  72. /**
  73. * Set the certificate chain as a pointer list of KSSL certificates.
  74. *
  75. * @param chain the certificate chain
  76. * @see KSSLCertificate
  77. */
  78. void setChain(TQPtrList<KSSLCertificate>& chain);
  79. /**
  80. * Set the certificate chain as a list of base64 encoded X.509
  81. * certificates.
  82. *
  83. * @param chain the certificate chain
  84. * @deprecated
  85. */
  86. void setChain(TQStringList chain) KDE_DEPRECATED;
  87. /**
  88. * Set the certificate chain as a list of base64 encoded X.509
  89. * certificates.
  90. *
  91. * @param chain the certificate chain
  92. */
  93. void setCertChain(const TQStringList& chain);
  94. /**
  95. * Obtain a copy of the certificate chain.
  96. *
  97. * @return a deep copy of the certificate chain.
  98. * @see KSSLCertificate
  99. */
  100. TQPtrList<KSSLCertificate> getChain();
  101. /**
  102. * Determine the number of entries (depth) of the chain.
  103. *
  104. * @return the number of entries in the certificate chain
  105. */
  106. int depth();
  107. /**
  108. * Read the raw chain in OpenSSL format
  109. * @internal
  110. */
  111. void *rawChain() { return _chain; }
  112. private:
  113. KSSLCertChainPrivate *d;
  114. void *_chain;
  115. };
  116. #endif