This commit is contained in:
Gregory Soutade 2024-01-23 16:28:45 +01:00
parent e05639c09d
commit 89b721a153

View File

@ -60,7 +60,7 @@ namespace gourou
* @param deviceKeyFile Path of devicesalt * @param deviceKeyFile Path of devicesalt
*/ */
DRMProcessor(DRMProcessorClient* client, const std::string& deviceFile, const std::string& activationFile, const std::string& deviceKeyFile); DRMProcessor(DRMProcessorClient* client, const std::string& deviceFile, const std::string& activationFile, const std::string& deviceKeyFile);
~DRMProcessor(); ~DRMProcessor();
/** /**
@ -71,14 +71,14 @@ namespace gourou
* *
* @return a FulfillmentItem if all is OK * @return a FulfillmentItem if all is OK
*/ */
FulfillmentItem* fulfill(const std::string& ACSMFile, bool notify=true); FulfillmentItem* fulfill(const std::string& ACSMFile, bool notify=true);;
/** /**
* @brief Once fulfilled, ePub file needs to be downloaded. * @brief Once fulfilled, ePub file needs to be downloaded.
* During this operation, DRM information is added into downloaded file * During this operation, DRM information is added into downloaded file
* *
* @param item Item from fulfill() method * @param item Item from fulfill() method
* @param path Output file path * @param path Output file path
* @param resume false if target file should be truncated, true to try resume download * @param resume false if target file should be truncated, true to try resume download
* *
* @return Type of downloaded item * @return Type of downloaded item
@ -87,7 +87,7 @@ namespace gourou
/** /**
* @brief SignIn into ACS Server (required to activate device) * @brief SignIn into ACS Server (required to activate device)
* *
* @param adobeID AdobeID username * @param adobeID AdobeID username
* @param adobePassword Adobe password * @param adobePassword Adobe password
*/ */
@ -109,9 +109,9 @@ namespace gourou
/** /**
* @brief Return default ADEPT directory (ie /home/<user>/.config/adept) * @brief Return default ADEPT directory (ie /home/<user>/.config/adept)
*/ */
static std::string getDefaultAdeptDir(void); static std::string getDefaultAdeptDir(void);
/** /**
* @brief Create a new ADEPT environment (device.xml, devicesalt and activation.xml). * @brief Create a new ADEPT environment (device.xml, devicesalt and activation.xml).
* *
@ -158,7 +158,7 @@ namespace gourou
* @brief Send HTTP POST request to URL with document as POSTData * @brief Send HTTP POST request to URL with document as POSTData
*/ */
ByteArray sendRequest(const pugi::xml_document& document, const std::string& url); ByteArray sendRequest(const pugi::xml_document& document, const std::string& url);
/** /**
* @brief In place encrypt data with private device key * @brief In place encrypt data with private device key
*/ */
@ -183,7 +183,7 @@ namespace gourou
* @brief Export clear private license key into path * @brief Export clear private license key into path
*/ */
void exportPrivateLicenseKey(std::string path); void exportPrivateLicenseKey(std::string path);
/** /**
* @brief Get current user * @brief Get current user
*/ */
@ -198,7 +198,7 @@ namespace gourou
* @brief Get current client * @brief Get current client
*/ */
DRMProcessorClient* getClient() { return client; } DRMProcessorClient* getClient() { return client; }
/** /**
* @brief Remove ADEPT DRM * @brief Remove ADEPT DRM
* Warning: for PDF format, filenameIn must be different than filenameOut * Warning: for PDF format, filenameIn must be different than filenameOut
@ -210,14 +210,14 @@ namespace gourou
* @param encryptionKeySize Size of encryption key (if provided) * @param encryptionKeySize Size of encryption key (if provided)
*/ */
void removeDRM(const std::string& filenameIn, const std::string& filenameOut, ITEM_TYPE type, const unsigned char* encryptionKey=0, unsigned encryptionKeySize=0); void removeDRM(const std::string& filenameIn, const std::string& filenameOut, ITEM_TYPE type, const unsigned char* encryptionKey=0, unsigned encryptionKeySize=0);
private: private:
gourou::DRMProcessorClient* client; gourou::DRMProcessorClient* client;
gourou::Device* device; gourou::Device* device;
gourou::User* user; gourou::User* user;
DRMProcessor(DRMProcessorClient* client); DRMProcessor(DRMProcessorClient* client);
void pushString(void* sha_ctx, const std::string& string); void pushString(void* sha_ctx, const std::string& string);
void pushTag(void* sha_ctx, uint8_t tag); void pushTag(void* sha_ctx, uint8_t tag);
void hashNode(const pugi::xml_node& root, void *sha_ctx, std::map<std::string,std::string> nsHash); void hashNode(const pugi::xml_node& root, void *sha_ctx, std::map<std::string,std::string> nsHash);
@ -235,7 +235,7 @@ namespace gourou
void buildSignInRequest(pugi::xml_document& signInRequest, const std::string& adobeID, const std::string& adobePassword, const std::string& authenticationCertificate); void buildSignInRequest(pugi::xml_document& signInRequest, const std::string& adobeID, const std::string& adobePassword, const std::string& authenticationCertificate);
void fetchLicenseServiceCertificate(const std::string& licenseURL, void fetchLicenseServiceCertificate(const std::string& licenseURL,
const std::string& operatorURL); const std::string& operatorURL);
void buildNotifyReq(pugi::xml_document& returnReq, pugi::xml_node& body); void buildNotifyReq(pugi::xml_document& returnReq, pugi::xml_node& body);
void notifyServer(pugi::xml_node& notifyRoot); void notifyServer(pugi::xml_node& notifyRoot);
void notifyServer(pugi::xml_document& fulfillReply); void notifyServer(pugi::xml_document& fulfillReply);
std::string encryptedKeyFirstPass(pugi::xml_document& rightsDoc, const std::string& encryptedKey, const std::string& keyType); std::string encryptedKeyFirstPass(pugi::xml_document& rightsDoc, const std::string& encryptedKey, const std::string& keyType);