X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fsecurity%2Fprovisioning%2Finclude%2Finternal%2Fsecureresourceprovider.h;h=fa9813d5c6ceaed5bf29ad986ff99c9c32659011;hb=94651923bf67705c1b4bd61ab251e8c598d2a807;hp=a378133b6dd93ac58f36a6f2ff9a6695c4a73712;hpb=1cee1631595cac6a6394ac2e0b365c6dd5a42c68;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 a378133..fa9813d 100644 --- a/resource/csdk/security/provisioning/include/internal/secureresourceprovider.h +++ b/resource/csdk/security/provisioning/include/internal/secureresourceprovider.h @@ -64,19 +64,58 @@ OCStackResult SRPGetCredResource(void *ctx, const OCProvisionDev_t *selectedDevi OCStackResult SRPGetACLResource(void *ctx, const OCProvisionDev_t *selectedDeviceInfo, OCProvisionResultCB resultCallback); -#ifdef __WITH_X509__ +#if defined(__WITH_DTLS__) || defined(__WITH_TLS__) + +/** + * function to provision Trust certificate chain to devices. + * + * @param[in] ctx Application context would be returned in result callback. + * @param[in] type Type of credentials to be provisioned to the device. + * @param[in] credId CredId of trust certificate chain to be provisioned to the device. + * @param[in] selectedDeviceInfo Pointer to OCProvisionDev_t instance,respresenting resource to be provsioned. + * @param[in] resultCallback callback provided by API user, callback will be called when + * provisioning request recieves a response from first resource server. + * @return OC_STACK_OK in case of success and other value otherwise. + */ +OCStackResult SRPProvisionTrustCertChain(void *ctx, OicSecCredType_t type, uint16_t credId, + const OCProvisionDev_t *selectedDeviceInfo, + OCProvisionResultCB resultCallback); + +/** + * function to save Trust certificate chain into Cred of SVR. + * + * @param[in] trustCertChain Trust certificate chain to be saved in Cred of SVR. + * @param[in] chainSize Size of trust certificate chain to be saved in Cred of SVR + * @param[in] encodingType Encoding type of trust certificate chain to be saved in Cred of SVR + * @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 SRPSaveTrustCertChain(uint8_t *trustCertChain, size_t chainSize, + OicEncodingType_t encodingType,uint16_t *credId); + /** - * API to send CRL information to resource. + * function to save own certificate chain into Cred of SVR. + * + * @param[in] cert own certificate chain to be saved in Cred of SVR. + * @param[in] key own secret key to be saved in Cred of SVR. + * @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); + +#endif // __WITH_DTLS__ || __WITH_TLS__ +/** + * API to send Direct-Pairing Configuration to a device. * * @param[in] selectedDeviceInfo Selected target device. - * @param[in] crl CRL to provision. + * @param[in] pconf PCONF pointer. * @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); -#endif // __WITH_X509__ +OCStackResult SRPProvisionDirectPairing(void *ctx, const OCProvisionDev_t *selectedDeviceInfo, + OicSecPconf_t *pconf, OCProvisionResultCB resultCallback); + /** * API to send Direct-Pairing Configuration to a device. *