Source code of Windows XP (NT5)
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.

90 lines
2.7 KiB

  1. // MsKeyBlob.h -- MicroSoft Key Blob abstract base class header
  2. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  3. // 1999. This computer program includes Confidential, Proprietary
  4. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  5. // use, disclosure, and/or reproduction is prohibited unless authorized
  6. // in writing. All Rights Reserved.
  7. #if !defined(SLBCSP_MSKEYBLOB_H)
  8. #define SLBCSP_MSKEYBLOB_H
  9. #include <stddef.h>
  10. #include <wincrypt.h>
  11. #include <scuArrayP.h>
  12. #include "AlignedBlob.h"
  13. class MsKeyBlob
  14. {
  15. public:
  16. // Types
  17. typedef BYTE KeyBlobType;
  18. typedef BLOBHEADER HeaderElementType;
  19. typedef HeaderElementType ValueType;
  20. typedef size_t SizeType; // in KeyBlobType units
  21. // C'tors/D'tors
  22. // Operators
  23. // Operations
  24. // Access
  25. ALG_ID
  26. AlgId() const;
  27. AlignedBlob
  28. AsAlignedBlob() const;
  29. ValueType const *
  30. Data() const;
  31. SizeType
  32. Length() const;
  33. // Predicates
  34. protected:
  35. // Types
  36. typedef BYTE BlobElemType;
  37. // C'tors/D'tors
  38. MsKeyBlob(KeyBlobType kbt,
  39. ALG_ID ai,
  40. SizeType cReserve);
  41. MsKeyBlob(BYTE const *pbData,
  42. DWORD dwDataLength);
  43. virtual ~MsKeyBlob();
  44. // Operators
  45. // Operations
  46. void
  47. Append(Blob::value_type const *pvt,
  48. Blob::size_type cLength);
  49. // Access
  50. // Predicates
  51. // Variables
  52. private:
  53. // Types
  54. // C'tors/D'tors
  55. // Operators
  56. // Operations
  57. static scu::AutoArrayPtr<BlobElemType>
  58. AllocBlob(SizeType cInitialMaxLength);
  59. void
  60. Setup(SizeType cMaxLength);
  61. // Access
  62. // Predicates
  63. // Variables
  64. scu::AutoArrayPtr<BlobElemType> m_aapBlob;
  65. SizeType m_cLength;
  66. SizeType m_cMaxSize;
  67. };
  68. #endif // SLBCSP_MSKEYBLOB_H