# DeviceSecurityKit-SampleCode-BusinessRiskIntelligentDetection-ServerDemo-Java **Repository Path**: harmonyos_samples/device-security-kit-sample-code-business-risk-intelligent-detection-server-demo-java ## Basic Information - **Project Name**: DeviceSecurityKit-SampleCode-BusinessRiskIntelligentDetection-ServerDemo-Java - **Description**: 本示例基于业务风险检测服务能力,提供场景(防作弊、反欺诈、违规内容检测等)的业务风险决策能力。 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-11-03 - **Last Updated**: 2025-11-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # BusinessRiskIntelligentDetection Server Sample ## 目录 * [介绍](#介绍) * [运行步骤](#运行步骤) * [支持环境](#支持环境) * [示例代码](#示例代码) * [许可证](#许可证) ## 介绍 BusinessRiskIntelligentDetection Server Sample 提供了在服务端验证结果的示例代码。 ## 运行步骤 在运行BusinessRiskIntelligentDetection Server Sample前,请检查是否安装Java以及Maven。 1.使用maven工具构建工程。 2.运行main程序。 3.输入涉诈剧本检测结果,即:JWS字符串。 4.输入Huawei CBG Root CA 证书文件路径。 5.如果验证成功,则输出payload内容,否则输出错误信息。 ## 支持环境 Java 1.7 及以上 ## 示例代码 1. 解析JWS,获取header,payload,signature。 2. 从header中获取证书链,使用[Huawei CBG Root CA](https://pki.consumer.huawei.com/ca/cer/RootCaG2Ecdsa.cer)证书对其进行验证。 3. 校验证书链中的叶证书域名,域名:riskopenapi.platform.hicloud.com。 4. 从signature中获取签名,校验其签名。 5. 从payload中获取涉诈剧本检测结果,格式和样例摘录如下: ```json { "timestampMs": 9xxxxxxxxx, "nonce": "Rxxxxxxxxx", "appId": "xxxxxxxxx", "version": 1, "riskScore": 90, "tags": [ "phishing", "malware", "interdiction", "control" ] } ``` 更多信息请访问[涉诈剧本检测](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/devicesecurity-fraudriskdetection) ## 许可证 此代码已获得 [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).