Leaked source code of windows server 2003
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.

67 lines
1.9 KiB

  1. // pkiBEROctet.h - Interface to BEROctet class
  2. //
  3. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  4. // 1999. This computer program includes Confidential, Proprietary
  5. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  6. // use, disclosure, and/or reproduction is prohibited unless authorized
  7. // in writing. All Rights Reserved.
  8. /////////////////////////////////////////////////////////////////////////////////
  9. #ifndef SLBPKI_BEROCTET_H
  10. #define SLBPKI_BEROCTET_H
  11. #if defined(WIN32)
  12. #pragma warning(disable : 4786) // Suppress VC++ warnings
  13. #endif
  14. #include <string>
  15. #include <vector>
  16. #include "pkiExc.h"
  17. namespace pki {
  18. class BEROctet
  19. {
  20. public:
  21. BEROctet();
  22. BEROctet(const BEROctet &oct);
  23. BEROctet(const unsigned char *buffer, const unsigned long length);
  24. ~BEROctet();
  25. BEROctet& operator=(const BEROctet &oct);
  26. unsigned char *Octet() const;
  27. unsigned long OctetSize() const;
  28. bool Constructed() const;
  29. unsigned long Class() const;
  30. unsigned long Tag() const;
  31. unsigned char *Data() const;
  32. unsigned long DataSize() const;
  33. std::vector<BEROctet*> SubOctetList() const;
  34. std::string ObjectID() const;
  35. void SearchOID(std::string const &OID, std::vector<BEROctet const*> &result) const;
  36. void SearchOIDNext(std::string const &OID, std::vector<BEROctet const*> &result) const;
  37. private:
  38. void Decode();
  39. unsigned char *m_Octet; // Full octet buffer
  40. unsigned long m_OctetSize; // Size of octet buffer
  41. unsigned long m_Class;
  42. unsigned long m_PrimConst;
  43. unsigned long m_Tag;
  44. unsigned char *m_Data; // Start of data part of octet
  45. unsigned long m_DataSize; // Size of data part of octet as decoded from data.
  46. std::vector<BEROctet*> m_SubOctetList;
  47. };
  48. } // namespace pki
  49. #endif // SLBPKI_BEROCTET_H