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
*/
DRMProcessor(DRMProcessorClient* client, const std::string& deviceFile, const std::string& activationFile, const std::string& deviceKeyFile);
~DRMProcessor();
/**
@ -71,14 +71,14 @@ namespace gourou
*
* @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.
* During this operation, DRM information is added into downloaded file
*
* @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
*
* @return Type of downloaded item
@ -87,7 +87,7 @@ namespace gourou
/**
* @brief SignIn into ACS Server (required to activate device)
*
*
* @param adobeID AdobeID username
* @param adobePassword Adobe password
*/
@ -109,9 +109,9 @@ namespace gourou
/**
* @brief Return default ADEPT directory (ie /home/<user>/.config/adept)
*/
*/
static std::string getDefaultAdeptDir(void);
/**
* @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
*/
ByteArray sendRequest(const pugi::xml_document& document, const std::string& url);
/**
* @brief In place encrypt data with private device key
*/
@ -183,7 +183,7 @@ namespace gourou
* @brief Export clear private license key into path
*/
void exportPrivateLicenseKey(std::string path);
/**
* @brief Get current user
*/
@ -198,7 +198,7 @@ namespace gourou
* @brief Get current client
*/
DRMProcessorClient* getClient() { return client; }
/**
* @brief Remove ADEPT DRM
* Warning: for PDF format, filenameIn must be different than filenameOut
@ -210,14 +210,14 @@ namespace gourou
* @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);
private:
gourou::DRMProcessorClient* client;
gourou::Device* device;
gourou::User* user;
DRMProcessor(DRMProcessorClient* client);
void pushString(void* sha_ctx, const std::string& string);
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);
@ -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 fetchLicenseServiceCertificate(const std::string& licenseURL,
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_document& fulfillReply);
std::string encryptedKeyFirstPass(pugi::xml_document& rightsDoc, const std::string& encryptedKey, const std::string& keyType);