提交 27d1424b 编写于 作者: H hu-jixiang1

huks code

Signed-off-by: Nhu-jixiang1 <hujixiang1@huawei.com>
Change-Id: I876f5e12aa0f927875c4c65fc1bcb6fd11debfc2
上级 533652d3
# Copyright (C) 2021 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("//test/xts/tools/build/suite.gni")
group("security_huks_abnormal") {
testonly = true
if (is_standard_system) {
deps = [
"huks_agree_abnormal:huksagree_abnormal_js_test",
"huks_derive_abnormal:huksderive_abnormal_js_test",
"huks_hmac_abnormal:hukshmac_abnormal_js_test",
"huks_cipher_abnormal:hukscipher_abnormal_js_test",
"huks_singVerify_abnormal:hukssignverify_abnormal_js_test"
]
}
}
# Copyright (C) 2021 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("huksagree_abnormal_js_test") {
hap_profile = "./entry/src/main/config.json"
deps = [
":huks_js_assets",
":huks_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "huksAgreeAbnormalJSApiTest"
}
ohos_js_assets("huks_js_assets") {
source_dir = "./entry/src/main/js/MainAbility"
}
ohos_resources("huks_js_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for huksAgreeAbnormal js api Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "4200000",
"package": "com.example.huksagreeabnormal",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"huksAgreeAbnormalJSApiTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.huksagreeabnormal",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.huksagreeabnormal",
"name": ".MyApplication",
"mainAbility": "com.example.huksagreeabnormal.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.huksagreeabnormal.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard",
"visible": true,
"isVisible": "true"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 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 {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
},
};
{
"strings": {
"hello": "Hello",
"world": "world",
"start": "test start"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"start": "测试开始"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #ffffff;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url('/common/images/Wallpaper.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #ffffff;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<div class="container">
<text class="title" >
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
\ No newline at end of file
/*
* Copyright (C) 2021 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 { Core, ExpectExtend } from 'deccjsunit/index';
export default {
data: {
title: '',
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
id: 'extend',
});
core.addService('expect', expectExtend);
core.init();
const configService = core.getDefaultService('config');
this.timeout = 300000;
configService.setConfig(this);
console.log('test start');
require('../../../test/List.test');
core.execute();
},
onReady() {},
};
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
}
\ No newline at end of file
/*
* Copyright (C) 2021 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.
*/
require('./Agree/SecurityHuksAbnormalAgreeJsunit.test');
# Copyright (C) 2021 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("hukscipher_abnormal_js_test") {
hap_profile = "./entry/src/main/config.json"
deps = [
":huks_js_assets",
":huks_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "huksCipherAbnormalJSApiTest"
}
ohos_js_assets("huks_js_assets") {
source_dir = "./entry/src/main/js/MainAbility"
}
ohos_resources("huks_js_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for huksCipherAbnormal js api Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "600000",
"package": "com.example.huksCipherbnormal",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"huksCipherAbnormalJSApiTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.huksCipherbnormal",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.huksCipherbnormal",
"name": ".MyApplication",
"mainAbility": "com.example.huksCipherbnormal.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.huksCipherbnormal.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard",
"visible": true,
"isVisible": "true"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 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 {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
},
};
{
"strings": {
"hello": "Hello",
"world": "world",
"start": "test start"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"start": "测试开始"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #ffffff;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url('/common/images/Wallpaper.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #ffffff;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<div class="container">
<text class="title" >
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
\ No newline at end of file
/*
* Copyright (C) 2021 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 { Core, ExpectExtend } from 'deccjsunit/index';
export default {
data: {
title: '',
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
id: 'extend',
});
core.addService('expect', expectExtend);
core.init();
const configService = core.getDefaultService('config');
this.timeout = 3000000;
configService.setConfig(this);
console.log('test start');
require('../../../test/List.test');
core.execute();
},
onReady() {},
};
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
}
\ No newline at end of file
/*
* Copyright (C) 2021 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.
*/
require('./Cipher/SecurityHuksAbnormalCipherJsunit.test');
# Copyright (C) 2021 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("huksderive_abnormal_js_test") {
hap_profile = "./entry/src/main/config.json"
deps = [
":huks_js_assets",
":huks_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "huksDeriveBasicAbnormalJSApiTest"
}
ohos_js_assets("huks_js_assets") {
source_dir = "./entry/src/main/js/MainAbility"
}
ohos_resources("huks_js_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for huksDeriveBasicAbnormal js api Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "4200000",
"package": "com.example.huksderivebasicabnormal",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"huksDeriveBasicAbnormalJSApiTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.huksderivebasicabnormal",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.huksderivebasicabnormal",
"name": ".MyApplication",
"mainAbility": "com.example.huksderivebasicabnormal.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.huksderivebasicabnormal.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard",
"visible": true,
"isVisible": "true"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 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 {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
},
};
{
"strings": {
"hello": "Hello",
"world": "world",
"start": "test start"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"start": "测试开始"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #ffffff;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url('/common/images/Wallpaper.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #ffffff;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<div class="container">
<text class="title" >
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
\ No newline at end of file
/*
* Copyright (C) 2021 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 { Core, ExpectExtend } from 'deccjsunit/index';
export default {
data: {
title: '',
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
id: 'extend',
});
core.addService('expect', expectExtend);
core.init();
const configService = core.getDefaultService('config');
this.timeout = 300000;
configService.setConfig(this);
console.log('test start');
require('../../../test/List.test');
core.execute();
},
onReady() {},
};
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
}
\ No newline at end of file
/*
* Copyright (C) 2021 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.
*/
require('./Derive/SecurityHuksAbnormalDeriveJsunit.test');
# Copyright (C) 2021 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("hukshmac_abnormal_js_test") {
hap_profile = "./entry/src/main/config.json"
deps = [
":huks_js_assets",
":huks_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "huksHmacBasicAbnormalJSApiTest"
}
ohos_js_assets("huks_js_assets") {
source_dir = "./entry/src/main/js/MainAbility"
}
ohos_resources("huks_js_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for huksHmacBasicAbnormal js api Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "600000",
"package": "com.example.huksHmacbasicabnormal",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"huksHmacBasicAbnormalJSApiTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.huksHmacbasicabnormal",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.huksHmacbasicabnormal",
"name": ".MyApplication",
"mainAbility": "com.example.huksHmacbasicabnormal.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.huksHmacbasicabnormal.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard",
"visible": true,
"isVisible": "true"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 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 {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
},
};
{
"strings": {
"hello": "Hello",
"world": "world",
"start": "test start"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"start": "测试开始"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #ffffff;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url('/common/images/Wallpaper.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #ffffff;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<div class="container">
<text class="title" >
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
\ No newline at end of file
/*
* Copyright (C) 2021 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 { Core, ExpectExtend } from 'deccjsunit/index';
export default {
data: {
title: '',
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
id: 'extend',
});
core.addService('expect', expectExtend);
core.init();
const configService = core.getDefaultService('config');
this.timeout = 300000;
configService.setConfig(this);
console.log('test start');
require('../../../test/List.test');
core.execute();
},
onReady() {},
};
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
}
\ No newline at end of file
/*
* Copyright (C) 2021 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, it, expect, beforeEach } from 'deccjsunit/index';
import huks from '@ohos.security.huks';
import Data from '../../../../../../../utils/Base/data/data.json';
import * as Params from '../../../../../../../utils/Base/data/params';
import * as Tools from '../../../../../../../utils/Base/tools';
let srcData63Kb = Data.Data_63KB;
let srcData64Kb = Data.Data_64KB;
let HuksOptions;
let handle = {};
let HuksHmac = {
HuksKeyAlg: {
tag: Params.HksTag.HKS_TAG_ALGORITHM,
value: Params.HksKeyAlg.HKS_ALG_HMAC,
},
HuksKeyPurpose: {
tag: Params.HksTag.HKS_TAG_PURPOSE,
value: Params.HksKeyPurpose.HKS_KEY_PURPOSE_MAC,
},
HuksKeySIZE: {
tag: Params.HksTag.HKS_TAG_KEY_SIZE,
value: Params.HksKeySize.HKS_KEY_SIZE_512,
},
HuksTagDigestSHA1: {
tag: Params.HksTag.HKS_TAG_DIGEST,
value: Params.HksKeyDigest.HKS_DIGEST_SHA1,
},
};
async function publicHmacGenFunc(srcKeyAlias, HuksOptions) {
HuksOptions.properties.splice(1, 0, {
tag: Params.HksTag.HKS_TAG_KEY_SIZE,
value: Params.HksKeySize.HKS_KEY_SIZE_512,
});
await huks
.generateKey(srcKeyAlias, HuksOptions)
.then((data) => {
console.log(`test generateKey data ${JSON.stringify(data)}`);
expect(data.errorCode == 0).assertTrue();
})
.catch((err) => {
console.log('test err information: ' + JSON.stringify(err));
expect(null).assertFail();
});
HuksOptions.properties.splice(1, 1);
}
async function publicHmacInitFunc(srcKeyAlias, HuksOptions, Type) {
await huks
.init(srcKeyAlias, HuksOptions)
.then(async (data) => {
console.log(`test init data ${JSON.stringify(data)}`);
handle = {
handle1: data.handle1,
handle2: data.handle2,
};
expect(data.errorCode == Type).assertTrue();
})
.catch((err) => {
console.log(`test init err: ${JSON.stringify(err)}`);
expect(null).assertFail();
});
}
async function publicHmacUpdateFunc(handle, HuksOptions, Type) {
let dateSize = 64 * 1024;
let tempHuksOptionsInData = HuksOptions.inData;
let inDataArray = Tools.stringToArray(HuksOptions.inData);
if (inDataArray.length <= dateSize) {
HuksOptions.inData = new Uint8Array(inDataArray);
await update(handle, HuksOptions, Type);
HuksOptions.inData = tempHuksOptionsInData;
} else {
let count = Math.floor(inDataArray.length / dateSize);
let remainder = inDataArray.length % dateSize;
for (let i = 0; i < count; i++) {
HuksOptions.inData = new Uint8Array(
Tools.stringToArray(tempHuksOptionsInData).slice(
dateSize * i,
dateSize * (i + 1)
)
);
await update(handle, HuksOptions, Type);
}
if (remainder !== 0) {
HuksOptions.inData = new Uint8Array(
Tools.stringToArray(tempHuksOptionsInData).slice(
dateSize * count,
inDataArray.length
)
);
await update(handle, HuksOptions, Type);
}
}
}
async function update(handle, HuksOptions, Type) {
await huks
.update(handle, HuksOptions)
.then(async (data) => {
console.log(`test update data ${JSON.stringify(data)}`);
expect(data.errorCode == Type).assertTrue();
})
.catch((err) => {
console.log('test update err information: ' + err);
expect(null).assertFail();
});
}
async function publicHmacFinish(handle, HuksOptions, thirdInderfaceName, Type) {
if (thirdInderfaceName == 'finish') {
HuksOptions.inData = new Uint8Array(Tools.stringToArray('0'));
await huks
.finish(handle, HuksOptions)
.then((data) => {
console.log(`test finish data ${JSON.stringify(data)}`);
expect(data.errorCode == Type).assertTrue();
})
.catch((err) => {
console.log('test finish err information: ' + err);
expect(null).assertFail();
});
} else {
await huks
.abort(handle, HuksOptions)
.then((data) => {
console.log(`test abort data ${JSON.stringify(data)}`);
expect(data.errorCode == Type).assertTrue();
})
.catch((err) => {
console.log('test abort err information: ' + err);
expect(null).assertFail();
});
}
}
async function publicHmacDelete(srcKeyAlias, HuksOptions, Type) {
HuksOptions.properties.splice(1, 0, {
tag: Params.HksTag.HKS_TAG_KEY_SIZE,
value: Params.HksKeySize.HKS_KEY_SIZE_512,
});
await huks
.deleteKey(srcKeyAlias, HuksOptions)
.then((data) => {
console.log(`test deleteKey data ${JSON.stringify(data)}`);
expect(data.errorCode == Type).assertTrue();
})
.catch((err) => {
console.log('test deleteKey err information: ' + JSON.stringify(err));
expect(null).assertFail();
});
}
describe('SecurityHuksAbnormalHmacPromiseJsunit', function () {
beforeEach(function () {
handle = {};
HuksOptions = {
properties: new Array(
HuksHmac.HuksKeyAlg,
HuksHmac.HuksKeyPurpose,
HuksHmac.HuksTagDigestSHA1
),
inData: srcData63Kb,
};
});
it('security_huks_third_abnormal_hmac_1012', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1012';
await publicHmacInitFunc(srcKeyAlias, HuksOptions, -13);
await publicHmacUpdateFunc(handle, HuksOptions, -14);
await publicHmacFinish(handle, HuksOptions, 'finish', -14);
done();
});
it('security_huks_third_abnormal_hmac_1013', 0, async function (done) {
await publicHmacUpdateFunc(handle, HuksOptions, -14);
await publicHmacFinish(handle, HuksOptions, 'finish', -14);
done();
});
it('security_huks_third_abnormal_hmac_1014', 0, async function (done) {
await publicHmacFinish(handle, HuksOptions, 'finish', -14);
done();
});
it('security_huks_third_abnormal_hmac_1015', 0, async function (done) {
await publicHmacFinish(handle, HuksOptions, 'abort', -14);
done();
});
it('security_huks_third_abnormal_hmac_1016', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1016';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
await publicHmacInitFunc(srcKeyAlias, HuksOptions, 0);
await publicHmacFinish(handle, HuksOptions, 'finish', 0);
HuksOptions.inData = srcData63Kb;
await publicHmacUpdateFunc(handle, HuksOptions, -2);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1017', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1017';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
await publicHmacInitFunc(srcKeyAlias, HuksOptions, 0);
await publicHmacFinish(handle, HuksOptions, 'abort', 0);
HuksOptions.inData = srcData63Kb;
await publicHmacUpdateFunc(handle, HuksOptions, -2);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1018', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1018';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
HuksOptions.inData = srcData63Kb;
await publicHmacUpdateFunc(handle, HuksOptions, -14);
await publicHmacFinish(handle, HuksOptions, 'finish', -14);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1019', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1019';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
HuksOptions.inData = srcData63Kb;
await publicHmacUpdateFunc(handle, HuksOptions, -14);
await publicHmacUpdateFunc(handle, HuksOptions, -14);
await publicHmacFinish(handle, HuksOptions, 'finish', -14);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1020', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1020';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
HuksOptions.inData = srcData63Kb;
await publicHmacUpdateFunc(handle, HuksOptions, -14);
await publicHmacFinish(handle, HuksOptions, 'finish', -14);
await publicHmacFinish(handle, HuksOptions, 'finish', -14);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1021', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1021';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
HuksOptions.inData = srcData63Kb;
await publicHmacUpdateFunc(handle, HuksOptions, -14);
await publicHmacFinish(handle, HuksOptions, 'finish', -14);
await publicHmacFinish(handle, HuksOptions, 'abort', -14);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1022', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1022';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
HuksOptions.inData = srcData63Kb;
await publicHmacUpdateFunc(handle, HuksOptions, -14);
await publicHmacFinish(handle, HuksOptions, 'abort', -14);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1023', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1023';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
HuksOptions.inData = srcData63Kb;
await publicHmacUpdateFunc(handle, HuksOptions, -14);
await publicHmacUpdateFunc(handle, HuksOptions, -14);
await publicHmacFinish(handle, HuksOptions, 'abort', -14);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1024', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1024';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
HuksOptions.inData = srcData63Kb;
await publicHmacUpdateFunc(handle, HuksOptions, -14);
await publicHmacFinish(handle, HuksOptions, 'abort', -14);
await publicHmacFinish(handle, HuksOptions, 'abort', -14);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1025', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1025';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
HuksOptions.inData = srcData63Kb;
await publicHmacUpdateFunc(handle, HuksOptions, -14);
await publicHmacFinish(handle, HuksOptions, 'abort', -14);
await publicHmacFinish(handle, HuksOptions, 'finish', -14);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1026', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1026';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
await publicHmacFinish(handle, HuksOptions, 'finish', -14);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1027', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1027';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
await publicHmacFinish(handle, HuksOptions, 'abort', -14);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1028', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1028';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
await publicHmacFinish(handle, HuksOptions, 'finish', -14);
HuksOptions.inData = srcData63Kb;
await publicHmacUpdateFunc(handle, HuksOptions, -14);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1029', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1029';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
await publicHmacFinish(handle, HuksOptions, 'abort', -14);
HuksOptions.inData = srcData63Kb;
await publicHmacUpdateFunc(handle, HuksOptions, -14);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1030', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1030';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
await publicHmacFinish(handle, HuksOptions, 'finish', -14);
await publicHmacFinish(handle, HuksOptions, 'finish', -14);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1031', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1031';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
await publicHmacFinish(handle, HuksOptions, 'abort', -14);
await publicHmacFinish(handle, HuksOptions, 'abort', -14);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1032', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1032';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
await publicHmacInitFunc(srcKeyAlias, HuksOptions, 0);
HuksOptions.inData = srcData64Kb;
await publicHmacUpdateFunc(handle, HuksOptions, 0);
await publicHmacFinish(handle, HuksOptions, 'finish', 0);
HuksOptions.inData = srcData64Kb;
await publicHmacUpdateFunc(handle, HuksOptions, -2);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1033', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1033';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
await publicHmacInitFunc(srcKeyAlias, HuksOptions, 0);
HuksOptions.inData = srcData64Kb;
await publicHmacUpdateFunc(handle, HuksOptions, 0);
await publicHmacFinish(handle, HuksOptions, 'abort', 0);
await publicHmacUpdateFunc(handle, HuksOptions, -2);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1034', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1034';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
await publicHmacInitFunc(srcKeyAlias, HuksOptions, 0);
HuksOptions.inData = srcData64Kb;
await publicHmacUpdateFunc(handle, HuksOptions, 0);
await publicHmacInitFunc(srcKeyAlias, HuksOptions, 0);
await publicHmacUpdateFunc(handle, HuksOptions, 0);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
done();
});
it('security_huks_third_abnormal_hmac_1035', 0, async function (done) {
let srcKeyAlias = 'security_huks_third_abnormal_hmac_1035';
await publicHmacGenFunc(srcKeyAlias, HuksOptions);
await publicHmacInitFunc(srcKeyAlias, HuksOptions, 0);
await publicHmacDelete(srcKeyAlias, HuksOptions, 0);
HuksOptions.inData = srcData63Kb;
await publicHmacUpdateFunc(handle, HuksOptions, 0);
await publicHmacFinish(handle, HuksOptions, 'finish', 0);
done();
});
});
/*
* Copyright (C) 2021 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.
*/
require('./HMAC/SecurityHuksAbnormalHmacJsunit.test');
# Copyright (C) 2021 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("hukssignverify_abnormal_js_test") {
hap_profile = "./entry/src/main/config.json"
deps = [
":huks_js_assets",
":huks_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "huksSignVerifyAbnormalJSApiTest"
}
ohos_js_assets("huks_js_assets") {
source_dir = "./entry/src/main/js/MainAbility"
}
ohos_resources("huks_js_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for huksSignVerifyAbnormal js api Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "21600000",
"package": "com.example.huksSignVerifyabnormal",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"huksSignVerifyAbnormalJSApiTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.huksSignVerifyabnormal",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.huksSignVerifyabnormal",
"name": ".MyApplication",
"mainAbility": "com.example.huksSignVerifyabnormal.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.huksSignVerifyabnormal.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard",
"visible": true,
"isVisible": "true"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 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 {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
},
};
{
"strings": {
"hello": "Hello",
"world": "world",
"start": "test start"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"start": "测试开始"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #ffffff;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url('/common/images/Wallpaper.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #ffffff;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<div class="container">
<text class="title" >
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
\ No newline at end of file
/*
* Copyright (C) 2021 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 { Core, ExpectExtend } from 'deccjsunit/index';
export default {
data: {
title: '',
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
id: 'extend',
});
core.addService('expect', expectExtend);
core.init();
const configService = core.getDefaultService('config');
this.timeout = 3000000;
configService.setConfig(this);
console.log('test start');
require('../../../test/List.test');
core.execute();
},
onReady() {},
};
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
}
\ No newline at end of file
/*
* Copyright (C) 2021 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.
*/
require('./SignVerify/SecurityHuksAbnormalSignVerifyJsunit.test');
/*
* Copyright (C) 2021 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.
*/
let HksKeyPurpose = {
HKS_KEY_PURPOSE_MAC: 128,
HKS_KEY_PURPOSE_SIGN: 4,
HKS_KEY_PURPOSE_VERIFY: 8,
HKS_KEY_PURPOSE_DERIVE: 16,
HKS_KEY_PURPOSE_ENCRYPT: 1,
HKS_KEY_PURPOSE_DECRYPT: 2,
HKS_KEY_PURPOSE_AGREE: 256,
};
let HksKeyPadding = {
HKS_PADDING_NONE: 0,
HKS_PADDING_OAEP: 1,
HKS_PADDING_PSS: 2,
HKS_PADDING_PKCS1_V1_5: 3,
HKS_PADDING_PKCS5: 4,
HKS_PADDING_PKCS7: 5,
};
let HksKeyAlg = {
HKS_ALG_RSA: 1,
HKS_ALG_HMAC: 50,
HKS_ALG_AES: 20,
HKS_ALG_HKDF: 51,
HKS_ALG_PBKDF2: 52,
HKS_ALG_DH: 103,
HKS_ALG_ECDH: 100,
HKS_ALG_X25519: 102,
HKS_ALG_ECC: 2,
HKS_ALG_DSA: 3,
};
let HksTagType = {
HKS_TAG_TYPE_UINT: 2 << 28,
HKS_TAG_TYPE_BYTES: 5 << 28,
HKS_TAG_TYPE_BOOL: 4 << 28,
};
let HksTag = {
HKS_TAG_ALGORITHM: HksTagType.HKS_TAG_TYPE_UINT | 1,
HKS_TAG_PURPOSE: HksTagType.HKS_TAG_TYPE_UINT | 2,
HKS_TAG_KEY_SIZE: HksTagType.HKS_TAG_TYPE_UINT | 3,
HKS_TAG_DIGEST: HksTagType.HKS_TAG_TYPE_UINT | 4,
HKS_TAG_PADDING: HksTagType.HKS_TAG_TYPE_UINT | 5,
HKS_TAG_AGREE_PUBLIC_KEY: HksTagType.HKS_TAG_TYPE_BYTES | 22,
HKS_TAG_KEY_ALIAS: HksTagType.HKS_TAG_TYPE_BYTES | 23,
HKS_TAG_DERIVE_KEY_SIZE: HksTagType.HKS_TAG_TYPE_UINT | 24,
HKS_TAG_KEY_STORAGE_FLAG: HksTagType.HKS_TAG_TYPE_UINT | 1002,
HKS_TAG_IS_KEY_ALIAS: HksTagType.HKS_TAG_TYPE_BOOL | 1001,
HKS_TAG_BLOCK_MODE: HksTagType.HKS_TAG_TYPE_UINT | 6,
HKS_TAG_IV: HksTagType.HKS_TAG_TYPE_BYTES | 10,
HKS_TAG_ASSOCIATED_DATA: HksTagType.HKS_TAG_TYPE_BYTES | 8,
HKS_TAG_NONCE: HksTagType.HKS_TAG_TYPE_BYTES | 9,
HKS_TAG_AE_TAG: HksTagType.HKS_TAG_TYPE_BYTES | 10009,
};
let HksKeyDigest = {
HKS_DIGEST_NONE: 0,
HKS_DIGEST_MD5: 1,
HKS_DIGEST_SHA1: 10,
HKS_DIGEST_SHA224: 11,
HKS_DIGEST_SHA256: 12,
HKS_DIGEST_SHA384: 13,
HKS_DIGEST_SHA512: 14,
};
let HksKeySize = {
DERIVE_KEY_SIZE_32: 32,
HKS_KEY_SIZE_128: 128,
HKS_KEY_SIZE_192: 192,
HKS_KEY_SIZE_224: 224,
HKS_KEY_SIZE_256: 256,
HKS_KEY_SIZE_384: 384,
HKS_KEY_SIZE_512: 512,
HKS_KEY_SIZE_521: 521,
HKS_KEY_SIZE_768: 768,
HKS_KEY_SIZE_1024: 1024,
HKS_KEY_SIZE_2048: 2048,
HKS_KEY_SIZE_3072: 3072,
HKS_KEY_SIZE_4096: 4096,
};
let HksKeyStorageType = {
HKS_STORAGE_TEMP: 0,
HKS_STORAGE_PERSISTENT: 1,
};
let HksCipherMode = {
HKS_MODE_ECB: 1,
HKS_MODE_CBC: 2,
HKS_MODE_CTR: 3,
HKS_MODE_OFB: 4,
HKS_MODE_CCM: 31,
HKS_MODE_GCM: 32,
};
export {
HksKeyPurpose,
HksKeyAlg,
HksTagType,
HksTag,
HksKeyDigest,
HksKeySize,
HksKeyPadding,
HksKeyStorageType,
HksCipherMode,
};
/*
* Copyright (C) 2021 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 stringToUint8Array(str) {
var arr = [];
for (var i = 0, j = str.length; i < j; ++i) {
arr.push(str.charCodeAt(i));
}
var tmpUint8Array = new Uint8Array(arr);
return tmpUint8Array;
}
function uint8ArrayToString(array) {
var dataString = '';
for (var i = 0; i < array.length; i++) {
dataString += String.fromCharCode(array[i]);
}
return dataString;
}
function GetDataRandom() {
var result = '';
for (var i = 0; i < 16; i++) {
result += Math.floor(Math.random() * 10).toString();
}
console.log(`test GetDataRandom ${result}`);
return result;
}
function stringToArray(str) {
var arr = [];
for (var i = 0, j = str.length; i < j; ++i) {
arr.push(str.charCodeAt(i));
}
return arr;
}
export { stringToUint8Array, uint8ArrayToString, GetDataRandom, stringToArray };
......@@ -19,7 +19,7 @@ ohos_js_hap_suite("huksagree_callback_basic_js_test") {
":huks_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "huksAgreeBasicCallbackJSApiTest"
hap_name = "ActsHuksAgreeBasicCallbackJSApiTest"
}
ohos_js_assets("huks_js_assets") {
source_dir = "./entry/src/main/js/MainAbility"
......
......@@ -2,14 +2,14 @@
"description": "Configuration for huksAgreeBasicCallback js api Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "4200000",
"test-timeout": "180000",
"package": "com.example.huksagreebasiccallback",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"huksAgreeBasicCallbackJSApiTest.hap"
"ActsHuksAgreeBasicCallbackJSApiTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
......
......@@ -19,7 +19,7 @@ ohos_js_hap_suite("huksagree_promise_basic_js_test") {
":huks_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "huksAgreeBasicPromiseJSApiTest"
hap_name = "ActsHuksAgreeBasicPromiseJSApiTest"
}
ohos_js_assets("huks_js_assets") {
source_dir = "./entry/src/main/js/MainAbility"
......
......@@ -2,14 +2,14 @@
"description": "Configuration for huksAgreeBasicPromise js api Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "4200000",
"test-timeout": "180000",
"package": "com.example.huksagreebasicpromise",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"huksAgreeBasicPromiseJSApiTest.hap"
"ActsHuksAgreeBasicPromiseJSApiTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
......
......@@ -19,7 +19,7 @@ ohos_js_hap_suite("hukscipher_callback_basic_js_test") {
":huks_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "huksCipherBasicCallbackJSApiTest"
hap_name = "ActsHuksCipherBasicCallbackJSApiTest"
}
ohos_js_assets("huks_js_assets") {
source_dir = "./entry/src/main/js/MainAbility"
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册