X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fsecurity%2Finclude%2Finternal%2Fpsinterface.h;h=34a78220d8848d98ea0f1dab01ea879d2eeaf7e5;hb=390866079e285d2c74918432c0d597d5da52f8a0;hp=b48c67466ab560a280a396ecdb03c8faa5020fd2;hpb=3e9402ad71cb3e93266a77796f44d17bab9853fd;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/security/include/internal/psinterface.h b/resource/csdk/security/include/internal/psinterface.h index b48c674..34a7822 100644 --- a/resource/csdk/security/include/internal/psinterface.h +++ b/resource/csdk/security/include/internal/psinterface.h @@ -21,6 +21,8 @@ #ifndef IOTVT_SRM_PSI_H #define IOTVT_SRM_PSI_H +#include "cJSON.h" + /** * Reads the Secure Virtual Database from PS into dynamically allocated * memory buffer. @@ -28,7 +30,7 @@ * @note Caller of this method MUST use OCFree() method to release memory * referenced by return value. * - * @retval reference to memory buffer containing SVR database. + * @return char * reference to memory buffer containing SVR database. */ char * GetSVRDatabase(); @@ -39,8 +41,34 @@ char * GetSVRDatabase(); * @param rsrcName string denoting the SVR name ("acl", "cred", "pstat" etc). * @param jsonObj JSON object containing the SVR contents. * - * @retval OC_STACK_OK for Success, otherwise some error value + * @return ::OC_STACK_OK for Success, otherwise some error value */ OCStackResult UpdateSVRDatabase(const char* rsrcName, cJSON* jsonObj); +/** + * Reads the Secure Virtual Database from PS + * + * @note Caller of this method MUST use OCFree() method to release memory + * referenced by return value. + * + * @param rsrcName is the name of the field for which file content are read. + if the value is NULL it will send the content of the whole file. + * @param data is the pointer to the file contents read from the database. + * @param size is the size to the file contents read. + * + * @return ::OC_STACK_OK for Success, otherwise some error value + */ +OCStackResult GetSecureVirtualDatabaseFromPS(const char *rsrcName, uint8_t **data, size_t *size); + +/** + * This method converts updates the persistent storage. + * + * @param rsrcName is the name of the secure resource that will be updated. + * @param cborPayload is the pointer holding cbor payload. + * @param cborPayload is the size of the cbor payload. + * + * @return ::OC_STACK_OK for Success, otherwise some error value + */ +OCStackResult UpdateSecureResourceInPS(const char* rsrcName, uint8_t* cborPayload, size_t size); + #endif //IOTVT_SRM_PSI_H