Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d9240f3a
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
d9240f3a
编写于
6月 25, 2023
作者:
O
openharmony_ci
提交者:
Gitee
6月 25, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9058 【OpenHarmony 4.0.8.3】【xts_acts】【安全子系统】【ToD】证书算法库框架新增JS接口,补充相应XTS测试套
Merge pull request !9058 from 黄坤/qwink20230621
上级
9491bb09
d97d6ec2
变更
31
展开全部
隐藏空白更改
内联
并排
Showing
31 changed file
with
2022 addition
and
1 deletion
+2022
-1
security/BUILD.gn
security/BUILD.gn
+1
-0
security/certificate_framework/js_api_test_oh40/BUILD.gn
security/certificate_framework/js_api_test_oh40/BUILD.gn
+36
-0
security/certificate_framework/js_api_test_oh40/Test.json
security/certificate_framework/js_api_test_oh40/Test.json
+32
-0
security/certificate_framework/js_api_test_oh40/signature/openharmony_sx.p7b
...e_framework/js_api_test_oh40/signature/openharmony_sx.p7b
+0
-0
security/certificate_framework/js_api_test_oh40/src/main/config.json
...rtificate_framework/js_api_test_oh40/src/main/config.json
+85
-0
security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/app.js
...framework/js_api_test_oh40/src/main/js/MainAbility/app.js
+24
-0
security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/i18n/en-US.json
.../js_api_test_oh40/src/main/js/MainAbility/i18n/en-US.json
+7
-0
security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/i18n/zh-CN.json
.../js_api_test_oh40/src/main/js/MainAbility/i18n/zh-CN.json
+7
-0
security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.css
...i_test_oh40/src/main/js/MainAbility/pages/index/index.css
+30
-0
security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.hml
...i_test_oh40/src/main/js/MainAbility/pages/index/index.hml
+5
-0
security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.js
...pi_test_oh40/src/main/js/MainAbility/pages/index/index.js
+24
-0
security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/app.js
...framework/js_api_test_oh40/src/main/js/TestAbility/app.js
+31
-0
security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/i18n/en-US.json
.../js_api_test_oh40/src/main/js/TestAbility/i18n/en-US.json
+7
-0
security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/i18n/zh-CN.json
.../js_api_test_oh40/src/main/js/TestAbility/i18n/zh-CN.json
+7
-0
security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.css
...i_test_oh40/src/main/js/TestAbility/pages/index/index.css
+30
-0
security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.hml
...i_test_oh40/src/main/js/TestAbility/pages/index/index.hml
+5
-0
security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.js
...pi_test_oh40/src/main/js/TestAbility/pages/index/index.js
+23
-0
security/certificate_framework/js_api_test_oh40/src/main/js/TestRunner/OpenHarmonyTestRunner.js
...test_oh40/src/main/js/TestRunner/OpenHarmonyTestRunner.js
+70
-0
security/certificate_framework/js_api_test_oh40/src/main/js/test/CertificateFunc.test.js
...js_api_test_oh40/src/main/js/test/CertificateFunc.test.js
+992
-0
security/certificate_framework/js_api_test_oh40/src/main/js/test/List.test.js
..._framework/js_api_test_oh40/src/main/js/test/List.test.js
+20
-0
security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificateCallback.js
...in/js/test/utils/certificate/publicCertificateCallback.js
+101
-0
security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificateCommon.js
...main/js/test/utils/certificate/publicCertificateCommon.js
+63
-0
security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificatePromise.js
...ain/js/test/utils/certificate/publicCertificatePromise.js
+101
-0
security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/common/publicDoString.js
...test_oh40/src/main/js/test/utils/common/publicDoString.js
+61
-0
security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/common/publicParam.js
...pi_test_oh40/src/main/js/test/utils/common/publicParam.js
+175
-0
security/certificate_framework/js_api_test_oh40/src/main/resources/base/element/color.json
..._api_test_oh40/src/main/resources/base/element/color.json
+8
-0
security/certificate_framework/js_api_test_oh40/src/main/resources/base/element/string.json
...api_test_oh40/src/main/resources/base/element/string.json
+28
-0
security/certificate_framework/js_api_test_oh40/src/main/resources/base/media/icon.png
...k/js_api_test_oh40/src/main/resources/base/media/icon.png
+0
-0
security/certificate_framework/js_api_test_oh40/src/main/resources/en_US/element/string.json
...pi_test_oh40/src/main/resources/en_US/element/string.json
+24
-0
security/certificate_framework/js_api_test_oh40/src/main/resources/zh_CN/element/string.json
...pi_test_oh40/src/main/resources/zh_CN/element/string.json
+24
-0
security/certificate_framework/js_api_test_one/BUILD.gn
security/certificate_framework/js_api_test_one/BUILD.gn
+1
-1
未找到文件。
security/BUILD.gn
浏览文件 @
d9240f3a
...
...
@@ -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",
...
...
security/certificate_framework/js_api_test_oh40/BUILD.gn
0 → 100644
浏览文件 @
d9240f3a
# 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"
}
security/certificate_framework/js_api_test_oh40/Test.json
0 → 100644
浏览文件 @
d9240f3a
{
"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"
]
}
]
}
security/certificate_framework/js_api_test_oh40/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
d9240f3a
文件已添加
security/certificate_framework/js_api_test_oh40/src/main/config.json
0 → 100644
浏览文件 @
d9240f3a
{
"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"
}
}
}
security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/app.js
0 → 100644
浏览文件 @
d9240f3a
/*
* 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
"
);
},
};
security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/i18n/en-US.json
0 → 100644
浏览文件 @
d9240f3a
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
},
"Files"
:
{}
}
\ No newline at end of file
security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/i18n/zh-CN.json
0 → 100644
浏览文件 @
d9240f3a
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
},
"Files"
:
{}
}
\ No newline at end of file
security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.css
0 → 100644
浏览文件 @
d9240f3a
.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
;
}
}
security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.hml
0 → 100644
浏览文件 @
d9240f3a
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
security/certificate_framework/js_api_test_oh40/src/main/js/MainAbility/pages/index/index.js
0 → 100644
浏览文件 @
d9240f3a
/*
* 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
"
);
},
};
security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/app.js
0 → 100644
浏览文件 @
d9240f3a
/*
* 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
"
);
},
};
security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/i18n/en-US.json
0 → 100644
浏览文件 @
d9240f3a
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
},
"Files"
:
{}
}
security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/i18n/zh-CN.json
0 → 100644
浏览文件 @
d9240f3a
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
},
"Files"
:
{}
}
security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.css
0 → 100644
浏览文件 @
d9240f3a
.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
;
}
}
security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.hml
0 → 100644
浏览文件 @
d9240f3a
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
security/certificate_framework/js_api_test_oh40/src/main/js/TestAbility/pages/index/index.js
0 → 100644
浏览文件 @
d9240f3a
/*
* 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
"
);
},
};
security/certificate_framework/js_api_test_oh40/src/main/js/TestRunner/OpenHarmonyTestRunner.js
0 → 100644
浏览文件 @
d9240f3a
/*
* 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
??
""
);
});
},
};
security/certificate_framework/js_api_test_oh40/src/main/js/test/CertificateFunc.test.js
0 → 100644
浏览文件 @
d9240f3a
此差异已折叠。
点击以展开。
security/certificate_framework/js_api_test_oh40/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
d9240f3a
/*
* 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
();
}
security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificateCallback.js
0 → 100644
浏览文件 @
d9240f3a
/*
* 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
,
};
security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificateCommon.js
0 → 100644
浏览文件 @
d9240f3a
/*
* 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
};
security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/certificate/publicCertificatePromise.js
0 → 100644
浏览文件 @
d9240f3a
/*
* 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
};
security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/common/publicDoString.js
0 → 100644
浏览文件 @
d9240f3a
/*
* 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
,
};
security/certificate_framework/js_api_test_oh40/src/main/js/test/utils/common/publicParam.js
0 → 100644
浏览文件 @
d9240f3a
/*
* 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
,
0x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
\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
,
};
security/certificate_framework/js_api_test_oh40/src/main/resources/base/element/color.json
0 → 100644
浏览文件 @
d9240f3a
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
}
]
}
security/certificate_framework/js_api_test_oh40/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
d9240f3a
{
"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"
}
]
}
security/certificate_framework/js_api_test_oh40/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
d9240f3a
6.6 KB
security/certificate_framework/js_api_test_oh40/src/main/resources/en_US/element/string.json
0 → 100644
浏览文件 @
d9240f3a
{
"string"
:
[
{
"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"
}
]
}
security/certificate_framework/js_api_test_oh40/src/main/resources/zh_CN/element/string.json
0 → 100644
浏览文件 @
d9240f3a
{
"string"
:
[
{
"name"
:
"module_desc"
,
"value"
:
"模块描述"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"label"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"the test ability"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"test label"
}
]
}
security/certificate_framework/js_api_test_one/BUILD.gn
浏览文件 @
d9240f3a
...
...
@@ -23,7 +23,7 @@ ohos_js_hap_suite("ActsCertificateFrameworkJSNormalTest") {
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsCertificateFrameworkJSNormalTest"
subsystem_name = "security"
part_name = "c
rypto
_framework"
part_name = "c
ertificate
_framework"
}
ohos_js_assets("hjs_demo_js_assets") {
js2abc = true
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录