X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fsecurity%2Finclude%2Finternal%2Fcredresource.h;h=ae092dfcc70f3d7e1d9600166c09dea4f1a9473d;hb=17c68b2fd1e74586f85e552eeab4e32dc121f8a0;hp=9ae31bdc1b2c98530e876593a6f2c91a09204925;hpb=8c01dff2c5bc5496f7dc1632c498943ec6ecb015;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/security/include/internal/credresource.h b/resource/csdk/security/include/internal/credresource.h index 9ae31bd..ae092df 100644 --- a/resource/csdk/security/include/internal/credresource.h +++ b/resource/csdk/security/include/internal/credresource.h @@ -21,8 +21,9 @@ #ifndef IOTVT_SRM_CREDR_H #define IOTVT_SRM_CREDR_H -#include "ocsecurityconfig.h" #include "cainterface.h" +#include "securevirtualresourcetypes.h" +#include "octypes.h" #ifdef __cplusplus extern "C" { @@ -100,22 +101,64 @@ OicSecCred_t * GenerateCredential(const OicUuid_t* subject, OicSecCredType_t cre */ OCStackResult AddCredential(OicSecCred_t * cred); +/** + * Function to remove the credential from SVR DB. + * + * @param credId Credential ID to be deleted. + * + * @return OC_STACK_OK for success and errorcode otherwise. + */ +OCStackResult RemoveCredential(const OicUuid_t* credId); + #if defined(__WITH_DTLS__) /** * This internal callback is used by lower stack (i.e. CA layer) to * retrieve PSK credentials from RI security layer. * - * Note: When finished, caller should initialize memory to zeroes and - * invoke OCFree to delete @p credInfo. + * @param[in] type type of PSK data required by CA layer during DTLS handshake. + * @param[in] desc Additional request information. + * @param[in] desc_len The actual length of desc. + * @param[out] result Must be filled with the requested information. + * @param[in] result_length Maximum size of @p result. * - * @param credInfo - * binary blob containing PSK credentials + * @return The number of bytes written to @p result or a value + * less than zero on error. + */ +int32_t GetDtlsPskCredentials( CADtlsPskCredType_t type, + const unsigned char *desc, size_t desc_len, + unsigned char *result, size_t result_length); + +/** + * Add temporal PSK to PIN based OxM * - * @retval none + * @param[in] tmpSubject UUID of target device + * @param[in] credType Type of credential to be added + * @param[in] pin numeric characters + * @param[in] pinSize length of 'pin' + * @param[in] ownersLen Number of owners + * @param[in] owners Array of owners + * @param[out] tmpCredSubject Generated credential's subject. + * + * @return OC_STACK_OK for success and errorcode otherwise. */ -void GetDtlsPskCredentials(CADtlsPskCredsBlob_t **credInfo); +OCStackResult AddTmpPskWithPIN(const OicUuid_t* tmpSubject, OicSecCredType_t credType, + const char * pin, size_t pinSize, + size_t ownersLen, const OicUuid_t * owners, OicUuid_t* tmpCredSubject); + #endif /* __WITH_DTLS__ */ +#ifdef __WITH_X509__ +/** + * This function is used toretrieve certificate credentials from RI security layer. + * + * @param credInfo + * binary structure containing certificate credentials + * + * @retval 0 on scuccess + */ +int GetDtlsX509Credentials(CADtlsX509Creds_t *credInfo); +#endif /*__WITH_X509__*/ + /** * Function to deallocate allocated memory to OicSecCred_t *