X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fsecurity%2Fprovisioning%2Finclude%2Finternal%2Fsecureresourceprovider.h;h=a66f546263ef398f3e06dfd90376f4208a44202c;hb=7f00f942c39b7bc27c7eeecf213a239c3fe4173c;hp=97b90f0774a7c6c3e332bc961e6fbe5769809655;hpb=495ebf2780c41444fe332c4af44de20c7e826b44;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/security/provisioning/include/internal/secureresourceprovider.h b/resource/csdk/security/provisioning/include/internal/secureresourceprovider.h index 97b90f0..a66f546 100644 --- a/resource/csdk/security/provisioning/include/internal/secureresourceprovider.h +++ b/resource/csdk/security/provisioning/include/internal/secureresourceprovider.h @@ -24,6 +24,8 @@ #include "ocstack.h" #include "securevirtualresourcetypes.h" #include "pmtypes.h" +#include "octypes.h" + #ifdef __cplusplus extern "C" @@ -43,6 +45,14 @@ OCStackResult SRPProvisionACL(void *ctx, const OCProvisionDev_t *selectedDeviceI OicSecAcl_t *acl, OCProvisionResultCB resultCallback); /** + * API to save ACL which has several ACE into Acl of SVR. + * + * @param acl ACL to be saved in Acl of SVR. + * @return OC_STACK_OK in case of success and other value otherwise. + */ +OCStackResult SRPSaveACL(const OicSecAcl_t *acl); + +/** * API to request CRED information to resource. * * @param[in] selectedDeviceInfo Selected target device. @@ -64,18 +74,7 @@ OCStackResult SRPGetCredResource(void *ctx, const OCProvisionDev_t *selectedDevi OCStackResult SRPGetACLResource(void *ctx, const OCProvisionDev_t *selectedDeviceInfo, OCProvisionResultCB resultCallback); -#if defined(__WITH_X509__) || defined(__WITH_TLS__) -/** - * API to send CRL information to resource. - * - * @param[in] selectedDeviceInfo Selected target device. - * @param[in] crl CRL to provision. - * @param[in] resultCallback callback provided by API user, callback will be called when - * provisioning request recieves a response from resource server. - * @return OC_STACK_OK in case of success and other value otherwise. - */ -OCStackResult SRPProvisionCRL(void *ctx, const OCProvisionDev_t *selectedDeviceInfo, - OicSecCrl_t *crl, OCProvisionResultCB resultCallback); +#if defined(__WITH_DTLS__) || defined(__WITH_TLS__) /** * function to provision Trust certificate chain to devices. @@ -112,9 +111,23 @@ OCStackResult SRPSaveTrustCertChain(uint8_t *trustCertChain, size_t chainSize, * @param[out] credId CredId of saved trust certificate chain in Cred of SVR. * @return OC_STACK_OK in case of success and other value otherwise. */ -OCStackResult SRPSaveOwnCertChain(OicSecCert_t * cert, OicSecKey_t * key, uint16_t *credId); +OCStackResult SRPSaveOwnCertChain(OicSecKey_t * cert, OicSecKey_t * key, uint16_t *credId); + +/** + * function to register callback, for getting notification for TrustCertChain change. + * + * @param[in] ctx user context to be passed. + * @param[in] TrustCertChainChangeCB notifier callback function + * @return OC_STACK_OK in case of success and other value otherwise. + */ +OCStackResult SRPRegisterTrustCertChainNotifier(void *ctx, TrustCertChainChangeCB callback); -#endif // __WITH_X509__ || __WITH_TLS__ +/** + * function to de-register TrustCertChain notification callback. + */ +void SRPRemoveTrustCertChainNotifier(void); + +#endif // __WITH_DTLS__ || __WITH_TLS__ /** * API to send Direct-Pairing Configuration to a device. * @@ -239,6 +252,16 @@ OCStackResult SRPSyncDevice(void* ctx, unsigned short waitTimeForOwnedDeviceDisc OCStackResult SRPResetDevice(const OCProvisionDev_t* pTargetDev, OCProvisionResultCB resultCallback); +/* + * Function to read Trust certificate chain from SVR. + * Caller must free when done using the returned trust certificate + * @param[in] credId CredId of trust certificate chain in SVR. + * @param[out] trustCertChain Trust certificate chain. + * @param[out] chainSize Size of trust certificate chain + * @return OC_STACK_OK in case of success and other value otherwise. + */ +OCStackResult SRPReadTrustCertChain(uint16_t credId, uint8_t **trustCertChain, + size_t *chainSize); #ifdef __cplusplus } #endif