#ifndef IOTVT_SRM_CRLR_H
#define IOTVT_SRM_CRLR_H
-#include "octypes.h"
-#include "securevirtualresourcetypes.h"
+#include "ocpayload.h"
#ifdef __cplusplus
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.
*
* @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
* 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
*/
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