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.

129 lines
4.0 KiB

  1. ==================================================
  2. ==================================================
  3. ==
  4. == Proposed new APIs
  5. ==
  6. ==================================================
  7. ==================================================
  8. //
  9. // GenerateNewLicenseEx
  10. //
  11. // Description:
  12. // Creates a license and stores it in the local license store.
  13. //
  14. // Parameters:
  15. // dwFlags - One of the GNL_EX_MODE_* flags - those flags cannot be combined.
  16. // pbAppSec - App Security level. Len = APPSEC_LEN.
  17. // pbRights � Rights for this license. Len = RIGHTS_LEN.
  18. // pbExpiryDate � Expiration data. Len = DATE_LEN.
  19. // ppsz64KeyID - Base64-encoded KeyID to use for the license. Must be NULL for PDRM
  20. // and RANDOM modes. If using RANDOM mode, a random KeyID will be generated
  21. // and a pointer to that buffer will be returned.
  22. // ppsz64EncryptKey � Base64-encoded Content Key. Must be NULL for PDRM and RANDOM modes.
  23. // If using RANDOM mode, a random Content Key will be generated and a
  24. // pointer to that buffer will be returned.
  25. //
  26. HRESULT CDRMLite::GenerateNewLicenseEx
  27. (
  28. [in] DWORD dwFlags, // Flags
  29. [in] BYTE *pbAppSec, // Min app security level required to access license
  30. [in] BYTE *pbRights, // Rights for this license
  31. [in] BYTE *pbExpiryDate, // Expiration date for this license
  32. [in,out] LPSTR *ppsz64KeyID, // KeyID (base64)
  33. [in,out] LPSTR *ppsz64EncryptKey // ContentKey (base64)
  34. );
  35. //
  36. // dwFlags can be one of the following values
  37. //
  38. #define GNL_EX_MODE_PDRM 0x00000001 // Use PDRM method to form KID/Key
  39. #define GNL_EX_MODE_RANDOM 0x00000002 // generate random KID/Key
  40. #define GNL_EX_MODE_SPECIFIC 0x00000004 // generate license for specific KID/Key
  41. //
  42. // EncryptIndirectEx
  43. //
  44. // Searches the license store for a license corresponding to pszKeyID.
  45. // If found, the data in the pbData buffer is encrypted with the
  46. // content key from that license.
  47. //
  48. // This API is exactly the same as EncryptIndirect, except that the data buffer
  49. // is not MAC�ed as part of the secure authenticated channel.
  50. //
  51. HRESULT CDRMLite::EncryptIndirectEx
  52. (
  53. [in] LPSTR psz64KeyID, // KeyID of license to obtain content key from (base64)
  54. [in] DWORD cbData, // Number of bytes to encrypt from the pbData buffer
  55. [in,out] BYTE *pbData // Data buffer to encrypt
  56. );
  57. ==================================================
  58. ==================================================
  59. ==
  60. == Scenarios enabled
  61. ==
  62. ==================================================
  63. ==================================================
  64. For all scenarios, the following parameters to GenerateNewLicenseEx can be any valid values:
  65. pbAppSec
  66. pbRights
  67. pbExpiryDate
  68. 1- Standard PDRM license functionality
  69. GenerateNewLicenseEx
  70. dwFlags = GNL_EX_MODE_PDRM
  71. ppsz64KeyID = NULL Buffer
  72. ppsz64EncryptKey = NULL Buffer
  73. 2- Random key license generation
  74. GenerateNewLicenseEx
  75. dwFlags = GNL_EX_MODE_RANDOM
  76. ppsz64KeyID = NULL Buffer
  77. ppsz64EncryptKey = NULL Buffer
  78. 3- Specific key license generation
  79. GenerateNewLicenseEx
  80. dwFlags = GNL_EX_MODE_SPECIFIC
  81. ppsz64KeyID = < Specific KeyID >
  82. ppsz64EncryptKey = < Specific Key >
  83. 4- Encrypt using an existing license
  84. EncryptIndirectEx
  85. psz64KeyID = KeyID of license to use
  86. 5- Generate new random license, and Encrypt with new license
  87. GenerateNewLicenseEx
  88. dwFlags = GNL_EX_MODE_RANDOM
  89. ppsz64KeyID = NULL Buffer
  90. ppsz64EncryptKey = NULL Buffer
  91. EncryptFast
  92. psz64EncryptKey = *ppsz64EncryptKey
  93. cbData = < Size of pbData buffer >
  94. pbData = < Data to encrypt >
  95. 6- Appending to already-protected content
  96. EncryptIndirectEx
  97. psz64KeyID = < KeyID from content >
  98. cbData = < Size of pbData buffer >
  99. pbData = < Data to encrypt >