dbsecurity.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //
  2. //////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Copyright 2015 Autodesk, Inc. All rights reserved.
  5. //
  6. // Use of this software is subject to the terms of the Autodesk license
  7. // agreement provided at the time of installation or download, or which
  8. // otherwise accompanies this software in either electronic or hard copy form.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11. //
  12. // DESCRIPTION: DWG Security - Parameters for encryption/decryption
  13. // and digital signatures
  14. //
  15. #ifndef __DBSECURITY_H_
  16. #define __DBSECURITY_H_
  17. class AcDbDate;
  18. enum
  19. {
  20. SECURITYPARAMS_ENCRYPT_DATA = 0x00000001,
  21. SECURITYPARAMS_ENCRYPT_PROPS = 0x00000002,
  22. SECURITYPARAMS_SIGN_DATA = 0x00000010,
  23. SECURITYPARAMS_ADD_TIMESTAMP = 0x00000020
  24. };
  25. enum
  26. {
  27. SECURITYPARAMS_ALGID_RC4 = 0x00006801
  28. };
  29. struct SecurityParams
  30. {
  31. unsigned long cbSize;
  32. unsigned long ulFlags; // see enum above for flag values
  33. // data relevant to password protection
  34. wchar_t* wszPassword;
  35. unsigned long ulProvType;
  36. wchar_t* wszProvName;
  37. unsigned long ulAlgId; // SECURITYPARAMS_ALGID_RC4
  38. unsigned long ulKeyLength;
  39. // data relevant to digital signatures
  40. wchar_t* wszCertSubject;
  41. wchar_t* wszCertIssuer;
  42. wchar_t* wszCertSerialNum;
  43. wchar_t* wszComment;
  44. wchar_t* wszTimeServer;
  45. };
  46. //////////////////////////////////////////////////////////////////////////////
  47. // //
  48. // The following struct is for internal use only. //
  49. // //
  50. //////////////////////////////////////////////////////////////////////////////
  51. struct SignatureInfo
  52. {
  53. unsigned long cbSize;
  54. unsigned long ulFlags;
  55. wchar_t* wszCertSubject;
  56. wchar_t* wszCertIssuer;
  57. wchar_t* wszSubjectEMail;
  58. wchar_t* wszCertSerialNum;
  59. wchar_t* wszX500;
  60. AcDbDate* pTimeCertNotBefore;
  61. AcDbDate* pTimeCertNotAfter;
  62. wchar_t* wszComment;
  63. wchar_t* wszTimeServer;
  64. AcDbDate* pTimestamp;
  65. };
  66. #endif // __DBSECURITY_H_