replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / security / include / internal / credresource.h
index 32ccefe..1806540 100644 (file)
@@ -82,7 +82,7 @@ OicSecCred_t* GetCredEntryByCredId(const uint16_t credId);
 OCStackResult CredToCBORPayload(const OicSecCred_t* cred, uint8_t **cborPayload,
                                 size_t *cborSize, int secureFlag);
 
-#ifdef _ENABLE_MULTIPLE_OWNER_
+#ifdef MULTIPLE_OWNER
 /**
  * Function to check the credential access of SubOwner
  *
@@ -93,7 +93,7 @@ OCStackResult CredToCBORPayload(const OicSecCred_t* cred, uint8_t **cborPayload,
  * @return ::true for valid access, otherwise invalid access
  */
 bool IsValidCredentialAccessForSubOwner(const OicUuid_t* uuid, const uint8_t *cborPayload, size_t size);
-#endif //_ENABLE_MULTIPLE_OWNER_
+#endif //MULTIPLE_OWNER
 
 /**
  * This function generates the bin credential data.
@@ -109,7 +109,7 @@ bool IsValidCredentialAccessForSubOwner(const OicUuid_t* uuid, const uint8_t *cb
 
  */
 OicSecCred_t * GenerateCredential(const OicUuid_t* subject, OicSecCredType_t credType,
-                     const OicSecCert_t * publicData, const OicSecKey_t * privateData,
+                     const OicSecKey_t * publicData, const OicSecKey_t * privateData,
                      const OicUuid_t * rownerID, const OicUuid_t * eownerID);
 
 /**
@@ -238,6 +238,27 @@ void GetDerKey(ByteArray_t * key, const char * usage);
  * @param[in] usage credential usage string.
  */
 void InitCipherSuiteListInternal(bool *list, const char * usage);
+
+
+
+
+//Added as workaround by Chul Lee.
+OCStackResult CredSaveTrustCertChain(const OicUuid_t* subject, uint8_t *trustCertChain, size_t chainSize,
+                                            OicEncodingType_t encodingType,  const char* usage, uint16_t *credId);
+
+OCStackResult CredSaveOwnCert(const OicUuid_t* subject, OicSecKey_t* cert, OicSecKey_t * key,
+                                    const char* usage, uint16_t *credId);
+
+/**
+ * API to add preconfigured PIN for MOT
+ *
+ * @param[in] preconfPin string type of preconfigured PIN
+ *
+ * @retval ::OC_STACK_OK for Success, otherwise some error value
+ */
+OCStackResult AddPreconfPinCredential(const char* preconfPin);
+
+
 #endif // __WITH_TLS__
 #ifdef __cplusplus
 }