+ // resource name
+ char *rsrcName = NULL;
+ size_t rsrcNameLen = 0;
+ cborFindResult = cbor_value_dup_text_string(&rsrcMap, &rsrcName, &rsrcNameLen, NULL);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding Resource Data Name Tag.");
+ cborFindResult = cbor_value_advance(&rsrcMap);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding Resource Data Value.");
+
+ // rlist
+ if (0 == strcmp(OIC_JSON_RLIST_NAME, rsrcName))
+ {
+ int i = 0;
+ // TODO : Need to assign array length to OicSecAmacl_t->resources->rlistLen based of RAML spec.
+ cborFindResult = cbor_value_get_array_length(&rsrcMap, &headAmacl->resourcesLen);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding Rlist Array Len.");
+
+ CborValue rsrcArray = { .parser = NULL };
+
+ // rlist array
+ cborFindResult = cbor_value_enter_container(&rsrcMap, &rsrcArray);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Entering Rlist Array");
+
+ // TODO : Need to check data structure of OicSecAmacl_t based on RAML spec.
+ headAmacl->resources = (char **) OICCalloc(headAmacl->resourcesLen, sizeof(*headAmacl->resources));
+ VERIFY_NON_NULL(TAG, headAmacl->resources, ERROR);
+
+ while (cbor_value_is_valid(&rsrcArray))
+ {
+ // rMap
+ CborValue rMap = { .parser = NULL };
+ cborFindResult = cbor_value_enter_container(&rsrcArray, &rMap);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Entering Rlist Map");
+
+ while(cbor_value_is_valid(&rMap) && cbor_value_is_text_string(&rMap))
+ {
+ char *rMapName = NULL;
+ size_t rMapNameLen = 0;
+ cborFindResult = cbor_value_dup_text_string(&rMap, &rMapName, &rMapNameLen, NULL);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding RMap Data Name Tag.");
+ cborFindResult = cbor_value_advance(&rMap);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding RMap Data Value.");
+
+ // "href"
+ if (0 == strcmp(OIC_JSON_HREF_NAME, rMapName))
+ {
+ // TODO : Need to check data structure of OicSecAmacl_t based on RAML spec.
+ cborFindResult = cbor_value_dup_text_string(&rMap, &headAmacl->resources[i++], &len, NULL);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding Href Value.");
+ }
+
+ // "rt"
+ if (0 == strcmp(OIC_JSON_RT_NAME, rMapName))
+ {
+ // TODO : Need to check data structure of OicSecAmacl_t and assign based on RAML spec.
+ char *rtData = NULL;
+ cborFindResult = cbor_value_dup_text_string(&rMap, &rtData, &len, NULL);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding RT Value.");
+ OICFree(rtData);
+ }
+
+ // "if"
+ if (0 == strcmp(OIC_JSON_IF_NAME, rMapName))
+ {
+ // TODO : Need to check data structure of OicSecAmacl_t and assign based on RAML spec.
+ char *ifData = NULL;
+ cborFindResult = cbor_value_dup_text_string(&rMap, &ifData, &len, NULL);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding IF Value.");
+ OICFree(ifData);
+ }
+
+ if (cbor_value_is_valid(&rMap))
+ {
+ cborFindResult = cbor_value_advance(&rMap);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Advancing Rlist Map.");
+ }
+ OICFree(rMapName);
+ }
+
+ if (cbor_value_is_valid(&rsrcArray))
+ {
+ cborFindResult = cbor_value_advance(&rsrcArray);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Advancing Resource Array.");
+ }
+ }
+ }
+
+ if (cbor_value_is_valid(&rsrcMap))
+ {
+ cborFindResult = cbor_value_advance(&rsrcMap);
+ VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Advancing Resource Map.");
+ }
+ OICFree(rsrcName);