From d97d6ec28952cf0e8d79996248cbb6e82bc49da5 Mon Sep 17 00:00:00 2001 From: Qwink2016 <714794360@qq.com> Date: Wed, 21 Jun 2023 18:08:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=81=E4=B9=A6=E7=AE=97=E6=B3=95=E5=BA=93?= =?UTF-8?q?=E6=96=B0=E5=A2=9EJS=20XTS=E6=B5=8B=E8=AF=95=E5=A5=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Qwink2016 <714794360@qq.com> Change-Id: I755b507e448e0771832a5175a7136b2e831ff67a --- security/BUILD.gn | 1 + .../js_api_test_oh40/BUILD.gn | 36 + .../js_api_test_oh40/Test.json | 32 + .../signature/openharmony_sx.p7b | Bin 0 -> 3514 bytes .../js_api_test_oh40/src/main/config.json | 85 ++ .../src/main/js/MainAbility/app.js | 24 + .../src/main/js/MainAbility/i18n/en-US.json | 7 + .../src/main/js/MainAbility/i18n/zh-CN.json | 7 + .../main/js/MainAbility/pages/index/index.css | 30 + .../main/js/MainAbility/pages/index/index.hml | 5 + .../main/js/MainAbility/pages/index/index.js | 24 + .../src/main/js/TestAbility/app.js | 31 + .../src/main/js/TestAbility/i18n/en-US.json | 7 + .../src/main/js/TestAbility/i18n/zh-CN.json | 7 + .../main/js/TestAbility/pages/index/index.css | 30 + .../main/js/TestAbility/pages/index/index.hml | 5 + .../main/js/TestAbility/pages/index/index.js | 23 + .../js/TestRunner/OpenHarmonyTestRunner.js | 70 ++ .../src/main/js/test/CertificateFunc.test.js | 992 ++++++++++++++++++ .../src/main/js/test/List.test.js | 20 + .../certificate/publicCertificateCallback.js | 101 ++ .../certificate/publicCertificateCommon.js | 63 ++ .../certificate/publicCertificatePromise.js | 101 ++ .../js/test/utils/common/publicDoString.js | 61 ++ .../main/js/test/utils/common/publicParam.js | 175 +++ .../main/resources/base/element/color.json | 8 + .../main/resources/base/element/string.json | 28 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../main/resources/en_US/element/string.json | 24 + .../main/resources/zh_CN/element/string.json | 24 + .../js_api_test_one/BUILD.gn | 2 +- 31 files changed, 2022 insertions(+), 1 deletion(-) create mode 100644 security/certificate_framework/js_api_test_oh40/BUILD.gn create mode 100644 security/certificate_framework/js_api_test_oh40/Test.json create mode 100644 security/certificate_framework/js_api_test_oh40/signature/openharmony_sx.p7b create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/config.json create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/app.js create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/i18n/en-US.json create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/i18n/zh-CN.json create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.css create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.hml create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.js create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/app.js create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/i18n/en-US.json create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/i18n/zh-CN.json create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.css create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.hml create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.js create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/TestRunner/OpenHarmonyTestRunner.js create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/test/CertificateFunc.test.js create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/test/List.test.js create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificateCallback.js create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificateCommon.js create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificatePromise.js create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/common/publicDoString.js create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/common/publicParam.js create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/resources/base/element/color.json create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/resources/base/element/string.json create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/resources/base/media/icon.png create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/resources/en_US/element/string.json create mode 100644 security/certificate_framework/js_api_test_oh40/src/main/resources/zh_CN/element/string.json diff --git a/security/BUILD.gn b/security/BUILD.gn index 5e0601340..c8ea4ed86 100644 --- a/security/BUILD.gn +++ b/security/BUILD.gn @@ -20,6 +20,7 @@ group("security") { if (is_standard_system) { deps = [ "access_token/AccessTokenTest_Normal_js:ActsAccessTokenApiJSNormalTest", + "certificate_framework/js_api_test_oh40:ActsCertFrameworkTwoJSNormalTest", "certificate_framework/js_api_test_one:ActsCertificateFrameworkJSNormalTest", "cipher/datacipher:datacipher", "cryptoFramework/js_api_test_oh40:ActsCryptoFrameworkTwoJSNormalTest", diff --git a/security/certificate_framework/js_api_test_oh40/BUILD.gn b/security/certificate_framework/js_api_test_oh40/BUILD.gn new file mode 100644 index 000000000..460e4d40d --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/BUILD.gn @@ -0,0 +1,36 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# 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. + +base_root = "../../../../../../" +import("$base_root/test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("ActsCertFrameworkTwoJSNormalTest") { + hap_profile = "./src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsCertFrameworkTwoJSNormalTest" + subsystem_name = "security" + part_name = "certificate_framework" +} +ohos_js_assets("hjs_demo_js_assets") { + js2abc = true + hap_profile = "./src/main/config.json" + source_dir = "./src/main/js" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./src/main/resources" ] + hap_profile = "./src/main/config.json" +} diff --git a/security/certificate_framework/js_api_test_oh40/Test.json b/security/certificate_framework/js_api_test_oh40/Test.json new file mode 100644 index 000000000..729bcf319 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/Test.json @@ -0,0 +1,32 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "1800000", + "shell-timeout": "1800000", + "testcase-timeout": "900000", + "bundle-name": "com.openharmony.certificateframework2", + "package-name": "com.openharmony.certificateframework2" + }, + "kits": [ + { + "test-file-name": ["ActsCertFrameworkTwoJSNormalTest.hap"], + "type": "AppInstallKit", + "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "remount", + "mkdir -p /data/local/tmp/xts-test", + "chmod 777 -R /data/local/tmp/xts-test" + ] + }, + { + "type": "PushKit", + "push": [ + "ActsCertFrameworkTwoJSNormalTest.hap -> /data/local/tmp/xts-test/ActsCertFrameworkTwoJSNormalTest.hap" + ] + } + ] +} diff --git a/security/certificate_framework/js_api_test_oh40/signature/openharmony_sx.p7b b/security/certificate_framework/js_api_test_oh40/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..42a75c325fa1a659682715ac6c6c3359d5c3380f GIT binary patch literal 3514 zcmcgvYj6|S6}BF>V~oJWyaN~n!2~07SJuOF3d!zDTFLgx*2}Vts98y?m!(}Ht-O{f zgo;9V1PDzF1TZle3^Y7CybPU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L+414) z+AW|K6mf7yj~5RIL+20vbWx{t=wI?TRdsefJLm9M*>g9`Fff2m7$^|@S1c9@bLWH6 zygfiXR6O_t;@XjIDbv~0zuot%8`(d6(B{2W>7J@5Pa(ze@|mglHu-TPfDx1?=RDD~OB{uS_z2{Ws+ z$1VM1$NU;_UVCxr#4gLow*~0-YZLahD+^k7+>6h<@{fW0IR0ok{+#UL&%jIN%lcvg zfuGpANnm1k>xv%NItxuR50MB`K;^wilrf(ml4elwfIQhHzZ7RlMeZyyuIfszYLYD2 za8puw{N5z`OAj2WnsZo|zoGfab*J;pjP;veOn-myW2YEfhGT1^tC6ic+io9jyld;| zKcLIAc;(-)LG24A7Y=RRe7AAP-HAoZVqIgO8*Pp|jq}vG*uUEm@FEz<6Qz(RPBsv6 zkG@P2$})Lx9`WXrQN+hkXxzpxPqgkCrrfpk{Vk3Eyaqp8EWSMQjawfx3((!$bH3Si zvv}kO=U$Wi;gEXEylDNB6Z4*l?rrWk_-6}n?EhrVBvtK!&OPs}AGu-cttCqeZk<^> zZpodOX6-L2x^w;Hr4`@H?Cl;v^bw~=a^(Nu*dxWQ&kZ9AWC2nLBIkczzTkD{=1af7 zQxRy~aYD86^3j45=L#>+^%c}yG1xy_GJiy%)A*mW*E@%Nbp6~QPOOeUMYB69Vw)_T z6J>V~)bBjDdUe4&;pe-Crbqp-_=0J9?8*w_a@5Hz_rI@rVi{YVYrvwjdaO|9d7+1aYw+zk&o{)O{l_8yd)6ie*5>U5FZmTFwz~>Vv2ll8VPJ zEIoPTva0pK$=u814*llh30c|2+@fRm7CYbj?&|TICsm-|{hM4UHUPbFT-Le$@2-=a zdajbmzxUTM>D|LycRcg*l=}T$!RVQldu|*`a4DZ^|32pRoatA+*wE51(6W#c1=g}b P9oAjM0aIY>t6Bd8&xCA` literal 0 HcmV?d00001 diff --git a/security/certificate_framework/js_api_test_oh40/src/main/config.json b/security/certificate_framework/js_api_test_oh40/src/main/config.json new file mode 100644 index 000000000..3cf704f70 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/config.json @@ -0,0 +1,85 @@ +{ + "app": { + "bundleName": "com.openharmony.certificateframework2", + "vendor": "acts", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 9, + "target": 10, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.openharmony.certificateframework2", + "name": ".entry", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": ["default", "tablet", "tv", "wearable", "phone"], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": ["entity.system.home"], + "actions": ["action.system.home"] + } + ], + "orientation": "unspecified", + "formsEnabled": false, + "name": ".MainAbility", + "srcLanguage": "js", + "srcPath": "MainAbility", + "icon": "$media:icon", + "description": "$string:MainAbility_desc", + "label": "$string:MainAbility_label", + "type": "page", + "visible": true, + "launchType": "standard" + }, + { + "orientation": "unspecified", + "formsEnabled": false, + "name": ".TestAbility", + "srcLanguage": "js", + "srcPath": "TestAbility", + "icon": "$media:icon", + "description": "$string:TestAbility_desc", + "label": "$string:TestAbility_label", + "type": "page", + "visible": true, + "launchType": "standard" + } + ], + "js": [ + { + "pages": ["pages/index/index"], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": ["pages/index/index"], + "name": ".TestAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "testRunner": { + "name": "OpenHarmonyTestRunner", + "srcPath": "TestRunner" + } + } +} diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/app.js b/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/app.js new file mode 100644 index 000000000..9a8580a07 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/app.js @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2023 Huawei Device Co., Ltd. + * 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. + */ +import hilog from "@ohos.hilog"; + +export default { + onCreate() { + hilog.info(0x0000, "testTag", "%{public}s", "Application onCreate"); + }, + onDestroy() { + hilog.info(0x0000, "testTag", "%{public}s", "Application onDestroy"); + }, +}; diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/i18n/en-US.json b/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/i18n/en-US.json new file mode 100644 index 000000000..d15e42418 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/i18n/en-US.json @@ -0,0 +1,7 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + }, + "Files": {} +} \ No newline at end of file diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/i18n/zh-CN.json b/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/i18n/zh-CN.json new file mode 100644 index 000000000..1782d228d --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/i18n/zh-CN.json @@ -0,0 +1,7 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + }, + "Files": {} +} \ No newline at end of file diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.css b/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.css new file mode 100644 index 000000000..0f1786c36 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.css @@ -0,0 +1,30 @@ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} + +@media screen and (orientation: landscape) { + .title { + font-size: 60px; + } +} + +@media screen and (device-type: tablet) and (orientation: landscape) { + .title { + font-size: 100px; + } +} diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.hml b/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.hml new file mode 100644 index 000000000..f629c71a9 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.js b/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.js new file mode 100644 index 000000000..4e0306559 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.js @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2023 Huawei Device Co., Ltd. + * 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. + */ + + +export default { + data: { + title: "", + }, + onInit() { + this.title = this.$t("strings.world"); + }, +}; diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/app.js b/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/app.js new file mode 100644 index 000000000..e0320e993 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/app.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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. + */ +import hilog from "@ohos.hilog"; +import AbilityDelegatorRegistry from "@ohos.app.ability.abilityDelegatorRegistry"; +import { Hypium } from "@ohos/hypium"; +import testsuite from "../test/List.test"; + +export default { + onCreate() { + hilog.info(0x0000, "testTag", "%{public}s", "TestApplication onCreate"); + var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + hilog.info(0x0000, "testTag", "%{public}s", "start run testcase!!!"); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); + }, + onDestroy() { + hilog.info(0x0000, "testTag", "%{public}s", "TestApplication onDestroy"); + }, +}; diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/i18n/en-US.json b/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/i18n/en-US.json new file mode 100644 index 000000000..3f895b433 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/i18n/en-US.json @@ -0,0 +1,7 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + }, + "Files": {} +} diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/i18n/zh-CN.json b/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/i18n/zh-CN.json new file mode 100644 index 000000000..764604f3f --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/i18n/zh-CN.json @@ -0,0 +1,7 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + }, + "Files": {} +} diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.css b/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.css new file mode 100644 index 000000000..0f1786c36 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.css @@ -0,0 +1,30 @@ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 60px; + text-align: center; + width: 100%; + height: 40%; + margin: 10px; +} + +@media screen and (orientation: landscape) { + .title { + font-size: 60px; + } +} + +@media screen and (device-type: tablet) and (orientation: landscape) { + .title { + font-size: 100px; + } +} diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.hml b/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.hml new file mode 100644 index 000000000..f629c71a9 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.hml @@ -0,0 +1,5 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.js b/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.js new file mode 100644 index 000000000..dee852571 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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. + */ + +export default { + data: { + title: "", + }, + onInit() { + this.title = this.$t("strings.world"); + }, +}; diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/security/certificate_framework/js_api_test_oh40/src/main/js/TestRunner/OpenHarmonyTestRunner.js new file mode 100644 index 000000000..4b2951407 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/TestRunner/OpenHarmonyTestRunner.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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. + */ +import hilog from "@ohos.hilog"; +import AbilityDelegatorRegistry from "@ohos.app.ability.abilityDelegatorRegistry"; + +export default { + onPrepare() { + hilog.info( + 0x0000, + "testTag", + "%{public}s", + "OpenHarmonyTestRunner OnPrepare" + ); + }, + onRun() { + hilog.info( + 0x0000, + "testTag", + "%{public}s", + "OpenHarmonyTestRunner onRun run" + ); + var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + + var testAbilityName = + abilityDelegatorArguments.parameters["-p"] + ".TestAbility"; + var cmd = + "aa start -d 0 -a " + + testAbilityName + + " -b " + + abilityDelegatorArguments.bundleName; + var debug = abilityDelegatorArguments.parameters["-D"]; + if (debug == "true") { + cmd += " -D"; + } + hilog.info(0x0000, "testTag", "cmd : %{public}s", cmd); + abilityDelegator.executeShellCommand(cmd, (err, data) => { + hilog.info( + 0x0000, + "testTag", + "executeShellCommand : err : %{public}s", + JSON.stringify(err) ?? "" + ); + hilog.info( + 0x0000, + "testTag", + "executeShellCommand : data : %{public}s", + data.stdResult ?? "" + ); + hilog.info( + 0x0000, + "testTag", + "executeShellCommand : data : %{public}s", + data.exitCode ?? "" + ); + }); + }, +}; diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/test/CertificateFunc.test.js b/security/certificate_framework/js_api_test_oh40/src/main/js/test/CertificateFunc.test.js new file mode 100644 index 000000000..c5c4dca47 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/test/CertificateFunc.test.js @@ -0,0 +1,992 @@ +/* + * Copyright (C) 2023 Huawei Device Co., Ltd. + * 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. + */ + +import { + describe, + beforeAll, + beforeEach, + afterEach, + afterAll, + it, + expect, +} from "@ohos/hypium"; +import * as certPromise from "./utils/certificate/publicCertificatePromise"; +import * as certCallback from "./utils/certificate/publicCertificateCallback"; +import * as certCommon from "./utils/certificate/publicCertificateCommon"; +import cert from "@ohos.security.cert"; +import { + uInt8ArrayToString, + uInt8ArrayToShowStr, +} from "./utils/common/publicDoString"; + +export default function CertFrameworkFuncTestJSUnit() { + describe("CertFrameworkFuncTestJSUnit", function () { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(function () { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }); + beforeEach(function () { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }); + afterEach(function () { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }); + afterAll(function () { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }); + + /** + * @tc.number Security_CertificateFramework_Enum_Func_0100 + * @tc.name X509 Cert Enum Type Test + * @tc.desc X509 Cert Enum Type Test + */ + it("Security_CertificateFramework_Enum_Func_0100", 0, function (done) { + certCommon.certificateEnumTypeTest(); + done(); + }); + + /** + * @tc.number Security_CertificateFramework_CertTest_Func_0100 + * @tc.name X509 getItem for CERT_ITEM_TYPE_TBS Test + * @tc.desc Create Der Cert with Promise Style + */ + it( + "Security_CertificateFramework_CertTest_Func_0100", + 0, + async function (done) { + await certPromise + .createX509CertInstancePromise("der") + .then((certObject) => { + try { + expect( + certObject != null && certObject != undefined + ).assertTrue(); + let TBS = certCommon.getX509CertItem( + certObject, + cert.CertItemType.CERT_ITEM_TYPE_TBS + ); + expect(TBS != null && TBS != undefined).assertTrue(); + console.warn( + "getX509CertItem TBS: " + uInt8ArrayToShowStr(TBS.data) + ); + } catch (err) { + console.error( + "getX509CertItem TBS error, error code is: " + err.code + ); + expect(null).assertFail(); + } + }) + .catch((err) => { + console.error( + "createX509CertInstancePromise error, error code is: " + err.code + ); + expect(null).assertFail(); + }); + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertTest_Func_0200 + * @tc.name X509 getItem for CERT_ITEM_TYPE_PUBLIC_KEY Test + * @tc.desc Create Der Cert with Callback Style + */ + it( + "Security_CertificateFramework_CertTest_Func_0200", + 0, + async function (done) { + await certCallback + .createX509CertInstanceCallback("der") + .then((certObject) => { + try { + expect( + certObject != null && certObject != undefined + ).assertTrue(); + let pubKey = certCommon.getX509CertItem( + certObject, + cert.CertItemType.CERT_ITEM_TYPE_PUBLIC_KEY + ); + expect(pubKey != null && pubKey != undefined).assertTrue(); + console.log( + "getX509CertItem pubKey: " + uInt8ArrayToShowStr(pubKey.data) + ); + } catch (err) { + console.error( + "getX509CertItem pubKey error, error code is: " + err.code + ); + expect(null).assertFail(); + } + }) + .catch((err) => { + console.error( + "createX509CertInstanceCallback error, error code is: " + err.code + ); + expect(null).assertFail(); + }); + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertTest_Func_0300 + * @tc.name X509 getItem for CERT_ITEM_TYPE_ISSUER_UNIQUE_ID Test + * @tc.desc Create Der Cert with Promise Style + */ + it( + "Security_CertificateFramework_CertTest_Func_0300", + 0, + async function (done) { + await certPromise + .createX509CertInstancePromise("der") + .then((certObject) => { + try { + expect( + certObject != null && certObject != undefined + ).assertTrue(); + let issuerUniqueID = certCommon.getX509CertItem( + certObject, + cert.CertItemType.CERT_ITEM_TYPE_ISSUER_UNIQUE_ID + ); + expect( + issuerUniqueID != null && issuerUniqueID != undefined + ).assertTrue(); + console.warn( + "getX509CertItem issuerUniqueID: " + + uInt8ArrayToShowStr(issuerUniqueID.data) + ); + } catch (err) { + console.error( + "getX509CertItem issuerUniqueID error, error code is: " + + err.code + ); + expect(null).assertFail(); + } + }) + .catch((err) => { + console.error( + "createX509CertInstancePromise error, error code is: " + err.code + ); + expect(null).assertFail(); + }); + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertTest_Func_0400 + * @tc.name X509 getItem for CERT_ITEM_TYPE_SUBJECT_UNIQUE_ID Test + * @tc.desc Create Der Cert with Callback Style + */ + it( + "Security_CertificateFramework_CertTest_Func_0400", + 0, + async function (done) { + await certCallback + .createX509CertInstanceCallback("der") + .then((certObject) => { + try { + expect( + certObject != null && certObject != undefined + ).assertTrue(); + let subjectUniqueID = certCommon.getX509CertItem( + certObject, + cert.CertItemType.CERT_ITEM_TYPE_SUBJECT_UNIQUE_ID + ); + expect( + subjectUniqueID != null && subjectUniqueID != undefined + ).assertTrue(); + console.warn( + "getX509CertItem subjectUniqueID: " + + uInt8ArrayToShowStr(subjectUniqueID.data) + ); + } catch (err) { + console.error( + "getX509CertItem subjectUniqueID error, error code is: " + + err.code + ); + expect(null).assertFail(); + } + }) + .catch((err) => { + console.error( + "createX509CertInstanceCallback error, error code is: " + err.code + ); + expect(null).assertFail(); + }); + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertTest_Func_0500 + * @tc.name X509 getItem for CERT_ITEM_TYPE_EXTENSIONS Test + * @tc.desc Create Der Cert with Promise Style + */ + it( + "Security_CertificateFramework_CertTest_Func_0500", + 0, + async function (done) { + await certPromise + .createX509CertInstancePromise("der") + .then((certObject) => { + try { + expect( + certObject != null && certObject != undefined + ).assertTrue(); + let extensions = certCommon.getX509CertItem( + certObject, + cert.CertItemType.CERT_ITEM_TYPE_EXTENSIONS + ); + expect( + extensions != null && extensions != undefined + ).assertTrue(); + console.warn( + "getX509CertItem extensions: " + + uInt8ArrayToShowStr(extensions.data) + ); + } catch (err) { + console.error( + "getX509CertItem extensions error, error code is: " + err.code + ); + expect(null).assertFail(); + } + }) + .catch((err) => { + console.error( + "createX509CertInstancePromise error, error code is: " + err.code + ); + expect(null).assertFail(); + }); + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertTest_Func_0600 + * @tc.name X509 getItem invalid param Test 1 + * @tc.desc Create Der Cert with Promise Style + */ + it( + "Security_CertificateFramework_CertTest_Func_0600", + 0, + async function (done) { + try { + let certObject = await certPromise.createX509CertInstancePromise( + "der" + ); + expect(certObject != null && certObject != undefined).assertTrue(); + let extensions = certObject.getItem(-1); + expect(extensions != null && extensions != undefined).assertTrue(); + console.warn( + "getX509CertItem extensions: " + + uInt8ArrayToShowStr(extensions.data) + ); + } catch (err) { + console.error("getX509CertItem err code is:" + err.code); + expect(err.code == 401).assertTrue(); + } + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertTest_Func_0700 + * @tc.name X509 getItem invalid param Test 2 + * @tc.desc Create Der Cert with Promise Style + */ + it( + "Security_CertificateFramework_CertTest_Func_0700", + 0, + async function (done) { + try { + let certObject = await certPromise.createX509CertInstancePromise( + "der" + ); + expect(certObject != null && certObject != undefined).assertTrue(); + let extensions = certObject.getItem(); + expect(extensions != null && extensions != undefined).assertTrue(); + console.warn( + "getX509CertItem extensions: " + + uInt8ArrayToShowStr(extensions.data) + ); + } catch (err) { + console.error("getX509CertItem err code is:" + err.code); + expect(err.code == 401).assertTrue(); + } + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertTest_Func_0800 + * @tc.name X509 getItem invalid param Test 3 + * @tc.desc Create Der Cert with Promise Style + */ + it( + "Security_CertificateFramework_CertTest_Func_0800", + 0, + async function (done) { + try { + let certObject = await certPromise.createX509CertInstancePromise( + "der" + ); + expect(certObject != null && certObject != undefined).assertTrue(); + let extensions = certObject.getItem( + cert.CertItemType.CERT_ITEM_TYPE_EXTENSIONS, + "" + ); + expect(extensions != null && extensions != undefined).assertTrue(); + console.warn( + "getX509CertItem extensions: " + + uInt8ArrayToShowStr(extensions.data) + ); + } catch (err) { + console.error("getX509CertItem err code is:" + err.code); + expect(err.code == 401).assertTrue(); + } + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_0100 + * @tc.name X509 CertExtension getEncoded Test + * @tc.desc Create Der CertExtension with Promise Style + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_0100", + 0, + async function (done) { + await certPromise + .createX509CertExtensionNormalPromise("certExtensionNormal01") + .then((extensionObj) => { + try { + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let encodedObj = extensionObj.getEncoded(); + expect( + encodedObj != null && encodedObj != undefined + ).assertTrue(); + console.warn( + "encodedObj data is: " + uInt8ArrayToShowStr(encodedObj.data) + ); + console.warn( + "encodedObj encodingFormat is: " + encodedObj.encodingFormat + ); + } catch (err) { + console.error("getEncoded error, error code is: " + err.code); + expect(null).assertFail(); + } + }) + .catch((err) => { + console.error( + "createX509CertExtensionNormalPromise error, error code is: " + + err.code + ); + expect(null).assertFail(); + }); + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_0200 + * @tc.name X509 CertExtension getOidList and getEntry Test 1 + * @tc.desc Create Der CertExtension with Callback Style + * @tc.desc ExtensionOidType is EXTENSION_OID_TYPE_ALL + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_0200", + 0, + async function (done) { + await certCallback + .createX509CertExtensionNormalCallback("certExtensionNormal02") + .then((extensionObj) => { + try { + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let oidListObj = extensionObj.getOidList( + cert.ExtensionOidType.EXTENSION_OID_TYPE_ALL + ); + expect( + oidListObj != null && oidListObj != undefined + ).assertTrue(); + console.warn("oidListObj data is: " + oidListObj.data); + let oid = oidListObj.data[0]; + let oid1 = oidListObj.data[1]; + let oidDataBlob = { + data: oid, + }; + let oidDataBlob1 = { + data: oid1, + }; + let entryObj = extensionObj.getEntry( + cert.ExtensionEntryType.EXTENSION_ENTRY_TYPE_ENTRY, + oidDataBlob + ); + expect(entryObj != null && entryObj != undefined).assertTrue(); + console.warn("entryObj data is: " + entryObj.data); + let entryObj1 = extensionObj.getEntry( + cert.ExtensionEntryType.EXTENSION_ENTRY_TYPE_ENTRY_CRITICAL, + oidDataBlob1 + ); + expect(entryObj1 != null && entryObj1 != undefined).assertTrue(); + console.warn("entryObj1 data is: " + entryObj1.data); + } catch (err) { + console.error("getEntry error, error code is: " + err.code); + expect(null).assertFail(); + } + }) + .catch((err) => { + console.error( + "createX509CertExtensionNormalCallback error, error code is: " + + err.code + ); + expect(null).assertFail(); + }); + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_0300 + * @tc.name X509 CertExtension getOidList and getEntry Test 2 + * @tc.desc Create Der CertExtension with Promise Style + * @tc.desc ExtensionOidType is EXTENSION_OID_TYPE_CRITICAL + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_0300", + 0, + async function (done) { + await certPromise + .createX509CertExtensionNormalPromise("certExtensionNormal02") + .then((extensionObj) => { + try { + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let oidListObj = extensionObj.getOidList( + cert.ExtensionOidType.EXTENSION_OID_TYPE_CRITICAL + ); + expect( + oidListObj != null && oidListObj != undefined + ).assertTrue(); + console.warn("oidListObj data is: " + oidListObj.data); + let oid = oidListObj.data[0]; + let oid2 = oidListObj.data[oidListObj.data.length - 1]; + let oidDataBlob = { + data: oid, + }; + let oidDataBlob2 = { + data: oid2, + }; + let entryObj = extensionObj.getEntry( + cert.ExtensionEntryType.EXTENSION_ENTRY_TYPE_ENTRY_CRITICAL, + oidDataBlob + ); + expect(entryObj != null && entryObj != undefined).assertTrue(); + console.warn( + "entryObj data is: " + uInt8ArrayToShowStr(entryObj.data) + ); + let entryObj2 = extensionObj.getEntry( + cert.ExtensionEntryType.EXTENSION_ENTRY_TYPE_ENTRY_VALUE, + oidDataBlob2 + ); + expect(entryObj2 != null && entryObj2 != undefined).assertTrue(); + console.warn("entryObj2 data is: " + entryObj2.data); + } catch (err) { + console.error("getEntry error, error code is: " + err.code); + expect(null).assertFail(); + } + }) + .catch((err) => { + console.error( + "createX509CertExtensionNormalPromise error, error code is: " + + err.code + ); + expect(null).assertFail(); + }); + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_0400 + * @tc.name X509 CertExtension getOidList and getEntry Test 3 + * @tc.desc Create Der CertExtension with Callback Style + * @tc.desc ExtensionOidType is EXTENSION_OID_TYPE_UNCRITICAL + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_0400", + 0, + async function (done) { + await certCallback + .createX509CertExtensionNormalCallback("certExtensionNormal02") + .then((extensionObj) => { + try { + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let oidListObj = extensionObj.getOidList( + cert.ExtensionOidType.EXTENSION_OID_TYPE_UNCRITICAL + ); + expect( + oidListObj != null && oidListObj != undefined + ).assertTrue(); + console.warn("oidListObj data is: " + oidListObj.data); + let oid1 = oidListObj.data[1]; + let oid2 = oidListObj.data[oidListObj.data.length - 1]; + let oidDataBlob1 = { + data: oid1, + }; + let oidDataBlob2 = { + data: oid2, + }; + let entryObj1 = extensionObj.getEntry( + cert.ExtensionEntryType.EXTENSION_ENTRY_TYPE_ENTRY, + oidDataBlob1 + ); + expect(entryObj1 != null && entryObj1 != undefined).assertTrue(); + console.warn( + "entryObj1 data is: " + uInt8ArrayToShowStr(entryObj1.data) + ); + let entryObj2 = extensionObj.getEntry( + cert.ExtensionEntryType.EXTENSION_ENTRY_TYPE_ENTRY_VALUE, + oidDataBlob2 + ); + expect(entryObj2 != null && entryObj2 != undefined).assertTrue(); + console.warn( + "entryObj2 data is: " + uInt8ArrayToShowStr(entryObj2.data) + ); + } catch (err) { + console.error("getEntry error, error code is: " + err.code); + expect(null).assertFail(); + } + }) + .catch((err) => { + console.error( + "createX509CertExtensionNormalCallback error, error code is: " + + err.code + ); + expect(null).assertFail(); + }); + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_0500 + * @tc.name X509 CertExtension checkCA Test 1 + * @tc.desc Use callback style + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_0500", + 0, + async function (done) { + await certCallback + .createX509CertExtensionNormalCallback("certExtensionNormal02") + .then((extensionObj) => { + try { + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let caStatus = extensionObj.checkCA(); + console.warn("caStatus is: " + caStatus); + expect(caStatus > 0).assertTrue(); + } catch (err) { + console.error("checkCA error, error code is: " + err.code); + expect(null).assertFail(); + } + }) + .catch((err) => { + console.error( + "createX509CertExtensionNormalCallback error, error code is: " + + err.code + ); + expect(null).assertFail(); + }); + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_0600 + * @tc.name X509 CertExtension Test With Invalid Parm + * @tc.desc Create Der CertExtension with Promise Style + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_0600", + 0, + async function (done) { + await certPromise + .createX509CertExtensionNormalPromise("certExtensioninvalid01") + .then((extensionObj) => { + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + }) + .catch((err) => { + console.error( + "createX509CertExtensionNormalPromise error, error code is: " + + err.code + ); + expect(err.code == 401).assertTrue(); + }); + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_0700 + * @tc.name X509 CertExtension getOidList Test With Invalid Param 1 + * @tc.desc Create Der CertExtension with Callback Style + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_0700", + 0, + async function (done) { + try { + let extensionObj = + await certCallback.createX509CertExtensionNormalCallback( + "certExtensionNormal02" + ); + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let oidListObj = extensionObj.getOidList(3); + expect(oidListObj != null && oidListObj != undefined).assertTrue(); + } catch (err) { + console.error("getOidList error , error code is: " + err.code); + expect(err.code == 401).assertTrue(); + } + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_0800 + * @tc.name X509 CertExtension getOidList Test With Invalid Param 2 + * @tc.desc Create Der CertExtension with Callback Style + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_0800", + 0, + async function (done) { + try { + let extensionObj = + await certCallback.createX509CertExtensionNormalCallback( + "certExtensionNormal02" + ); + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let oidListObj = extensionObj.getOidList(); + expect(oidListObj != null && oidListObj != undefined).assertTrue(); + } catch (err) { + console.error("getOidList error , error code is: " + err.code); + expect(err.code == 401).assertTrue(); + } + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_0900 + * @tc.name X509 CertExtension getOidList Test With Invalid Param 3 + * @tc.desc Create Der CertExtension with Callback Style + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_0900", + 0, + async function (done) { + try { + let extensionObj = + await certCallback.createX509CertExtensionNormalCallback( + "certExtensionNormal02" + ); + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let oidListObj = extensionObj.getOidList( + cert.ExtensionOidType.EXTENSION_OID_TYPE_UNCRITICAL, + "" + ); + expect(oidListObj != null && oidListObj != undefined).assertTrue(); + } catch (err) { + console.error("getOidList error , error code is: " + err.code); + expect(err.code == 401).assertTrue(); + } + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_1000 + * @tc.name X509 CertExtension getEntry Test With Invalid Param 1 + * @tc.desc Create Der CertExtension with Promise Style + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_1000", + 0, + async function (done) { + try { + let extensionObj = + await certPromise.createX509CertExtensionNormalPromise( + "certExtensionNormal02" + ); + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let oid = new Uint8Array([50, 60, 70]); + let oidDataBlob = { + data: oid, + }; + let entryObj = extensionObj.getEntry( + cert.ExtensionEntryType.EXTENSION_ENTRY_TYPE_ENTRY, + oidDataBlob + ); + expect(entryObj != null && entryObj != undefined).assertTrue(); + } catch (err) { + console.error("getEntry error , error code is: " + err.code); + expect(err.code == 401).assertTrue(); + } + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_1100 + * @tc.name X509 CertExtension getEntry Test With Invalid Param 2 + * @tc.desc Create Der CertExtension with Promise Style + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_1100", + 0, + async function (done) { + try { + let extensionObj = + await certPromise.createX509CertExtensionNormalPromise( + "certExtensionNormal02" + ); + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let oidListObj = extensionObj.getOidList( + cert.ExtensionOidType.EXTENSION_OID_TYPE_UNCRITICAL + ); + expect(oidListObj != null && oidListObj != undefined).assertTrue(); + let oid = oidListObj.data[1]; + let oidDataBlob = { + data: oid, + }; + let entryObj = extensionObj.getEntry(3, oidDataBlob); + expect(entryObj != null && entryObj != undefined).assertTrue(); + } catch (err) { + console.error("getEntry error , error code is: " + err.code); + expect(err.code == 401).assertTrue(); + } + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_1200 + * @tc.name X509 CertExtension getEntry Test With Invalid Param 3 + * @tc.desc Create Der CertExtension with Promise Style + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_1200", + 0, + async function (done) { + try { + let extensionObj = + await certPromise.createX509CertExtensionNormalPromise( + "certExtensionNormal02" + ); + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let oidListObj = extensionObj.getOidList( + cert.ExtensionOidType.EXTENSION_OID_TYPE_UNCRITICAL + ); + expect(oidListObj != null && oidListObj != undefined).assertTrue(); + let oid = oidListObj.data[1]; + let oidDataBlob = { + data: oid, + }; + let entryObj = extensionObj.getEntry(oidDataBlob); + expect(entryObj != null && entryObj != undefined).assertTrue(); + } catch (err) { + console.error("getEntry error , error code is: " + err.code); + expect(err.code == 401).assertTrue(); + } + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_1300 + * @tc.name X509 CertExtension getEntry Test With Invalid Param 4 + * @tc.desc Create Der CertExtension with Promise Style + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_1300", + 0, + async function (done) { + try { + let extensionObj = + await certPromise.createX509CertExtensionNormalPromise( + "certExtensionNormal02" + ); + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let entryObj = extensionObj.getEntry( + cert.ExtensionEntryType.EXTENSION_ENTRY_TYPE_ENTRY + ); + expect(entryObj != null && entryObj != undefined).assertTrue(); + } catch (err) { + console.error("getEntry error , error code is: " + err.code); + expect(err.code == 401).assertTrue(); + } + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_1400 + * @tc.name X509 CertExtension getEntry Test With Invalid Param 5 + * @tc.desc Create Der CertExtension with Promise Style + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_1400", + 0, + async function (done) { + try { + let extensionObj = + await certPromise.createX509CertExtensionNormalPromise( + "certExtensionNormal02" + ); + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let oid1 = new Uint8Array([0, 50, 46, 53, 46, 50, 57, 46, 49, 57]); + console.warn("oid1 source string is: " + uInt8ArrayToString(oid1)); + let oidDataBlob1 = { + data: oid1, + }; + let entryObj = extensionObj.getEntry( + cert.ExtensionEntryType.EXTENSION_ENTRY_TYPE_ENTRY, + oidDataBlob1 + ); + expect(entryObj != null && entryObj != undefined).assertTrue(); + } catch (err) { + console.error("getEntry error , error code is: " + err.code); + expect(err.code == 401).assertTrue(); + } + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_1500 + * @tc.name X509 CertExtension getEncoded Test With Invalid Params + * @tc.desc Create Der CertExtension with Promise Style + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_1500", + 0, + async function (done) { + try { + let extensionObj = + await certPromise.createX509CertExtensionNormalPromise( + "certExtensionNormal01" + ); + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let encodedObj = extensionObj.getEncoded(""); + expect(encodedObj != null && encodedObj != undefined).assertTrue(); + } catch (err) { + console.error("getEncoded error , error code is: " + err.code); + expect(err.code == 401).assertTrue(); + } + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_1600 + * @tc.name X509 CertExtension checkCA Test With Invalid Param 1 + * @tc.desc Use callback style + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_1600", + 0, + async function (done) { + try { + let extensionObj = + await certCallback.createX509CertExtensionNormalCallback( + "certExtensionNormal01" + ); + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let encodedObj = extensionObj.checkCA(""); + expect(encodedObj != null && encodedObj != undefined).assertTrue(); + } catch (err) { + console.error("checkCA error , error code is: " + err.code); + expect(err.code == 401).assertTrue(); + } + done(); + } + ); + + /** + * @tc.number Security_CertificateFramework_CertExtensionTest_Func_1700 + * @tc.name X509 CertExtension checkCA Test With Invalid Param 2 + * @tc.desc Use callback style + */ + it( + "Security_CertificateFramework_CertExtensionTest_Func_1700", + 0, + async function (done) { + try { + let extensionObj = + await certCallback.createX509CertExtensionNormalCallback( + "certExtensionInvalid02" + ); + expect( + extensionObj != null && extensionObj != undefined + ).assertTrue(); + let encodedObj = extensionObj.checkCA(); + expect(encodedObj != null && encodedObj != undefined).assertTrue(); + } catch (err) { + console.error("checkCA error , error code is: " + err.code); + expect(err.code == 19030001).assertTrue(); + } + done(); + } + ); + }); +} diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/test/List.test.js b/security/certificate_framework/js_api_test_oh40/src/main/js/test/List.test.js new file mode 100644 index 000000000..85221e816 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/test/List.test.js @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2022-2023 Huawei Device Co., Ltd. + * 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. + */ + +import CertFrameworkFuncTestJSUnit from "./CertificateFunc.test"; + +export default function testsuite() { + CertFrameworkFuncTestJSUnit(); +} diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificateCallback.js b/security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificateCallback.js new file mode 100644 index 000000000..fc907803f --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificateCallback.js @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2023 Huawei Device Co., Ltd. + * 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. + */ + +import cert from "@ohos.security.cert"; +import { stringTouInt8Array } from "../common/publicDoString"; +import * as param from "../common/publicParam"; + +async function createX509CertInstanceCallback(certType) { + var certFormat; + var encodingData; + + if (certType == "der") { + certFormat = cert.EncodingFormat.FORMAT_DER; + encodingData = new Uint8Array(param.certDataDER01); + } else { + certFormat = cert.EncodingFormat.FORMAT_PEM; + encodingData = stringTouInt8Array(param.certDataPEM01); + } + + var encodingBlob = { + data: encodingData, + encodingFormat: certFormat, + }; + + return new Promise((resolve, reject) => { + cert.createX509Cert(encodingBlob, (err, data) => { + if (data == null) { + console.error( + "[callback] create X509 Cert failed! err code: " + err.code + ); + reject(err); + } else { + console.warn( + "[callback] create X509 Cert success! format is: " + certFormat + ); + resolve(data); + } + }); + }); +} + +async function createX509CertExtensionNormalCallback(flag) { + let encodingData = ""; + let certFormat = cert.EncodingFormat.FORMAT_DER; + + switch (flag) { + case "certExtensionNormal01": + encodingData = new Uint8Array(param.certExtensionNormal01); + break; + case "certExtensionNormal02": + encodingData = new Uint8Array(param.certExtensionNormal02); + break; + case "certExtensionInvalid01": + encodingData = new Uint8Array(param.certExtensionInvalid01); + break; + case "certExtensionInvalid02": + encodingData = new Uint8Array(param.certExtensionInvalid02); + break; + default: + break; + } + + var encodingBlob = { + data: encodingData, + encodingFormat: certFormat, + }; + + return new Promise((resolve, reject) => { + cert.createCertExtension(encodingBlob, (err, extensionObj) => { + if (err) { + console.error( + "[callback] create X509 CertExtension failed! err code: " + err.code + ); + reject(err); + } else { + console.warn( + "[callback] create X509 CertExtension success! format is: " + + certFormat + ); + resolve(extensionObj); + } + }); + }); +} + +export { + createX509CertInstanceCallback, + createX509CertExtensionNormalCallback, +}; diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificateCommon.js b/security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificateCommon.js new file mode 100644 index 000000000..e9168a90c --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificateCommon.js @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2023 Huawei Device Co., Ltd. + * 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. + */ + +import { expect } from "@ohos/hypium"; +import cert from "@ohos.security.cert"; + +function certificateEnumTypeTest() { + expect(cert.CertResult.INVALID_PARAMS).assertEqual(401); + expect(cert.CertResult.NOT_SUPPORT).assertEqual(801); + expect(cert.CertResult.ERR_OUT_OF_MEMORY).assertEqual(19020001); + expect(cert.CertResult.ERR_RUNTIME_ERROR).assertEqual(19020002); + expect(cert.CertResult.ERR_CRYPTO_OPERATION).assertEqual(19030001); + expect(cert.CertResult.ERR_CERT_SIGNATURE_FAILURE).assertEqual(19030002); + expect(cert.CertResult.ERR_CERT_NOT_YET_VALID).assertEqual(19030003); + expect(cert.CertResult.ERR_CERT_HAS_EXPIRED).assertEqual(19030004); + expect(cert.CertResult.ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY).assertEqual( + 19030005 + ); + expect(cert.CertResult.ERR_KEYUSAGE_NO_CERTSIGN).assertEqual(19030006); + expect(cert.CertResult.ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE).assertEqual( + 19030007 + ); + + expect(cert.EncodingFormat.FORMAT_DER).assertEqual(0); + expect(cert.EncodingFormat.FORMAT_PEM).assertEqual(1); + + expect(cert.CertItemType.CERT_ITEM_TYPE_TBS).assertEqual(0); + expect(cert.CertItemType.CERT_ITEM_TYPE_PUBLIC_KEY).assertEqual(1); + expect(cert.CertItemType.CERT_ITEM_TYPE_ISSUER_UNIQUE_ID).assertEqual(2); + expect(cert.CertItemType.CERT_ITEM_TYPE_SUBJECT_UNIQUE_ID).assertEqual(3); + expect(cert.CertItemType.CERT_ITEM_TYPE_EXTENSIONS).assertEqual(4); + + expect(cert.ExtensionOidType.EXTENSION_OID_TYPE_ALL).assertEqual(0); + expect(cert.ExtensionOidType.EXTENSION_OID_TYPE_CRITICAL).assertEqual(1); + expect(cert.ExtensionOidType.EXTENSION_OID_TYPE_UNCRITICAL).assertEqual(2); + + expect(cert.ExtensionEntryType.EXTENSION_ENTRY_TYPE_ENTRY).assertEqual(0); + expect( + cert.ExtensionEntryType.EXTENSION_ENTRY_TYPE_ENTRY_CRITICAL + ).assertEqual(1); + expect(cert.ExtensionEntryType.EXTENSION_ENTRY_TYPE_ENTRY_VALUE).assertEqual( + 2 + ); +} + +function getX509CertItem(certObject, itemType) { + let uint8Data = certObject.getItem(itemType); + return uint8Data; +} + +export { certificateEnumTypeTest, getX509CertItem }; diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificatePromise.js b/security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificatePromise.js new file mode 100644 index 000000000..6b4ad8570 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificatePromise.js @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2023 Huawei Device Co., Ltd. + * 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. + */ + +import cert from "@ohos.security.cert"; +import { stringTouInt8Array } from "../common/publicDoString"; +import * as param from "../common/publicParam"; + +async function createX509CertInstancePromise(certType) { + var certformat; + var encodingData; + + if (certType == "der") { + certformat = cert.EncodingFormat.FORMAT_DER; + encodingData = new Uint8Array(param.certDataDER01); + } else { + certformat = cert.EncodingFormat.FORMAT_PEM; + encodingData = stringTouInt8Array(param.certDataPEM01); + } + + var encodingBlob = { + data: encodingData, + encodingFormat: certformat, + }; + + return new Promise((resolve, reject) => { + cert + .createX509Cert(encodingBlob) + .then((data) => { + console.warn( + "[promise] create X509 Cert success! format is: " + certformat + ); + resolve(data); + }) + .catch((err) => { + console.error( + "[promise] create X509 Cert failed! error code is: " + err.code + ); + reject(err); + }); + }); +} + +async function createX509CertExtensionNormalPromise(flag) { + let encodingData = ""; + let certFormat = cert.EncodingFormat.FORMAT_DER; + + switch (flag) { + case "certExtensionNormal01": + encodingData = new Uint8Array(param.certExtensionNormal01); + break; + case "certExtensionNormal02": + encodingData = new Uint8Array(param.certExtensionNormal02); + break; + case "certExtensionInvalid01": + encodingData = new Uint8Array(param.certExtensionInvalid01); + break; + case "certExtensionInvalid02": + encodingData = new Uint8Array(param.certExtensionInvalid02); + break; + default: + break; + } + + var encodingBlob = { + data: encodingData, + encodingFormat: certFormat, + }; + + return new Promise((resolve, reject) => { + cert + .createCertExtension(encodingBlob) + .then((extensionObj) => { + console.warn( + "[promise] create X509 CertExtension success! format is: " + + certFormat + ); + resolve(extensionObj); + }) + .catch((err) => { + console.error( + "[promise] create X509 CertExtension failed! error code is: " + + err.code + ); + reject(err); + }); + }); +} + +export { createX509CertInstancePromise, createX509CertExtensionNormalPromise }; diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/common/publicDoString.js b/security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/common/publicDoString.js new file mode 100644 index 000000000..ab04e2e02 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/common/publicDoString.js @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2022-2023 Huawei Device Co., Ltd. + * 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. + */ + +function stringToArray(str) { + var arr = []; + for (var i = 0, j = str.length; i < j; ++i) { + arr.push(str.charCodeAt(i)); + } + return arr; +} + +//字节流转成可理解的字符串 +function uInt8ArrayToString(fileData) { + var dataString = ""; + for (var i = 0; i < fileData.length; i++) { + dataString += String.fromCharCode(fileData[i]); + } + return dataString; +} + +//可理解的字符串转成自字节流 +function stringTouInt8Array(str) { + if (str.length == 0) { + console.error("stringTouInt8Array length is 0"); + } + var arr = []; + for (var i = 0, j = str.length; i < j; ++i) { + arr.push(str.charCodeAt(i)); + } + var tmpUint8Array = new Uint8Array(arr); + return tmpUint8Array; +} + +//字节流以16进制形式输出 +function uInt8ArrayToShowStr(uInt8Array) { + if (uInt8Array.length == 0) { + console.error("uInt8ArrayToShowStr length is 0"); + } + return Array.prototype.map + .call(uInt8Array, (x) => ("00" + x.toString(16)).slice(-2)) + .join(""); +} + +export { + stringToArray, + uInt8ArrayToString, + stringTouInt8Array, + uInt8ArrayToShowStr, +}; diff --git a/security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/common/publicParam.js b/security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/common/publicParam.js new file mode 100644 index 000000000..a86ec31e4 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/common/publicParam.js @@ -0,0 +1,175 @@ +/* + * Copyright (C) 2023 Huawei Device Co., Ltd. + * 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. + */ + +var certDataDER01 = [ + 0x30, 0x82, 0x03, 0x4c, 0x30, 0x82, 0x02, 0x34, 0xa0, 0x03, 0x02, 0x01, 0x02, + 0x02, 0x06, 0x20, 0x06, 0x05, 0x16, 0x70, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, + 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x3b, 0x31, + 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x52, 0x4f, 0x31, + 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x63, 0x65, 0x72, + 0x74, 0x53, 0x49, 0x47, 0x4e, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, + 0x0b, 0x13, 0x10, 0x63, 0x65, 0x72, 0x74, 0x53, 0x49, 0x47, 0x4e, 0x20, 0x52, + 0x4f, 0x4f, 0x54, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x36, 0x30, + 0x37, 0x30, 0x34, 0x31, 0x37, 0x32, 0x30, 0x30, 0x34, 0x5a, 0x17, 0x0d, 0x33, + 0x31, 0x30, 0x37, 0x30, 0x34, 0x31, 0x37, 0x32, 0x30, 0x30, 0x34, 0x5a, 0x30, + 0x3b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x52, + 0x4f, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x63, + 0x65, 0x72, 0x74, 0x53, 0x49, 0x47, 0x4e, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, + 0x55, 0x04, 0x0b, 0x13, 0x10, 0x63, 0x65, 0x72, 0x74, 0x53, 0x49, 0x47, 0x4e, + 0x20, 0x52, 0x4f, 0x4f, 0x54, 0x20, 0x43, 0x41, 0x30, 0x82, 0x01, 0x22, 0x30, + 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, + 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, + 0x01, 0x00, 0xb7, 0x33, 0xb9, 0x7e, 0xc8, 0x25, 0x4a, 0x8e, 0xb5, 0xdb, 0xb4, + 0x28, 0x1b, 0xaa, 0x57, 0x90, 0xe8, 0xd1, 0x22, 0xd3, 0x64, 0xba, 0xd3, 0x93, + 0xe8, 0xd4, 0xac, 0x86, 0x61, 0x40, 0x6a, 0x60, 0x57, 0x68, 0x54, 0x84, 0x4d, + 0xbc, 0x6a, 0x54, 0x02, 0x05, 0xff, 0xdf, 0x9b, 0x9a, 0x2a, 0xae, 0x5d, 0x07, + 0x8f, 0x4a,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 0x00, 0x1a, 0x5b, 0x28, 0xe3, 0xd2, 0x9c, 0x73, 0x3e, 0x32, 0x87, + 0x98, 0xa1, 0xc9, 0x51, 0x2f, 0xd7, 0xde, 0xac, 0x33, 0xb3, 0x4f, 0x02, 0x03, + 0x01, 0x00, 0x01, 0xa1, 0x08, 0x03, 0x06, 0x01, 0x01, 0x00, 0x4d, 0x57, 0x12, + 0xa2, 0x08, 0x03, 0x06, 0x01, 0x02, 0x03, 0x4d, 0x57, 0x12, 0xa3, 0x42, 0x30, + 0x40, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, + 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, + 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0xc6, 0x30, 0x1d, 0x06, 0x03, 0x55, + 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xe0, 0x8c, 0x9b, 0xdb, 0x25, 0x49, 0xb3, + 0xf1, 0x7c, 0x86, 0xd6, 0xb2, 0x42, 0x87, 0x0b, 0xd0, 0x6b, 0xa0, 0xd9, 0xe4, + 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, + 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x3e, 0xd2, 0x1c, 0x89, 0x2e, 0x35, + 0xfc, 0xf8, 0x75, 0xdd, 0xe6, 0x7f, 0x65, 0x88, 0xf4, 0x72, 0x4c, 0xc9, 0x2c, + 0xd7, 0x32, 0x4e, 0xf3, 0xdd, 0x19, 0x79, 0x47, 0xbd, 0x8e, 0x3b, 0x5b, 0x93, + 0x0f, 0x50, 0x49, 0x24, 0x13, 0x6b, 0x14, 0x06, 0x72, 0xef, 0x09, 0xd3, 0xa1, + 0xa1, 0xe3, 0x40, 0x84, 0xc9, 0xe7, 0x18, 0x32, 0x74, 0x3c, 0x48, 0x6e, 0x0f, + 0x9f, 0x4b, 0xd4, 0xf7, 0x1e, 0xd3, 0x93, 0x86, 0x64, 0x54, 0x97, 0x63, 0x72, + 0x50, 0xd5, 0x55, 0xcf, 0xfa, 0x20, 0x93, 0x02, 0xa2, 0x9b, 0xc3, 0x23, 0x93, + 0x4e, 0x16, 0x55, 0x76, 0xa0, 0x70, 0x79, 0x6d, 0xcd, 0x21, 0x1f, 0xcf, 0x2f, + 0x2d, 0xbc, 0x19, 0xe3, 0x88, 0x31, 0xf8, 0x59, 0x1a, 0x81, 0x09, 0xc8, 0x97, + 0xa6, 0x74, 0xc7, 0x60, 0xc4, 0x5b, 0xcc, 0x57, 0x8e, 0xb2, 0x75, 0xfd, 0x1b, + 0x02, 0x09, 0xdb, 0x59, 0x6f, 0x72, 0x93, 0x69, 0xf7, 0x31, 0x41, 0xd6, 0x88, + 0x38, 0xbf, 0x87, 0xb2, 0xbd, 0x16, 0x79, 0xf9, 0xaa, 0xe4, 0xbe, 0x88, 0x25, + 0xdd, 0x61, 0x27, 0x23, 0x1c, 0xb5, 0x31, 0x07, 0x04, 0x36, 0xb4, 0x1a, 0x90, + 0xbd, 0xa0, 0x74, 0x71, 0x50, 0x89, 0x6d, 0xbc, 0x14, 0xe3, 0x0f, 0x86, 0xae, + 0xf1, 0xab, 0x3e, 0xc7, 0xa0, 0x09, 0xcc, 0xa3, 0x48, 0xd1, 0xe0, 0xdb, 0x64, + 0xe7, 0x92, 0xb5, 0xcf, 0xaf, 0x72, 0x43, 0x70, 0x8b, 0xf9, 0xc3, 0x84, 0x3c, + 0x13, 0xaa, 0x7e, 0x92, 0x9b, 0x57, 0x53, 0x93, 0xfa, 0x70, 0xc2, 0x91, 0x0e, + 0x31, 0xf9, 0x9b, 0x67, 0x5d, 0xe9, 0x96, 0x38, 0x5e, 0x5f, 0xb3, 0x73, 0x4e, + 0x88, 0x15, 0x67, 0xde, 0x9e, 0x76, 0x10, 0x62, 0x20, 0xbe, 0x55, 0x69, 0x95, + 0x43, 0x00, 0x39, 0x4d, 0xf6, 0xee, 0xb0, 0x5a, 0x4e, 0x49, 0x44, 0x54, 0x58, + 0x5f, 0x42, 0x83, +]; + +var certDataPEM01 = + "-----BEGIN CERTIFICATE-----\n" + + "MIID/jCCAuagAwIBAgIBATANBgkqhkiG9w0BAQsFADCBjDELMAkGA1UEBhMCQ04x\n" + + "ETAPBgNVBAgMCHNoYW5naGFpMQ8wDQYDVQQHDAZodWF3ZWkxFTATBgNVBAoMDHd3\n" + + "dy50ZXN0LmNvbTENMAsGA1UECwwEdGVzdDEVMBMGA1UEAwwMd3d3LnRlc3QuY29t\n" + + "MRwwGgYJKoZIhvcNAQkBFg10ZXN0QHRlc3QuY29tMB4XDTIyMDgyOTA2NTUwM1oX\n" + + "DTIzMDgyOTA2NTUwM1owezELMAkGA1UEBhMCQ04xETAPBgNVBAgMCHNoYW5naGFp\n" + + "MRUwEwYDVQQKDAx3d3cudGVzdC5jb20xDTALBgNVBAsMBHRlc3QxFTATBgNVBAMM\n" + + "DHd3dy50ZXN0LmNvbTEcMBoGCSqGSIb3DQEJARYNdGVzdEB0ZXN0LmNvbTCCASIw\n" + + "DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJmY9T4SzXXwKvfMvnvMWY7TqUJK\n" + + "jnWf2Puv0YUQ2fdvyoKQ2LQXdtzoUL53j587oI+IXelOr7dg020zPyun0cmZHZ4y\n" + + "l/qAcrWbDjZeEGcbbb5UtQtn1WOEnv8pkXluO355mbZQUKK9L3gFWseXJKGbIXw0\n" + + "NRpaJZzqvPor4m3a5pmJKPHOlivUdYfLaKSkNj3DlaFzCWKV82k5ee6gzVyETtG+\n" + + "XN+vq8qLybT+fIFsLNMmAHzRxlqz3NiH7yh+1/p/Knvf8bkkRVR2btH51RyX2RSu\n" + + "DjPM0/VRL8fxDSDeWBq+Gvn/E6AbOVMmkx63tcyWHhklCSaZtyz7kq39TQMCAwEA\n" + + "AaN7MHkwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0\n" + + "ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFFiFDysfADQCzRZCOSPupQxFicwzMB8G\n" + + "A1UdIwQYMBaAFNYQRQiPsG8HefOTsmsVhaVjY7IPMA0GCSqGSIb3DQEBCwUAA4IB\n" + + "AQAeppxf6sKQJxJQXKPTT3xHKaskidNwDBbOSIvnVvWXicZXDs+1sF6tUaRgvPxL\n" + + "OL58+P2Jy0tfSwj2WhqQRGe9MvQ5iFHcdelZc0ciW6EQ0VDHIaDAQc2nQzej/79w\n" + + "UE7BJJV3b9n1be2iCsuodKO14pOkMb84WcIxng+8SD+MiFqV5BPO1QyKGdO1PE1b\n" + + "+evjyTpFSTgZf2Mw3fGtu5hfEXyHw1lnsFY2MlSwiRlAym/gm4aXy+4H6LyXKd56\n" + + "UYQ6fituD0ziaw3RI6liyIe7aENHCkZf6bAvMRhk4QiU4xu6emwX8Qt1bT7RthP0\n" + + "1Vsro0IOeXT9WAcqEtQUegsi\n" + + "-----END CERTIFICATE-----\n"; + +var certExtensionNormal01 = [ + 0x30, 0x40, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, + 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, + 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0xc6, 0x30, 0x1d, 0x06, 0x03, + 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xe0, 0x8c, 0x9b, 0xdb, 0x25, 0x49, + 0xb3, 0xf1, 0x7c, 0x86, 0xd6, 0xb2, 0x42, 0x87, 0x0b, 0xd0, 0x6b, 0xa0, 0xd9, + 0xe4, +]; + +var certExtensionNormal02 = [ + 0x30, 0x81, 0xc6, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, + 0x14, 0x8c, 0xa3, 0x3b, 0x42, 0x63, 0x01, 0xb3, 0x4d, 0x51, 0xf6, 0xe4, 0x2d, + 0xb5, 0x83, 0x7f, 0x18, 0x39, 0x2f, 0xb7, 0xb5, 0x30, 0x1f, 0x06, 0x03, 0x55, + 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x8c, 0xa3, 0x3b, 0x42, 0x63, + 0x01, 0xb3, 0x4d, 0x51, 0xf6, 0xe4, 0x2d, 0xb5, 0x83, 0x7f, 0x18, 0x39, 0x2f, + 0xb7, 0xb5, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, + 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x02, 0x30, 0x0b, 0x06, 0x03, + 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, + 0x55, 0x1d, 0x25, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, + 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, + 0x02, 0x30, 0x21, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x1a, 0x30, 0x18, 0x81, + 0x16, 0x63, 0x61, 0x40, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x66, 0x72, 0x61, + 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x21, 0x06, + 0x03, 0x55, 0x1d, 0x12, 0x04, 0x1a, 0x30, 0x18, 0x81, 0x16, 0x63, 0x61, 0x40, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, + 0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6d, +]; + +var certExtensionInvalid01 = [ + 0x40, 0x81, 0xc6, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, + 0x14, 0x8c, 0xa3, 0x3b, 0x42, 0x63, 0x01, 0xb3, 0x4e, 0x51, 0xf9, 0xe4, 0x2d, + 0xb5, 0x83, 0x7f, 0x18, 0x39, 0x2f, 0xb7, 0xb5, 0x30, 0x1f, 0x06, 0x03, 0x55, + 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x8c, 0xa3, 0x3a, 0x42, 0x63, + 0x01, 0xb3, 0x4d, 0x51, 0xf6, 0xe4, 0x2d, 0xb5, 0x83, 0x7f, 0x18, 0x39, 0x2f, + 0xb7, 0xb5, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, + 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x02, 0x30, 0x0b, 0x06, 0x03, + 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x03, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, + 0x55, 0x1d, 0x25, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, + 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, + 0x02, 0x30, 0x21, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x1a, 0x30, 0x18, 0x81, + 0x16, 0x63, 0x61, 0x40, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x66, 0x72, 0x61, + 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x21, 0x06, + 0x03, 0x55, 0x1d, 0x12, 0x04, 0x1a, 0x30, 0x18, 0x82, 0x16, 0x63, 0x61, 0x40, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, + 0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6d, +]; + +var certExtensionInvalid02 = [ + 0x30, 0x51, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, + 0xb7, 0xb3, 0x20, 0x09, 0xd4, 0xcb, 0xea, 0x53, 0xc1, 0xe2, 0xd6, 0x8e, 0xa7, + 0x4a, 0x34, 0x25, 0xf0, 0xce, 0x26, 0xdf, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, + 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xb7, 0xb3, 0x20, 0x09, 0xd4, 0xcb, + 0xea, 0x53, 0xc1, 0xe2, 0xd6, 0x8e, 0xa7, 0x4a, 0x34, 0x25, 0xf0, 0xce, 0x26, + 0xdf, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, + 0x30, 0x03, 0x01, 0x01, 0xff, +]; + +export { + certDataDER01, + certDataPEM01, + certExtensionNormal01, + certExtensionNormal02, + certExtensionInvalid01, + certExtensionInvalid02, +}; diff --git a/security/certificate_framework/js_api_test_oh40/src/main/resources/base/element/color.json b/security/certificate_framework/js_api_test_oh40/src/main/resources/base/element/color.json new file mode 100644 index 000000000..2a604a020 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} diff --git a/security/certificate_framework/js_api_test_oh40/src/main/resources/base/element/string.json b/security/certificate_framework/js_api_test_oh40/src/main/resources/base/element/string.json new file mode 100644 index 000000000..b1240f327 --- /dev/null +++ b/security/certificate_framework/js_api_test_oh40/src/main/resources/base/element/string.json @@ -0,0 +1,28 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "MainAbility_desc", + "value": "description" + }, + { + "name": "MainAbility_label", + "value": "label" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} diff --git a/security/certificate_framework/js_api_test_oh40/src/main/resources/base/media/icon.png b/security/certificate_framework/js_api_test_oh40/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?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