1# security子系统ChangeLog
2
3## cl.security.1 ParamsSpec属性名变更为algName。
4结构体ParamsSpec的属性algoName由于API命名统一,名称更改为algName。
5
6**变更影响**
7
8影响已发布的JS接口,对ParamsSpec以及其子类IvParamsSpec,GcmParamsSpec与CcmParamsSpec,使用这些对象作为参数或返回值时,其属性名需要更改为algName。
9应用需要进行适配,才可以在新版本SDK环境正常编译通过。
10
11**关键的接口/组件变更**
12
13修改前的接口原型:
14
15 ```ts
16interface ParamsSpec {
17    /**
18     * Indicates the algorithm name. Should be set before initialization of a cipher object.
19     * @type { string }
20     * @syscap SystemCapability.Security.CryptoFramework
21     * @since 9
22     */
23    algoName : string;
24}
25 ```
26修改后的接口原型:
27
28 ```ts
29interface ParamsSpec {
30    /**
31     * Indicates the algorithm name. Should be set before initialization of a cipher object.
32     * @type { string }
33     * @syscap SystemCapability.Security.CryptoFramework
34     * @since 9
35     */
36    algName : string;
37}
38 ```
39
40**适配指导**
41
42对ParamsSpec以及其子类IvParamsSpec,GcmParamsSpec与CcmParamsSpec,使用这些对象作为参数或返回值时,其属性名需要从algoName更改为algName。
43 ```ts
44function genGcmParamsSpec() {
45  let arr = [0, 0, 0, 0 , 0, 0, 0, 0, 0, 0 , 0, 0]; // 12 bytes
46  let dataIv = new Uint8Array(arr);
47  let ivBlob = {data : dataIv};
48
49  arr = [0, 0, 0, 0 , 0, 0, 0, 0]; // 8 bytes
50  let dataAad = new Uint8Array(arr);
51  let aadBlob = {data : dataAad};
52
53  arr = [0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0]; // 16 bytes
54  let dataTag = new Uint8Array(arr);
55  let tagBlob = {data : dataTag};
56  let gcmParamsSpec = {iv : ivBlob, aad : aadBlob, authTag : tagBlob, algName : "GcmParamsSpec"};
57  return gcmParamsSpec;
58}
59 ```
60详细查看API参考中ParamsSpec对应的接口适配指南:
61[加解密算法库框架-ParamsSpec-API参考](../../../application-dev/reference/apis/js-apis-cryptoFramework.md#paramsspec)
62
63## cl.security.2 ECC密码算法的参数名从ECC512变更为ECC521
64
65**变更影响**
66
67影响已发布的JS接口,接口行为发生变更。
68应用需要进行适配,才可以在新版本SDK环境获取正确结果。
69
70**关键的接口/组件变更**
71发布的JS接口不变, 传入接口的参数发生变化,由ECC512变化为ECC521,具体可见[加解密算法库框架-ECC密码算法参数参考](../../../application-dev/security/cryptoFramework-overview.md#密钥生成规格),涉及的接口有:
72
73cryptoFramework.createAsyKeyGenerator
74
75cryptoFramework.createSign
76
77cryptoFramework.createVerify
78
79cryptoFramework.createKeyAgreement
80
81**适配指导**
82
83```js
84import cryptoFramework from "@ohos.security.cryptoFramework"
85
86let asyKeyGenerator = cryptoFramework.createAsyKeyGenerator("ECC521");
87```