%define tizen_feature_fm_radio_support 1
%endif
%define tizen_feature_ham_support 0
+%define tizen_feature_key_manager_support 1
%define tizen_feature_media_controller_support 1
%ifarch %{arm}
# ARM
# I586
%define tizen_feature_media_key_support 0
%endif
-
+%define tizen_feature_key_manager_support 0
%define tizen_feature_message_port_support 1
%define tizen_feature_messaging_support 0
%define tizen_feature_filesystem_support 1
%define tizen_feature_fm_radio_support 0
%define tizen_feature_ham_support 0
+%define tizen_feature_key_manager_support 0
%define tizen_feature_media_controller_support 0
%define tizen_feature_media_key_support 0
%define tizen_feature_message_port_support 1
BuildRequires: pkgconfig(push)
%endif
+%if 0%{?tizen_feature_key_manager_support}
+BuildRequires: pkgconfig(key-manager)
+%endif
+
%if 0%{?tizen_feature_media_controller_support}
BuildRequires: pkgconfig(capi-media-controller)
%endif
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_feature_filesystem_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_feature_fm_radio_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_feature_ham_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_feature_key_manager_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_feature_media_controller_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_feature_media_key_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_feature_message_port_support}"
--- /dev/null
+{
+ 'includes':[
+ '../common/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'tizen_keymanager',
+ 'type': 'loadable_module',
+ 'dependencies': [
+ '../common/common.gyp:tizen_common',
+ ],
+ 'sources': [
+ 'keymanager_api.js',
+ 'keymanager_extension.cc',
+ 'keymanager_extension.h',
+ 'keymanager_instance.cc',
+ 'keymanager_instance.h',
+ ],
+ 'conditions': [
+ ['tizen == 1', {
+ 'variables': {
+ 'packages': [
+ 'key-manager',
+ ]
+ },
+ }],
+ ],
+ },
+ ],
+}
--- /dev/null
+// Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var validator = xwalk.utils.validator;
+var converter = xwalk.utils.converter;
+
+var KeyType = {
+ "KEY_NONE": "KEY_NONE",
+ "KEY_RSA_PUBLIC": "KEY_RSA_PUBLIC",
+ "KEY_RSA_PRIVATE": "KEY_RSA_PRIVATE",
+ "KEY_ECDSA_PUBLIC": "KEY_ECDSA_PUBLIC",
+ "KEY_ECDSA_PRIVATE": "KEY_ECDSA_PRIVATE",
+ "KEY_DSA_PUBLIC": "KEY_DSA_PUBLIC",
+ "KEY_DSA_PRIVATE": "KEY_DSA_PRIVATE",
+ "KEY_AES": "KEY_AES"
+};
+
+function Key(name, password, extractable, keyType, rawKey) {
+ Object.defineProperties(this, {
+ name: {
+ value: converter.toString(name),
+ enumerable: true
+ },
+ password: {
+ value: password ? converter.toString(password) : null,
+ enumerable: true
+ },
+ extractable: {
+ value: !!extractable,//make sure it is boolean
+ enumerable: true
+ },
+ keyType: {
+ value: KeyType.hasOwnProperty(keyType) ? keyType : KeyType.KEY_NONE,
+ enumerable: true
+ },
+ rawKey: {
+ value: converter.toString(rawKey),
+ enumerable: true
+ }
+ });
+}
+
+Key.prototype.save = function() {
+
+};
+
+Key.prototype.remove = function() {
+
+};
+
+function Certificate(name, password, extractable, rawCert) {
+ Object.defineProperties(this, {
+ name: {
+ value: converter.toString(name),
+ enumerable: true
+ },
+ password: {
+ value: password ? converter.toString(password) : null,
+ enumerable: true
+ },
+ extractable: {
+ value: !!extractable,//make sure it is boolean
+ enumerable: true
+ },
+ rawCert: {
+ value: rawCert ? converter.toString(rawCert) : "",
+ enumerable: true
+ }
+ });
+}
+
+Certificate.prototype.save = function() {
+
+};
+
+Certificate.prototype.loadFromFile = function() {
+
+};
+
+Certificate.prototype.remove = function() {
+
+};
+
+function Data(name, password, extractable, rawData) {
+ Object.defineProperties(this, {
+ name: {
+ value: converter.toString(name),
+ enumerable: true
+ },
+ password: {
+ value: password ? converter.toString(password) : null,
+ enumerable: true
+ },
+ extractable: {
+ value: !!extractable,//make sure it is boolean
+ enumerable: true
+ },
+ rawData: {
+ value: rawData ? converter.toString(rawData) : "",
+ enumerable: true
+ }
+ });
+}
+
+Data.prototype.save = function() {
+
+};
+
+Data.prototype.remove = function() {
+
+};
+
+function KeyManager() {
+
+}
+
+KeyManager.prototype.generateKeyPair = function() {
+
+};
+
+KeyManager.prototype.loadFromPKCS12File = function() {
+
+};
+
+KeyManager.prototype.getKey = function() {
+
+};
+
+KeyManager.prototype.getKeyAliasList = function() {
+
+};
+
+KeyManager.prototype.getCertificate = function() {
+
+};
+
+KeyManager.prototype.getCertificatesAliasList = function() {
+
+};
+
+KeyManager.prototype.getData = function() {
+
+};
+
+KeyManager.prototype.getDataAliasList = function() {
+
+};
+
+KeyManager.prototype.allowAccessControl = function() {
+
+};
+
+KeyManager.prototype.denyAccessControl = function() {
+
+};
+
+KeyManager.prototype.createSignature = function() {
+
+};
+
+KeyManager.prototype.verifySignature = function() {
+
+};
+
+// expose only basic constructors
+tizen.Key = function(name, password, extractable) {
+ Key.call(this, name, password, extractable, KeyType.KEY_NONE, "");
+};
+tizen.Key.prototype = Object.create(Key.prototype);
+tizen.Certificate = function(name, password, extractable) {
+ Certificate.call(this, name, password, extractable, "");
+};
+tizen.Certificate.prototype = Object.create(Certificate.prototype);
+tizen.Data = function(name, password, extractable) {
+ Data.call(this, name, password, extractable, "");
+};
+tizen.Data.prototype = Object.create(Data.prototype);
+
+exports = new KeyManager();
\ No newline at end of file
--- /dev/null
+// Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "keymanager/keymanager_extension.h"
+
+#include "keymanager/keymanager_instance.h"
+
+namespace {
+const char* kKey = "tizen.Key";
+const char* kData = "tizen.Data";
+const char* kCertificate = "tizen.Certificate";
+}
+
+// This will be generated from keymanager_api.js
+extern const char kSource_keymanager_api[];
+
+common::Extension* CreateExtension() {
+ return new KeyManagerExtension;
+}
+
+KeyManagerExtension::KeyManagerExtension() {
+ SetExtensionName("tizen.keymanager");
+ SetJavaScriptAPI(kSource_keymanager_api);
+ const char* entry_points[] = {
+ kKey,
+ kData,
+ kCertificate,
+ NULL
+ };
+ SetExtraJSEntryPoints(entry_points);
+}
+
+KeyManagerExtension::~KeyManagerExtension() {}
+
+common::Instance* KeyManagerExtension::CreateInstance() {
+ return new extension::keymanager::KeyManagerInstance;
+}
--- /dev/null
+// Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef KEYMANAGER_KEYMANAGER_EXTENSION_H_
+#define KEYMANAGER_KEYMANAGER_EXTENSION_H_
+
+#include "common/extension.h"
+
+class KeyManagerExtension : public common::Extension {
+ public:
+ KeyManagerExtension();
+ virtual ~KeyManagerExtension();
+
+ private:
+ virtual common::Instance* CreateInstance();
+};
+
+#endif // KEYMANAGER_KEYMANAGER_EXTENSION_H_
--- /dev/null
+// Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "keymanager/keymanager_instance.h"
+
+#include <functional>
+
+#include "common/logger.h"
+#include "common/picojson.h"
+#include "common/platform_result.h"
+
+namespace extension {
+namespace keymanager {
+
+
+KeyManagerInstance::KeyManagerInstance() {
+ using namespace std::placeholders;
+
+}
+
+KeyManagerInstance::~KeyManagerInstance() {
+}
+
+} // namespace keymanager
+} // namespace extension
--- /dev/null
+// Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef KEYMANAGER_KEYMANAGER_INSTANCE_H_
+#define KEYMANAGER_KEYMANAGER_INSTANCE_H_
+
+#include "common/extension.h"
+
+namespace extension {
+namespace keymanager {
+
+class KeyManagerInstance : public common::ParsedInstance {
+ public:
+ KeyManagerInstance();
+ virtual ~KeyManagerInstance();
+ private:
+};
+
+} // namespace keymanager
+} // namespace extension
+
+#endif // KEYMANAGER_KEYMANAGER_INSTANCE_H_
},
],
[
+ 'tizen_feature_key_manager_support==1', {
+ 'dependencies': [
+ 'keymanager/keymanager.gyp:*',
+ ],
+ },
+ ],
+ [
'tizen_feature_media_controller_support==1', {
'dependencies': [
'mediacontroller/mediacontroller.gyp:*',