*/
OCStackResult RemoveCredential(const OicUuid_t* credId);
+/**
+ * Remove all credential data on credential resource and persistent storage
+ *
+ * @retval
+ * OC_STACK_OK - no errors
+ * OC_STACK_ERROR - stack process error
+ */
+OCStackResult RemoveAllCredentials(void);
+
#if defined(__WITH_DTLS__)
/**
* This internal callback is used by lower stack (i.e. CA layer) to
return 0;
}
+/**
+ * Get the default value
+ * @retval NULL for now. Update it when we finalize the default info.
+ */
+static OicSecCred_t* GetCredDefault()
+{
+ return NULL;
+}
/**
* This function adds the new cred to the credential list.
}
+/**
+ * Remove all credential data on credential resource and persistent storage
+ *
+ * @retval
+ * OC_STACK_OK - no errors
+ * OC_STACK_ERROR - stack process error
+ */
+OCStackResult RemoveAllCredentials(void)
+{
+ DeleteCredList(gCred);
+ gCred = GetCredDefault();
+
+ if(!UpdatePersistentStorage(gCred))
+ {
+ return OC_STACK_ERROR;
+ }
+ return OC_STACK_OK;
+}
+
static OCEntityHandlerResult HandlePostRequest(const OCEntityHandlerRequest * ehRequest)
{
OCEntityHandlerResult ret = OC_EH_ERROR;
}
/**
- * Get the default value
- * @retval NULL for now. Update it when we finalize the default info.
- */
-static OicSecCred_t* GetCredDefault()
-{
- return NULL;
-}
-
-/**
* Initialize Cred resource by loading data from persistent storage.
*
* @retval