Name: wrt-plugins-tizen
Summary: JavaScript plugins for WebRuntime
-Version: 0.4.29
+Version: 0.4.30
Release: 0
Group: Development/Libraries
License: Apache License, Version 2.0
} else {
JSObjectRef jsException = NULL;
if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::SecurityException) {
- jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "Permission denied error");
+ jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::SECURITY_ERROR, "Permission denied error");
} else {
jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::UNKNOWN_ERROR, "Unknown error");
}
} else {
JSObjectRef jsException = NULL;
if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::SecurityException) {
- jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "Permission denied error");
+ jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::SECURITY_ERROR, "Permission denied error");
} else {
jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::UNKNOWN_ERROR, "Unknown error");
}
} else {
JSObjectRef jsException = NULL;
if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::SecurityException) {
- jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "Permission denied error");
+ jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::SECURITY_ERROR, "Permission denied error");
} else {
jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::UNKNOWN_ERROR, "Unknown error");
}
break; \
case AceSecurityStatus::AccessDenied: \
return JSWebAPIErrorFactory::postException(context, exception, \
- JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR); \
+ JSWebAPIErrorFactory::SECURITY_ERROR); \
break; \
default: \
break; \
return JSValueMakeNull(context); \
case AceSecurityStatus::AccessDenied: \
cbm->callOnError(JSWebAPIErrorFactory::makeErrorObject(context, \
- JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "PERMISSION_DENIED_ERROR")); \
+ JSWebAPIErrorFactory::SECURITY_ERROR, "Security Error")); \
return JSValueMakeNull(context); \
default: \
break; \
err[0] = converter.toJSValueRef(reqid);
err[1] = JSWebAPIErrorFactory::makeErrorObject(globalContext,
- JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, errorMsg);
+ JSWebAPIErrorFactory::SECURITY_ERROR, errorMsg);
break;
case ExceptionCodes::UnsupportedException:
}
if ((AM_READ != mode) && (PERM_READ == privateObject->getObject()->getNode()->getPermissions())) {
- return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "Permission denied error");
+ return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::SECURITY_ERROR, "Permission denied error");
}
std::string path = privateObject->getObject()->getNode()->getPath()->getFullPath();
}
if ((privateObject->getObject()->getNode()->getPermissions() & PERM_WRITE) == 0) {
- return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "Permission denied error");
+ return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::SECURITY_ERROR, "Permission denied error");
}
Converter converter(context);
cbm->setObject(thisObject);
if ((privateObject->getObject()->getNode()->getPermissions() & PERM_WRITE) == 0) {
- return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "Permission denied error");
+ return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::SECURITY_ERROR, "Permission denied error");
}
if (privateObject->getObject()->getNode()->getType() != NT_DIRECTORY) {
if ((privateObject->getObject()->getNode()->getPermissions() & PERM_WRITE) == 0) {
- return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "Permission denied error");
+ return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::SECURITY_ERROR, "Permission denied error");
}
JSValueRef onSuccess = NULL;
}
if (permissions & PERM_WRITE && virtualPath == "wgt-package") {
- return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "permission denied");
+ return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::SECURITY_ERROR, "permission denied");
}
PermissionsAccessInfo perms(permissions, virtualPath);
} else {
JSObjectRef jsException = NULL;
if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::SecurityException) {
- jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "Permission denied error");
+ jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::SECURITY_ERROR, "Permission denied error");
} else {
jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::IO_ERROR, "IO error");
}
} else {
JSObjectRef jsException = NULL;
if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::SecurityException) {
- jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "Permission denied error");
+ jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::SECURITY_ERROR, "Permission denied error");
}
else if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::NotFoundException) {
jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::NOT_FOUND_ERROR, "NotFoundError");
} else {
JSObjectRef jsException = NULL;
if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::SecurityException) {
- jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "Permission denied error");
+ jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::SECURITY_ERROR, "Permission denied error");
}
else if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::NotFoundException) {
jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::NOT_FOUND_ERROR, "NotFoundError");
} else {
JSObjectRef jsException = NULL;
if (event->getExceptionCode() ==WrtDeviceApis::Commons::ExceptionCodes::SecurityException) {
- jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "Permission denied error");
+ jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::SECURITY_ERROR, "Permission denied error");
}
else if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::NotFoundException) {
jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::NOT_FOUND_ERROR, "NotFoundError");
} else {
JSObjectRef jsException = NULL;
if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::SecurityException) {
- jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "Permission denied error");
+ jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::SECURITY_ERROR, "Permission denied error");
}
else if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::NotFoundException) {
jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::NOT_FOUND_ERROR, "NotFoundError");
} else {
JSObjectRef jsException = NULL;
if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::SecurityException) {
- jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "Permission denied error");
+ jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::SECURITY_ERROR, "Permission denied error");
}
else if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::NotFoundException) {
jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::NOT_FOUND_ERROR, "Not found error");
} else {
JSObjectRef jsException = NULL;
if (event->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::SecurityException) {
- jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "Permission denied error");
+ jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::SECURITY_ERROR, "Permission denied error");
} else {
jsException = JSWebAPIErrorFactory::makeErrorObject(data->getContext(), JSWebAPIErrorFactory::IO_ERROR, "IO error");
}
case SCARD_ERROR_ILLEGAL_PARAM:
return DeviceAPI::Common::JSWebAPIErrorFactory::INVALID_VALUES_ERROR;
case SCARD_ERROR_SECURITY_NOT_ALLOWED:
- return DeviceAPI::Common::JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR;
+ return DeviceAPI::Common::JSWebAPIErrorFactory::SECURITY_ERROR;
case SCARD_ERROR_IO_FAILED:
return DeviceAPI::Common::JSWebAPIErrorFactory::NOT_FOUND_ERROR;
}
+++ /dev/null
-SET(TARGET_NAME ${securestorage_target})
-SET(DESTINATION_NAME ${securestorage_dest})
-
-PKG_CHECK_MODULES(platform_pkgs_securestorage REQUIRED secure-storage)
-
-INCLUDE_DIRECTORIES(
- ${platform_pkgs_securestorage_INCLUDE_DIRS}
-)
-
-SET(SRCS
- plugin_initializer.cpp
- plugin_config.cpp
- SecureStorageManager.cpp
- JSSecureStorageManager.cpp
-)
-
-ADD_LIBRARY(${TARGET_NAME} SHARED ${SRCS})
-
-TARGET_LINK_LIBRARIES(${TARGET_NAME}
- ${LIBS_COMMON}
- ${platform_pkgs_securestorage_LIBRARIES}
-)
-
-INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION ${DESTINATION_NAME})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/config.xml DESTINATION ${DESTINATION_NAME})
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <CommonsJavaScript/Converter.h>
-#include <CommonsJavaScript/Validator.h>
-#include <CommonsJavaScript/JSUtils.h>
-#include <CommonsJavaScript/JSCallbackManager.h>
-#include <CommonsJavaScript/Utils.h>
-#include <SecurityExceptions.h>
-#include <JSWebAPIErrorFactory.h>
-#include "JSSecureStorageManager.h"
-#include "plugin_config.h"
-
-using namespace std;
-using namespace DPL;
-using namespace WrtDeviceApis;
-using namespace WrtDeviceApis::CommonsJavaScript;
-using namespace DeviceAPI::Common;
-
-namespace TizenApis {
-namespace Tizen1_0 {
-
-JSClassDefinition JSSecureStorageManager::m_classInfo =
-{
- 0,
- kJSClassAttributeNone,
- "SecureStorageManager",
- NULL,
- NULL,
- m_function,
- initialize,
- finalize,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- hasInstance,
- NULL
-};
-
-
-JSStaticFunction JSSecureStorageManager::m_function[] =
-{
- { "remove", JSSecureStorageManager::remove, kJSPropertyAttributeNone },
- { "set", JSSecureStorageManager::set, kJSPropertyAttributeNone },
- { "get", JSSecureStorageManager::get, kJSPropertyAttributeNone },
- { "listKeys", JSSecureStorageManager::listKeys, kJSPropertyAttributeNone },
- { "removeAll", JSSecureStorageManager::removeAll, kJSPropertyAttributeNone },
- { 0, 0, 0 }
-};
-
-
-const JSClassRef JSSecureStorageManager::getClassRef()
-{
- if (!m_jsClassRef) {
- m_jsClassRef = JSClassCreate(&m_classInfo);
- }
- return m_jsClassRef;
-}
-
-const JSClassDefinition* JSSecureStorageManager::getClassInfo()
-{
- return &m_classInfo;
-}
-
-JSClassRef JSSecureStorageManager::m_jsClassRef = JSClassCreate(JSSecureStorageManager::getClassInfo());
-
-void JSSecureStorageManager::initialize(JSContextRef context, JSObjectRef object)
-{
- LoggerD("JSSecureStorageManager::initialize ");
- JSSecureStorageManagerPriv* priv = static_cast<JSSecureStorageManagerPriv*>(JSObjectGetPrivate(object));
-
- if (priv == NULL)
- {
- SecureStorageManagerPtr secureStorage(new SecureStorageManager());
- priv = new JSSecureStorageManagerPriv( context, secureStorage);
- if(!JSObjectSetPrivate(object, static_cast<void*>(priv)))
- {
- LoggerE("Object can't store private data.");
- delete priv;
- }
- }
- else
- {
- LoggerD("JSSecureStorageManager::already exist ");
- }
-}
-
-void JSSecureStorageManager::finalize(JSObjectRef object)
-{
- JSSecureStorageManagerPriv* priv = static_cast<JSSecureStorageManagerPriv*>(JSObjectGetPrivate(object));
-
- LoggerD("JSSecureStorageManager::Finalrize");
-
- if (priv != NULL)
- {
- JSObjectSetPrivate(object, NULL);
- delete priv;
- }
-}
-
-bool JSSecureStorageManager::hasInstance(JSContextRef context, JSObjectRef constructor,
- JSValueRef possibleInstance, JSValueRef* exception)
-{
- return JSValueIsObjectOfClass(context, possibleInstance, getClassRef());
-}
-
-
-JSValueRef JSSecureStorageManager::listKeys(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
- JSValueRef* exception)
-{
- JSSecureStorageManagerPriv* priv = static_cast<JSSecureStorageManagerPriv*>(JSObjectGetPrivate(thisObject));
-
- try
- {
- if (priv == NULL)
- {
- LoggerE("priv null");
- Throw(WrtDeviceApis::Commons::ConversionException);
- }
-
-
- // to do : need to update TizenPolicy.xml
- // AceSecurityStatus status = SECURE_STORAGE_CHECK_ACCESS(SECURE_STORAGE_FUNC_READ);
- // TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
-
- SecureStorageManagerPtr secureStorage(priv->getObject());
- Converter converter(priv->getContext());
- std::vector<std::string> keys = secureStorage->listKeys();
- return converter.toJSValueRef(keys);
- }
- catch (const WrtDeviceApis::Commons::Exception& ex)
- {
- LoggerD("Error message" << ex.GetMessage());
- switch(ex.getCode())
- {
- case WrtDeviceApis::Commons::ExceptionCodes::NotFoundException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::NOT_FOUND_ERROR, "not found error");
- case WrtDeviceApis::Commons::ExceptionCodes::InvalidArgumentException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::INVALID_VALUES_ERROR, "invalid parameter error");
- case WrtDeviceApis::Commons::ExceptionCodes::ConversionException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, "type mismatch error");
- case WrtDeviceApis::Commons::ExceptionCodes::SecurityException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "permission denied error");
- case WrtDeviceApis::Commons::ExceptionCodes::Exception:
- default:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::UNKNOWN_ERROR, "Unkown error");
- }
- }
- return JSValueMakeUndefined(context);
-
-}
-
-
-JSValueRef JSSecureStorageManager::set(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
- JSValueRef* exception)
-{
- JSSecureStorageManagerPriv* priv = static_cast<JSSecureStorageManagerPriv*>(JSObjectGetPrivate(thisObject));
- JSValueRef reserveArguments[2];
- size_t index = 0;
-
-
- try
- {
- if (priv == NULL)
- {
- LoggerE("priv null");
-
- Throw(WrtDeviceApis::Commons::ConversionException);
- }
-
- // to do : need to update TizenPolicy.xml
- // AceSecurityStatus status = SECURE_STORAGE_CHECK_ACCESS(SECURE_STORAGE_FUNC_WRITE);
- // TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
-
-
- for (index = 0; index < 2; index++)
- {
- if (index < argumentCount)
- reserveArguments[index] = arguments[index];
- else
- reserveArguments[index] = JSValueMakeUndefined(context);
- }
-
- SecureStorageManagerPtr secureStorage(priv->getObject());
- Converter converter(priv->getContext());
- std::string key = converter.toString(reserveArguments[0]);
- std::string value = converter.toString(reserveArguments[1]);
- secureStorage->set(key, value);
-
- }
- catch (const WrtDeviceApis::Commons::Exception& ex)
- {
- LoggerD("Error message" << ex.GetMessage());
- switch(ex.getCode())
- {
- case WrtDeviceApis::Commons::ExceptionCodes::NotFoundException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::NOT_FOUND_ERROR, "not found error");
- case WrtDeviceApis::Commons::ExceptionCodes::InvalidArgumentException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::INVALID_VALUES_ERROR, "invalid parameter error");
- case WrtDeviceApis::Commons::ExceptionCodes::ConversionException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, "type mismatch error");
- case WrtDeviceApis::Commons::ExceptionCodes::SecurityException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "permission denied error");
- case WrtDeviceApis::Commons::ExceptionCodes::Exception:
- default:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::UNKNOWN_ERROR, "Unkown error");
- }
- }
- return JSValueMakeUndefined(context);
-}
-
-JSValueRef JSSecureStorageManager::get(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
- JSValueRef* exception)
-{
- JSSecureStorageManagerPriv* priv = static_cast<JSSecureStorageManagerPriv*>(JSObjectGetPrivate(thisObject));
- JSValueRef reserveArguments;
-
- try
- {
- if (priv == NULL)
- {
- LoggerE("priv null");
- Throw(WrtDeviceApis::Commons::ConversionException);
- }
-
- // to do : need to update TizenPolicy.xml
- // AceSecurityStatus status = SECURE_STORAGE_CHECK_ACCESS(SECURE_STORAGE_FUNC_READ);
- // TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
-
- if (argumentCount > 0)
- reserveArguments = arguments[0];
- else
- reserveArguments = JSValueMakeUndefined(context);
-
- SecureStorageManagerPtr secureStorage(priv->getObject());
- Converter converter(priv->getContext());
- std::string key = converter.toString(reserveArguments);
- std::string value = secureStorage->get(key);
- return converter.toJSValueRef(value);
- }
- catch (const WrtDeviceApis::Commons::Exception& ex)
- {
- LoggerD("Error message" << ex.GetMessage());
- switch(ex.getCode())
- {
- case WrtDeviceApis::Commons::ExceptionCodes::NotFoundException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::NOT_FOUND_ERROR, "not found error");
- case WrtDeviceApis::Commons::ExceptionCodes::InvalidArgumentException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::INVALID_VALUES_ERROR, "invalid parameter error");
- case WrtDeviceApis::Commons::ExceptionCodes::ConversionException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, "type mismatch error");
- case WrtDeviceApis::Commons::ExceptionCodes::SecurityException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "permission denied error");
- case WrtDeviceApis::Commons::ExceptionCodes::Exception:
- default:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::UNKNOWN_ERROR, "Unkown error");
- }
- }
- return JSValueMakeUndefined(context);
-
-}
-
-JSValueRef JSSecureStorageManager::remove(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
- JSValueRef* exception)
-{
- JSSecureStorageManagerPriv* priv = static_cast<JSSecureStorageManagerPriv*>(JSObjectGetPrivate(thisObject));
- JSValueRef reserveArguments;
-
- try
- {
- if (priv == NULL)
- {
- LoggerE("priv null");
- Throw(WrtDeviceApis::Commons::ConversionException);
- }
-
- // to do : need to update TizenPolicy.xml
- // AceSecurityStatus status = SECURE_STORAGE_CHECK_ACCESS(SECURE_STORAGE_FUNC_WRITE);
- // TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
-
- if (argumentCount > 0)
- reserveArguments = arguments[0];
- else
- reserveArguments = JSValueMakeUndefined(context);
-
- SecureStorageManagerPtr secureStorage(priv->getObject());
- Converter converter(priv->getContext());
- std::string key = converter.toString(reserveArguments);
- secureStorage->remove(key);
- }
- catch (const WrtDeviceApis::Commons::Exception& ex)
- {
- LoggerD("Error message" << ex.GetMessage());
- switch(ex.getCode())
- {
- case WrtDeviceApis::Commons::ExceptionCodes::NotFoundException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::NOT_FOUND_ERROR, "not found error");
- case WrtDeviceApis::Commons::ExceptionCodes::InvalidArgumentException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::INVALID_VALUES_ERROR, "invalid parameter error");
- case WrtDeviceApis::Commons::ExceptionCodes::ConversionException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, "type mismatch error");
- case WrtDeviceApis::Commons::ExceptionCodes::SecurityException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "permission denied error");
- case WrtDeviceApis::Commons::ExceptionCodes::Exception:
- default:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::UNKNOWN_ERROR, "Unkown error");
- }
- }
- return JSValueMakeUndefined(context);
-
-}
-
-JSValueRef JSSecureStorageManager::removeAll(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
- JSValueRef* exception)
-{
- JSSecureStorageManagerPriv* priv = static_cast<JSSecureStorageManagerPriv*>(JSObjectGetPrivate(thisObject));
-
- try
- {
- if (priv == NULL)
- {
- LoggerE("priv null");
- Throw(WrtDeviceApis::Commons::ConversionException);
- }
-
- // to do : need to update TizenPolicy.xml
- // AceSecurityStatus status = SECURE_STORAGE_CHECK_ACCESS(SECURE_STORAGE_FUNC_WRITE);
- // TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
-
- SecureStorageManagerPtr secureStorage(priv->getObject());
- Converter converter(priv->getContext());
- secureStorage->removeAll();
-
- }
- catch (const WrtDeviceApis::Commons::Exception& ex)
- {
- LoggerD("Error message" << ex.GetMessage());
- switch(ex.getCode())
- {
- case WrtDeviceApis::Commons::ExceptionCodes::NotFoundException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::NOT_FOUND_ERROR, "not found error");
- case WrtDeviceApis::Commons::ExceptionCodes::InvalidArgumentException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::INVALID_VALUES_ERROR, "invalid parameter error");
- case WrtDeviceApis::Commons::ExceptionCodes::ConversionException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::TYPE_MISMATCH_ERROR, "type mismatch error");
- case WrtDeviceApis::Commons::ExceptionCodes::SecurityException:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::PERMISSION_DENIED_ERROR, "permission denied error");
- case WrtDeviceApis::Commons::ExceptionCodes::Exception:
- default:
- return JSWebAPIErrorFactory::postException(context, exception,
- JSWebAPIErrorFactory::UNKNOWN_ERROR, "Unkown error");
- }
- }
- return JSValueMakeUndefined(context);
-
-}
-
-}
-}
-
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef TIZENAPIS_TIZEN_JS_SECURE_STORAGE_MANAGER_H_
-#define TIZENAPIS_TIZEN_JS_SECURE_STORAGE_MANAGER_H_
-
-#include <JavaScriptCore/JavaScript.h>
-#include "SecureStorageManager.h"
-#include <CommonsJavaScript/PrivateObject.h>
-
-using namespace WrtDeviceApis::CommonsJavaScript;
-using namespace WrtDeviceApis;
-using namespace WrtDeviceApis::Commons;
-
-
-namespace TizenApis {
-namespace Tizen1_0 {
-
-
-typedef PrivateObjectT<SecureStorageManagerPtr>::Type JSSecureStorageManagerPriv;
-
-class JSSecureStorageManager {
-public:
- static const JSClassDefinition* getClassInfo();
- static const JSClassRef getClassRef();
-private:
- static void initialize(JSContextRef context, JSObjectRef object);
- static void finalize(JSObjectRef object);
- static bool hasInstance(JSContextRef context, JSObjectRef constructor,
- JSValueRef possibleInstance, JSValueRef* exception);
-
- static JSValueRef listKeys(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
- JSValueRef* exception);
- static JSValueRef set(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
- JSValueRef* exception);
- static JSValueRef get(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
- JSValueRef* exception);
- static JSValueRef remove(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
- JSValueRef* exception);
- static JSValueRef removeAll(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
- JSValueRef* exception);
-
- static JSClassDefinition m_classInfo;
- static JSStaticFunction m_function[];
- static JSClassRef m_jsClassRef;
-};
-
-}
-}
-
-#endif
-
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "SecureStorageManager.h"
-#include <ss_manager.h>
-#include <cassert>
-#include <exception>
-#include <Commons/Exception.h>
-#include <CommonsJavaScript/JSUtils.h>
-#include <dpl/scoped_array.h>
-
-using namespace DPL;
-using namespace WrtDeviceApis::Commons;
-
-namespace TizenApis {
-namespace Tizen1_0{
-
-std::string SecureStorageManager::m_filePath = "securedata.txt";
-int SecureStorageManager::m_maxLength = 256;
-
-SecureStorageManager::SecureStorageManager()
-{
- LoggerD("OK");
-
- try
- {
- loadSecurePairData();
- }
- catch (const WrtDeviceApis::Commons::Exception& ex)
- {
- LoggerE("Exception: " << ex.GetMessage());
- LoggerD("there is no file");
- }
-
- LoggerD("initial map size : " << m_securePairData.size());
-}
-
-SecureStorageManager::~SecureStorageManager()
-{
- LoggerD("OK");
-}
-
-std::string SecureStorageManager::get(std::string key)
-{
- LoggerD("OK");
-
- std::map<std::string,std::string>::iterator it = m_securePairData.find(key);
-
- if (it == m_securePairData.end())
- {
- ThrowMsg(WrtDeviceApis::Commons::NotFoundException, "not found key");
- }
-
- return m_securePairData[key];
-}
-
-std::vector<std::string> SecureStorageManager::listKeys()
-{
- std::vector<std::string> vector;
- std::map<std::string,std::string>::iterator it;
-
- LoggerD("OK");
-
- for (it = m_securePairData.begin(); it != m_securePairData.end(); ++it)
- {
- vector.push_back((*it).first);
- }
-
- return vector;
-}
-void SecureStorageManager::set(std::string key, std::string value)
-{
- m_securePairData[key] = value;
-
- LoggerD("Save current data");
- saveSecurePairData();
-}
-
-void SecureStorageManager::remove(std::string key)
-{
- LoggerD("OK");
-
- std::map<std::string,std::string>::iterator it = m_securePairData.find(key);
-
- if (it == m_securePairData.end())
- {
- ThrowMsg(WrtDeviceApis::Commons::NotFoundException, "not found key");
- }
- m_securePairData.erase(it);
- LoggerD("Save current data");
- saveSecurePairData();
-}
-
-void SecureStorageManager::removeAll()
-{
- LoggerD("OK");
-
- ssm_flag flag = SSM_FLAG_SECRET_OPERATION;
-
- m_securePairData.clear();
- ssm_delete_file(m_filePath.c_str(), flag, NULL);
-}
-
-void SecureStorageManager::saveSecurePairData()
-{
- LoggerD("OK");
-
- std::map<std::string,std::string>::iterator it;
- size_t dataSize = 0;
- size_t index = 0;
- size_t num = 0;
- size_t mapSize = m_securePairData.size();
- int ret = -1;
-
- for (it = m_securePairData.begin(); it != m_securePairData.end(); ++it)
- {
- dataSize += (*it).first.size();
- dataSize += (*it).second.size();
- }
-
- dataSize += sizeof(size_t) * 2 * m_securePairData.size();
- dataSize += sizeof(size_t) * 2;
-
- DPL::ScopedArray<char> saveBuf(new char[dataSize]);
-
- memcpy(&saveBuf[index], (char*)&mapSize, sizeof(size_t));
- index += sizeof(size_t);
-
- memcpy(&saveBuf[index], (char*)&dataSize, sizeof(size_t));
- index += sizeof(size_t);
-
- for (it = m_securePairData.begin(); it != m_securePairData.end(); ++it)
- {
- num = (*it).first.size();
- memcpy(&saveBuf[index], (char*)&num, sizeof(size_t));
- index += sizeof(size_t);
-
- memcpy(&saveBuf[index], (char*)(*it).first.c_str(), (*it).first.size());
- index += (*it).first.size();
-
- num = (*it).second.size();
- memcpy(&saveBuf[index], (char*)&num, sizeof(size_t));
- index += sizeof(size_t);
- memcpy(&saveBuf[index], (char*)(*it).second.c_str(), (*it).second.size());
- index += (*it).second.size();
- }
-
- ssm_flag flag = SSM_FLAG_SECRET_OPERATION;
-
- ret = ssm_write_buffer(saveBuf.Get(), dataSize, m_filePath.c_str(), flag, NULL);
-
- if (ret < 0)
- {
- ThrowMsg(WrtDeviceApis::Commons::PlatformException, "ssm write buf error");
- }
- LoggerD("save result : " << ret);
-}
-
-std::string SecureStorageManager::readStringFromMemory(const char *saveBuf, size_t ¤t, size_t dataSize)
-{
- std::string value = "";
- size_t num = 0;
- char tempbuf[m_maxLength];
-
- if (current + sizeof(size_t) > dataSize)
- {
- ThrowMsg(WrtDeviceApis::Commons::PlatformException, "get size error ");
- }
-
- memcpy(&num, &saveBuf[current], sizeof(size_t));
- memset(tempbuf, 0, sizeof(tempbuf));
- current += sizeof(size_t);
-
- if (current + num > dataSize)
- {
- ThrowMsg(WrtDeviceApis::Commons::PlatformException, "get size error ");
- }
-
- memcpy(tempbuf, &saveBuf[current], num);
- current += num;
- value = tempbuf;
-
- return value;
-}
-
-
-void SecureStorageManager::loadSecurePairData()
-{
- LoggerD("OK");
-
- int ret = -1;
- size_t num = 0;
- size_t dataSize = 0;
- size_t i = 0;
- size_t readlen = 0;
- char* retbuf = NULL;
- ssm_file_info_t sfi;
- ssm_flag flag = SSM_FLAG_SECRET_OPERATION;
- size_t index = 0;
-
- m_securePairData.clear();
- ret = ssm_getinfo(m_filePath.c_str(), &sfi, flag, NULL);
-
- if (ret < 0)
- {
- ThrowMsg(WrtDeviceApis::Commons::PlatformException, "get info error");
- }
-
- if (sfi.originSize == 0)
- {
- ThrowMsg(WrtDeviceApis::Commons::PlatformException, "originSize error");
- }
-
- DPL::ScopedArray<char> saveBuf(new char[sfi.originSize]);
- retbuf = saveBuf.Get();
-
- memset(retbuf, 0x00, sizeof(char) * sfi.originSize);
- ret = ssm_read(m_filePath.c_str(), retbuf, sfi.originSize, &readlen, flag, NULL);
-
- if (ret < 0)
- {
- ThrowMsg(WrtDeviceApis::Commons::PlatformException, "read buf error");
- }
-
- LoggerD("read result : " << ret << ", length:" << readlen);
-
- memcpy(&num, &saveBuf[index], sizeof(size_t));
- index += sizeof(size_t);
-
- memcpy(&dataSize, &saveBuf[index], sizeof(size_t));
- index += sizeof(size_t);
-
- LoggerD("dataSize" << dataSize << "-" << num);
-
- for (i = 0; i < num; i++)
- {
- std::string key = readStringFromMemory(retbuf, index, dataSize);
- std::string value = readStringFromMemory(retbuf, index, dataSize);
-
- if (key.size() == 0 || value.size() == 0)
- {
- ThrowMsg(WrtDeviceApis::Commons::PlatformException, "read buf error");
- }
- m_securePairData[key] = value;
- LoggerD("contents:" << key << "-" << m_securePairData[key]);
- }
-}
-
-
-}
-}
-
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef TIZENAPIS_TIZEN_SECURE_STORAGE_MANAGER_H_
-#define TIZENAPIS_TIZEN_SECURE_STORAGE_MANAGER_H_
-
-#include <dpl/shared_ptr.h>
-#include <map>
-#include <string>
-#include <vector>
-
-namespace TizenApis {
-namespace Tizen1_0 {
-
-class SecureStorageManager;
-typedef DPL::SharedPtr<SecureStorageManager> SecureStorageManagerPtr;
-
-
-class SecureStorageManager
-{
-public:
- std::string get(std::string key);
- std::vector<std::string> listKeys();
- void set(std::string key, std::string value);
- void remove(std::string key);
- void removeAll();
- SecureStorageManager();
- ~SecureStorageManager();
-private:
- static std::string m_filePath;
- static int m_maxLength;
- std::map<std::string, std::string> m_securePairData;
- void saveSecurePairData();
- void loadSecurePairData();
- std::string readStringFromMemory(const char *saveBuf, size_t ¤t, size_t dataSize);
-};
-}
-}
-#endif
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE plugin-properties SYSTEM "/usr/etc/tizen-apis/config.dtd">
-<plugin-properties>
- <library-name>libwrt-plugins-tizen-securestorage.so</library-name>
- <feature-install-uri>securestorage.install.uri</feature-install-uri>
- <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
- <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
- <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
- <api-feature>
- <name>http://tizen.org/privilege/securestorage.read</name>
- <device-capability>securestorage.read</device-capability>
- </api-feature>
- <api-feature>
- <name>http://tizen.org/privilege/securestorage.write</name>
- <device-capability>securestorage.write</device-capability>
- </api-feature>
-</plugin-properties>
-
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <map>
-#include <utility>
-#include <Commons/FunctionDefinition.h>
-#include <Commons/FunctionDeclaration.h>
-#include <Commons/Exception.h>
-#include "plugin_config.h"
-
-#define SECURE_STORAGE_FEATURE_API_READ "http://tizen.org/privilege/securestorage.read"
-#define SECURE_STORAGE_FEATURE_API_WRITE "http://tizen.org/privilege/securestorage.write"
-
-#define SECURE_STORAGE_DEVICE_CAP_READ "securestorage.read"
-#define SECURE_STORAGE_DEVICE_CAP_WRITE "securestorage.write"
-
-namespace TizenApis {
-namespace Tizen1_0 {
-
-const char* SECURE_STORAGE_FUNC_READ = "SecureStroageReadFunc";
-const char* SECURE_STORAGE_FUNC_WRITE = "SecureStroageWriteFunc";
-const char* SECURE_STORAGE_FUNC_READWRITE = "SecureStroageReadWriteFunc";
-
-static WrtDeviceApis::Commons::FunctionMapping createSecureStorageFunctions();
-
-static WrtDeviceApis::Commons::FunctionMapping SecureStorageFunctions =
- createSecureStorageFunctions();
-
-#pragma GCC visibility push(default)
-
-DEFINE_FUNCTION_GETTER(SecureStorage, SecureStorageFunctions);
-
-#pragma GCC visibility pop
-
-static WrtDeviceApis::Commons::FunctionMapping createSecureStorageFunctions()
-{
- using namespace WrtDeviceApis::Commons;
-
- ACE_CREATE_DEVICE_CAP(DEVICE_CAP_SECURE_STORAGE_READ, SECURE_STORAGE_DEVICE_CAP_READ);
- ACE_CREATE_DEVICE_CAP(DEVICE_CAP_SECURE_STORAGE_WRITE, SECURE_STORAGE_DEVICE_CAP_WRITE);
-
-
- ACE_CREATE_DEVICE_CAPS_LIST(EMPTY_DEVICE_LIST);
-
- ACE_CREATE_DEVICE_CAPS_LIST(DEVICE_LIST_SECURE_STORAGE_READ);
- ACE_ADD_DEVICE_CAP(DEVICE_LIST_SECURE_STORAGE_READ, DEVICE_CAP_SECURE_STORAGE_READ);
-
- ACE_CREATE_DEVICE_CAPS_LIST(DEVICE_LIST_SECURE_STORAGE_WRITE);
- ACE_ADD_DEVICE_CAP(DEVICE_LIST_SECURE_STORAGE_WRITE, DEVICE_CAP_SECURE_STORAGE_WRITE);
-
-
- ACE_CREATE_DEVICE_CAPS_LIST(DEVICE_LIST_SECURE_STORAGE_READWRITE);
- ACE_ADD_DEVICE_CAP(DEVICE_LIST_SECURE_STORAGE_READWRITE, DEVICE_CAP_SECURE_STORAGE_READ);
- ACE_ADD_DEVICE_CAP(DEVICE_LIST_SECURE_STORAGE_READWRITE, DEVICE_CAP_SECURE_STORAGE_WRITE);
-
-
- ACE_CREATE_FEATURE(FEATURE_READ, SECURE_STORAGE_FEATURE_API_READ);
- ACE_CREATE_FEATURE(FEATURE_WRITE, SECURE_STORAGE_FEATURE_API_WRITE);
-
- ACE_CREATE_FEATURE_LIST(SECURE_STORAGE_FEATURES_SECURE_READWRITE);
- ACE_ADD_API_FEATURE(SECURE_STORAGE_FEATURES_SECURE_READWRITE, FEATURE_READ);
- ACE_ADD_API_FEATURE(SECURE_STORAGE_FEATURES_SECURE_READWRITE, FEATURE_WRITE);
-
- ACE_CREATE_FEATURE_LIST(SECURE_STORAGE_FEATURES_READ);
- ACE_ADD_API_FEATURE(SECURE_STORAGE_FEATURES_READ, FEATURE_READ);
-
- ACE_CREATE_FEATURE_LIST(SECURE_STORAGE_FEATURES_WRITE);
- ACE_ADD_API_FEATURE(SECURE_STORAGE_FEATURES_WRITE, FEATURE_WRITE);
-
-
- FunctionMapping SecureStorageFunctions;
-
- AceFunction secureStorageRead = ACE_CREATE_FUNCTION(
- FUNCTION_SECURE_STORAGE_READ_FUNCTIONS,
- SECURE_STORAGE_FUNC_READ,
- SECURE_STORAGE_FEATURES_READ,
- DEVICE_LIST_SECURE_STORAGE_READ);
-
- SecureStorageFunctions.insert(std::make_pair(
- SECURE_STORAGE_FUNC_READ,
- secureStorageRead));
-
- AceFunction secureStorageWrite = ACE_CREATE_FUNCTION(
- FUNCTION_SECURE_STORAGE_WRITE_FUNCTIONS,
- SECURE_STORAGE_FUNC_WRITE,
- SECURE_STORAGE_FEATURES_WRITE,
- DEVICE_LIST_SECURE_STORAGE_WRITE);
-
- SecureStorageFunctions.insert(std::make_pair(
- SECURE_STORAGE_FUNC_WRITE,
- secureStorageWrite));
-
- AceFunction secureStorageReadWrite = ACE_CREATE_FUNCTION(
- FUNCTION_SECURE_STORAGE_READWRITE_FUNCTIONS,
- SECURE_STORAGE_FUNC_READWRITE,
- SECURE_STORAGE_FEATURES_SECURE_READWRITE,
- DEVICE_LIST_SECURE_STORAGE_READWRITE);
-
- SecureStorageFunctions.insert(std::make_pair(
- SECURE_STORAGE_FUNC_READWRITE,
- secureStorageReadWrite));
-
- return SecureStorageFunctions;
-}
-}
-}
-
-#undef SECURE_STORAGE_FEATURE_API
-#undef SECURE_STORAGE_FEATURE_API_WRITE
-#undef SECURE_STORAGE_FEATURE_API_READ
-#undef SECURE_STORAGE_DEVICE_CAP_WRITE
-#undef SECURE_STORAGE_DEVICE_CAP_READ
-
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef TIZENAPIS_TIZEN_JS_SECURE_STORAGE_PLUGIN_CONFIG_H_
-#define TIZENAPIS_TIZEN_JS_SECURE_STORAGE_PLUGIN_CONFIG_H_
-
-#include <Commons/FunctionDeclaration.h>
-
-namespace TizenApis {
-namespace Tizen1_0 {
-
-extern const char* SECURE_STORAGE_FUNC_READ;
-extern const char* SECURE_STORAGE_FUNC_WRITE;
-
-
-WrtDeviceApis::Commons::AceFunction getSecureStorageFunctionData(const std::string & functionId);
-
-#define SECURE_STORAGE_CHECK_ACCESS(functionName) \
- aceCheckAccess<AceFunctionGetter, DefaultArgsVerifier<> >( \
- getSecureStorageFunctionData, \
- functionName)
-}
-}
-
-#endif
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <Commons/plugin_initializer_def.h>
-#include <Commons/WrtAccess/WrtAccess.h>
-#include "JSSecureStorageManager.h"
-#include <Logger.h>
-
-using namespace WrtDeviceApis;
-using namespace WrtDeviceApis::Commons;
-
-void on_widget_start_callback(int widgetId)
-{
- LoggerD("[Tizen\\Bluetooth ] on_widget_start_callback ("<<widgetId<<")");
- Try
- {
- WrtAccessSingleton::Instance().initialize(widgetId);
- }
- Catch(Commons::Exception)
- {
- LoggerE("WrtAccess initialization failed");
- }
-}
-
-void on_widget_stop_callback(int widgetId)
-{
- LoggerD("[Tizen\\Bluetooth] on_widget_stop_callback ("<<widgetId<<")");
- Try
- {
- WrtAccessSingleton::Instance().deinitialize(widgetId);
- }
- Catch(Commons::Exception)
- {
- LoggerE("WrtAccess deinitialization failed");
- }
-}
-
-PLUGIN_ON_WIDGET_START(on_widget_start_callback)
-PLUGIN_ON_WIDGET_STOP(on_widget_stop_callback)
-
-#define SECURE_STORAGE "securestorage"
-
-PLUGIN_CLASS_MAP_BEGIN
-PLUGIN_CLASS_MAP_ADD_CLASS(WRT_JS_EXTENSION_OBJECT_TIZEN, SECURE_STORAGE,
- (js_class_template_getter)TizenApis::Tizen1_0::JSSecureStorageManager::getClassRef,NULL)
-PLUGIN_CLASS_MAP_END
-