X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fsecurity%2Finclude%2Finternal%2Fcrlresource.h;h=349c41bad0e4c82d774189dd362e0add1d503115;hb=c315c87e07c4080ecd0ef488e7a1047bc3c509b2;hp=3e98f8cc13de311b680a9cc6b7250bf427edc4e2;hpb=a214f7d5b1f3c97e4ba731577e7297f14c5ef8b9;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/security/include/internal/crlresource.h b/resource/csdk/security/include/internal/crlresource.h index 3e98f8c..349c41b 100644 --- a/resource/csdk/security/include/internal/crlresource.h +++ b/resource/csdk/security/include/internal/crlresource.h @@ -21,8 +21,7 @@ #ifndef IOTVT_SRM_CRLR_H #define IOTVT_SRM_CRLR_H -#include "octypes.h" -#include "securevirtualresourcetypes.h" +#include "ocpayload.h" #ifdef __cplusplus extern "C" { @@ -35,7 +34,7 @@ extern "C" { * * @return ::OC_STACK_OK for Success, otherwise some error value. */ -OCStackResult UpdateCRLResource(const OicSecCrl_t *crl); +OCStackResult UpdateCRLResource(OicSecCrl_t *crl); /** * This function get encoded with base64 CRL from SRM. @@ -51,7 +50,7 @@ uint8_t* GetCrl(); * * @return encoded CRL with DER format. array len is 0 if error occured (e.g. CRL did not set). */ -void GetDerCrl(ByteArray* crlArray); +void GetDerCrl(ByteArray_t* crlArray); /** * This function converts CRL to CBOR @@ -60,12 +59,14 @@ void GetDerCrl(ByteArray* crlArray); * will be allocated by the function and content of *crl will be ignored. * @param payload is the converted cbor value. * @param size is a pointer to length of the CRL buffer. Should be not NULL. + * @param lastUpdate optional field contains CRL last update time * * @note Caller responsible for crl buffer memory (use OICFree to free it). * * @return ::OC_STACK_OK if success, otherwise some error value. */ -OCStackResult CrlToCBORPayload(const OicSecCrl_t *crl, uint8_t **payload, size_t *size); +OCStackResult CrlToCBORPayload(const OicSecCrl_t *crl, uint8_t **payload, size_t *size, + char *lastUpdate); /** * This function converts CBOR to CRL @@ -102,6 +103,30 @@ OCStackResult DeInitCRLResource(); */ OicSecCrl_t *GetCRLResource(); +/** + * This function frees resources inside given OicSecCrl_t object + * + * @param crl crl object + */ +void DeleteCrl(OicSecCrl_t *crl); + +/** + * This function gets time when CRL was last updated in database + * Function allocates memory for lastUpdate and + * Caller is responsible to free that memory + * + * @param lastUpdate pointer to last update string. + * @return ::OC_STACK_OK for Success, otherwise some error value. + */ +OCStackResult getLastUpdateFromDB(char **lastUpdate); + +/** + * This function prints OicSecCrl_t object + * + * @param crl crl object + */ +void printCrl(const OicSecCrl_t *crl); + #ifdef __cplusplus } #endif