1e41f4b71Sopenharmony_ci# security子系统ChangeLog
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci## cl.security.1 Random的setSeed功能变更,由异步接口改为同步接口
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci**变更影响**
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
8e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
9e41f4b71Sopenharmony_ci
10e41f4b71Sopenharmony_ci**关键的接口/组件变更**
11e41f4b71Sopenharmony_ci修改前的接口原型:
12e41f4b71Sopenharmony_cisetSeed(seed : DataBlob, callback : AsyncCallback\<void>) : void;
13e41f4b71Sopenharmony_cisetSeed(seed : DataBlob) : Promise\<void>;
14e41f4b71Sopenharmony_ci修改后的接口原型:
15e41f4b71Sopenharmony_cisetSeed(seed : DataBlob) : void;
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci**适配指导**
18e41f4b71Sopenharmony_ci查看API参考中setSeed对应的接口适配指南:
19e41f4b71Sopenharmony_ci[加解密算法库框架-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cryptoFramework.md)
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ci
22e41f4b71Sopenharmony_ci## cl.security.2 interface DataArray 从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
23e41f4b71Sopenharmony_ci**变更影响**
24e41f4b71Sopenharmony_ci
25e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
26e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
27e41f4b71Sopenharmony_ci
28e41f4b71Sopenharmony_ci**关键的接口/组件变更**
29e41f4b71Sopenharmony_ciinterface DataArray从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ci**适配指导**
32e41f4b71Sopenharmony_ci重新import并使用对应的.d.ts文件:
33e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert';
34e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
35e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ci
38e41f4b71Sopenharmony_ci## cl.security.3 interface EncodingFormat从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
39e41f4b71Sopenharmony_ci**变更影响**
40e41f4b71Sopenharmony_ci
41e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
42e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
43e41f4b71Sopenharmony_ci
44e41f4b71Sopenharmony_ci**关键的接口/组件变更**
45e41f4b71Sopenharmony_ciinterface EncodingFormat从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
46e41f4b71Sopenharmony_ci
47e41f4b71Sopenharmony_ci**适配指导**
48e41f4b71Sopenharmony_ci重新import并使用对应的.d.ts文件:
49e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert';
50e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
51e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
52e41f4b71Sopenharmony_ci
53e41f4b71Sopenharmony_ci
54e41f4b71Sopenharmony_ci## cl.security.4 interface EncodingBlob 从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
55e41f4b71Sopenharmony_ci**变更影响**
56e41f4b71Sopenharmony_ci
57e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
58e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
59e41f4b71Sopenharmony_ci
60e41f4b71Sopenharmony_ci**关键的接口/组件变更**
61e41f4b71Sopenharmony_ciinterface EncodingBlob 从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
62e41f4b71Sopenharmony_ci
63e41f4b71Sopenharmony_ci**适配指导**
64e41f4b71Sopenharmony_ci重新import并使用对应的.d.ts文件:
65e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert';
66e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
67e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
68e41f4b71Sopenharmony_ci
69e41f4b71Sopenharmony_ci
70e41f4b71Sopenharmony_ci## cl.security.5 interface CertChainData从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
71e41f4b71Sopenharmony_ci**变更影响**
72e41f4b71Sopenharmony_ci
73e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
74e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
75e41f4b71Sopenharmony_ci
76e41f4b71Sopenharmony_ci**关键的接口/组件变更**
77e41f4b71Sopenharmony_ciinterface CertChainData从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
78e41f4b71Sopenharmony_ci
79e41f4b71Sopenharmony_ci**适配指导**
80e41f4b71Sopenharmony_ci重新import并使用对应的.d.ts文件:
81e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert';
82e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
83e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
84e41f4b71Sopenharmony_ci
85e41f4b71Sopenharmony_ci
86e41f4b71Sopenharmony_ci## cl.security.6 interface X509Cert从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
87e41f4b71Sopenharmony_ci**变更影响**
88e41f4b71Sopenharmony_ci
89e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
90e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
91e41f4b71Sopenharmony_ci
92e41f4b71Sopenharmony_ci**关键的接口/组件变更**
93e41f4b71Sopenharmony_ciinterface X509Cert从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
94e41f4b71Sopenharmony_ci
95e41f4b71Sopenharmony_ci**适配指导**
96e41f4b71Sopenharmony_ci重新import并使用对应的.d.ts文件:
97e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert';
98e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
99e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
100e41f4b71Sopenharmony_ci
101e41f4b71Sopenharmony_ci
102e41f4b71Sopenharmony_ci## cl.security.7 function createX509Cert从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
103e41f4b71Sopenharmony_ci**变更影响**
104e41f4b71Sopenharmony_ci
105e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
106e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
107e41f4b71Sopenharmony_ci
108e41f4b71Sopenharmony_ci**关键的接口/组件变更**
109e41f4b71Sopenharmony_cifunction createX509Cert从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
110e41f4b71Sopenharmony_ci
111e41f4b71Sopenharmony_ci**适配指导**
112e41f4b71Sopenharmony_ci重新import并使用对应的.d.ts文件:
113e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert';
114e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
115e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
116e41f4b71Sopenharmony_ci
117e41f4b71Sopenharmony_ci
118e41f4b71Sopenharmony_ci## cl.security.8 interface X509CrlEntry从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
119e41f4b71Sopenharmony_ci**变更影响**
120e41f4b71Sopenharmony_ci
121e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
122e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
123e41f4b71Sopenharmony_ci
124e41f4b71Sopenharmony_ci**关键的接口/组件变更**
125e41f4b71Sopenharmony_ciinterface X509CrlEntry从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
126e41f4b71Sopenharmony_ci
127e41f4b71Sopenharmony_ci**适配指导**
128e41f4b71Sopenharmony_ci重新import并使用对应的.d.ts文件:
129e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert';
130e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
131e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
132e41f4b71Sopenharmony_ci
133e41f4b71Sopenharmony_ci
134e41f4b71Sopenharmony_ci## cl.security.9 interface X509Crl从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
135e41f4b71Sopenharmony_ci**变更影响**
136e41f4b71Sopenharmony_ci
137e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
138e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
139e41f4b71Sopenharmony_ci
140e41f4b71Sopenharmony_ci**关键的接口/组件变更**
141e41f4b71Sopenharmony_ciinterface X509Crl从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
142e41f4b71Sopenharmony_ci
143e41f4b71Sopenharmony_ci**适配指导**
144e41f4b71Sopenharmony_ci重新import并使用对应的.d.ts文件:
145e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert';
146e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
147e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
148e41f4b71Sopenharmony_ci
149e41f4b71Sopenharmony_ci
150e41f4b71Sopenharmony_ci## cl.security.10 function createX509Crl从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
151e41f4b71Sopenharmony_ci**变更影响**
152e41f4b71Sopenharmony_ci
153e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
154e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
155e41f4b71Sopenharmony_ci
156e41f4b71Sopenharmony_ci**关键的接口/组件变更**
157e41f4b71Sopenharmony_cifunction createX509Crl从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
158e41f4b71Sopenharmony_ci
159e41f4b71Sopenharmony_ci**适配指导**
160e41f4b71Sopenharmony_ci重新import并使用对应的.d.ts文件:
161e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert';
162e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
163e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
164e41f4b71Sopenharmony_ci
165e41f4b71Sopenharmony_ci
166e41f4b71Sopenharmony_ci## cl.security.11 interface CertChainValidator从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
167e41f4b71Sopenharmony_ci**变更影响**
168e41f4b71Sopenharmony_ci
169e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
170e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
171e41f4b71Sopenharmony_ci
172e41f4b71Sopenharmony_ci**关键的接口/组件变更**
173e41f4b71Sopenharmony_ciinterface CertChainValidator从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
174e41f4b71Sopenharmony_ci
175e41f4b71Sopenharmony_ci**适配指导**
176e41f4b71Sopenharmony_ci重新import并使用对应的.d.ts文件:
177e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert';
178e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
179e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
180e41f4b71Sopenharmony_ci
181e41f4b71Sopenharmony_ci
182e41f4b71Sopenharmony_ci## cl.security.12 function createCertChainValidator从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
183e41f4b71Sopenharmony_ci**变更影响**
184e41f4b71Sopenharmony_ci
185e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
186e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
187e41f4b71Sopenharmony_ci
188e41f4b71Sopenharmony_ci**关键的接口/组件变更**
189e41f4b71Sopenharmony_cifunction createCertChainValidator从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts
190e41f4b71Sopenharmony_ci
191e41f4b71Sopenharmony_ci**适配指导**
192e41f4b71Sopenharmony_ci重新import并使用对应的.d.ts文件:
193e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert';
194e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
195e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
196e41f4b71Sopenharmony_ci
197e41f4b71Sopenharmony_ci
198e41f4b71Sopenharmony_ci## cl.security.13 X509Cert 的getPublicKey功能变更,由异步接口改为同步接口
199e41f4b71Sopenharmony_ci**变更影响**
200e41f4b71Sopenharmony_ci
201e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
202e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
203e41f4b71Sopenharmony_ci
204e41f4b71Sopenharmony_ci**关键的接口/组件变更**
205e41f4b71Sopenharmony_ci修改前的接口原型:
206e41f4b71Sopenharmony_cigetPublicKey(callback : AsyncCallback\<PubKey>) : void;
207e41f4b71Sopenharmony_cigetPublicKey() : Promise\<PubKey>;
208e41f4b71Sopenharmony_ci修改后的接口原型:
209e41f4b71Sopenharmony_cigetPublicKey() : cryptoFramework.PubKey;
210e41f4b71Sopenharmony_ci
211e41f4b71Sopenharmony_ci**适配指导**
212e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
213e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
214e41f4b71Sopenharmony_ci
215e41f4b71Sopenharmony_ci
216e41f4b71Sopenharmony_ci## cl.security.14 X509Cert 的checkValidityWithDate功能变更,由异步接口改为同步接口
217e41f4b71Sopenharmony_ci**变更影响**
218e41f4b71Sopenharmony_ci
219e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
220e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
221e41f4b71Sopenharmony_ci
222e41f4b71Sopenharmony_ci**关键的接口/组件变更**
223e41f4b71Sopenharmony_ci修改前的接口原型:
224e41f4b71Sopenharmony_cicheckValidityWithDate(date: string, callback : AsyncCallback\<void>) : void;
225e41f4b71Sopenharmony_cicheckValidityWithDate(date: string) : Promise\<void>;
226e41f4b71Sopenharmony_ci修改后的接口原型:
227e41f4b71Sopenharmony_cicheckValidityWithDate(date: string) : void;
228e41f4b71Sopenharmony_ci
229e41f4b71Sopenharmony_ci**适配指导**
230e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
231e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
232e41f4b71Sopenharmony_ci
233e41f4b71Sopenharmony_ci
234e41f4b71Sopenharmony_ci## cl.security.15 X509CrlEntry 的getCertIssuer功能变更,由异步接口改为同步接口
235e41f4b71Sopenharmony_ci**变更影响**
236e41f4b71Sopenharmony_ci
237e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
238e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
239e41f4b71Sopenharmony_ci
240e41f4b71Sopenharmony_ci**关键的接口/组件变更**
241e41f4b71Sopenharmony_ci修改前的接口原型:
242e41f4b71Sopenharmony_cigetCertIssuer(callback : AsyncCallback\<DataBlob>) : void;
243e41f4b71Sopenharmony_cigetCertIssuer() : Promise\<DataBlob>;
244e41f4b71Sopenharmony_ci
245e41f4b71Sopenharmony_ci修改后的接口原型:
246e41f4b71Sopenharmony_cigetCertIssuer() : DataBlob;
247e41f4b71Sopenharmony_ci
248e41f4b71Sopenharmony_ci**适配指导**
249e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
250e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
251e41f4b71Sopenharmony_ci
252e41f4b71Sopenharmony_ci
253e41f4b71Sopenharmony_ci## cl.security.16 X509CrlEntry 的getRevocationDate功能变更,由异步接口改为同步接口
254e41f4b71Sopenharmony_ci**变更影响**
255e41f4b71Sopenharmony_ci
256e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
257e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
258e41f4b71Sopenharmony_ci
259e41f4b71Sopenharmony_ci**关键的接口/组件变更**
260e41f4b71Sopenharmony_ci修改前的接口原型:
261e41f4b71Sopenharmony_cigetRevocationDate(callback : AsyncCallback\<string>) : void;
262e41f4b71Sopenharmony_cigetRevocationDate() : Promise\<string>;
263e41f4b71Sopenharmony_ci
264e41f4b71Sopenharmony_ci修改后的接口原型:
265e41f4b71Sopenharmony_cigetRevocationDate() : string;
266e41f4b71Sopenharmony_ci
267e41f4b71Sopenharmony_ci**适配指导**
268e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
269e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
270e41f4b71Sopenharmony_ci
271e41f4b71Sopenharmony_ci
272e41f4b71Sopenharmony_ci## cl.security.17 X509Crl 的isRevoked功能变更,由异步接口改为同步接口
273e41f4b71Sopenharmony_ci**变更影响**
274e41f4b71Sopenharmony_ci
275e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
276e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
277e41f4b71Sopenharmony_ci
278e41f4b71Sopenharmony_ci**关键的接口/组件变更**
279e41f4b71Sopenharmony_ci修改前的接口原型:
280e41f4b71Sopenharmony_ciisRevoked(cert : X509Cert, callback : AsyncCallback\<boolean>) : void;
281e41f4b71Sopenharmony_ciisRevoked(cert : X509Cert) : Promise\<boolean>;
282e41f4b71Sopenharmony_ci
283e41f4b71Sopenharmony_ci修改后的接口原型:
284e41f4b71Sopenharmony_ciisRevoked(cert : X509Cert) : boolean;
285e41f4b71Sopenharmony_ci
286e41f4b71Sopenharmony_ci**适配指导**
287e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
288e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
289e41f4b71Sopenharmony_ci
290e41f4b71Sopenharmony_ci
291e41f4b71Sopenharmony_ci## cl.security.18 X509Crl 的getRevokedCert功能变更,由异步接口改为同步接口
292e41f4b71Sopenharmony_ci**变更影响**
293e41f4b71Sopenharmony_ci
294e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
295e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
296e41f4b71Sopenharmony_ci
297e41f4b71Sopenharmony_ci**关键的接口/组件变更**
298e41f4b71Sopenharmony_ci修改前的接口原型:
299e41f4b71Sopenharmony_cigetRevokedCert(serialNumber : number, callback : AsyncCallback\<X509CrlEntry>) : void;
300e41f4b71Sopenharmony_cigetRevokedCert(serialNumber : number) : Promise\<X509CrlEntry>;
301e41f4b71Sopenharmony_ci
302e41f4b71Sopenharmony_ci修改后的接口原型:
303e41f4b71Sopenharmony_cigetRevokedCert(serialNumber : number) : X509CrlEntry;
304e41f4b71Sopenharmony_ci
305e41f4b71Sopenharmony_ci**适配指导**
306e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
307e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
308e41f4b71Sopenharmony_ci
309e41f4b71Sopenharmony_ci
310e41f4b71Sopenharmony_ci## cl.security.19 X509Crl 的getRevokedCertWithCert功能变更,由异步接口改为同步接口
311e41f4b71Sopenharmony_ci**变更影响**
312e41f4b71Sopenharmony_ci
313e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
314e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
315e41f4b71Sopenharmony_ci
316e41f4b71Sopenharmony_ci**关键的接口/组件变更**
317e41f4b71Sopenharmony_ci修改前的接口原型:
318e41f4b71Sopenharmony_cigetRevokedCertWithCert(cert : X509Cert, callback : AsyncCallback\<X509CrlEntry>) : void;
319e41f4b71Sopenharmony_cigetRevokedCertWithCert(cert : X509Cert) : Promise\<X509CrlEntry>;
320e41f4b71Sopenharmony_ci
321e41f4b71Sopenharmony_ci修改后的接口原型:
322e41f4b71Sopenharmony_cigetRevokedCertWithCert(cert : X509Cert) : X509CrlEntry;
323e41f4b71Sopenharmony_ci
324e41f4b71Sopenharmony_ci**适配指导**
325e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
326e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
327e41f4b71Sopenharmony_ci
328e41f4b71Sopenharmony_ci
329e41f4b71Sopenharmony_ci## cl.security.20 X509Crl 的getTbsInfo功能变更,由异步接口改为同步接口
330e41f4b71Sopenharmony_ci**变更影响**
331e41f4b71Sopenharmony_ci
332e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
333e41f4b71Sopenharmony_ci应用需要进行适配,才可以在新版本SDK环境正常编译通过。
334e41f4b71Sopenharmony_ci
335e41f4b71Sopenharmony_ci**关键的接口/组件变更**
336e41f4b71Sopenharmony_ci修改前的接口原型:
337e41f4b71Sopenharmony_cigetTbsInfo(callback : AsyncCallback\<DataBlob>) : void;
338e41f4b71Sopenharmony_cigetTbsInfo() : Promise\<DataBlob>;
339e41f4b71Sopenharmony_ci
340e41f4b71Sopenharmony_ci修改后的接口原型:
341e41f4b71Sopenharmony_cigetTbsInfo() : DataBlob;
342e41f4b71Sopenharmony_ci
343e41f4b71Sopenharmony_ci**适配指导**
344e41f4b71Sopenharmony_ci查看API参考中对应的接口适配指南:
345e41f4b71Sopenharmony_ci[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)
346e41f4b71Sopenharmony_ci
347e41f4b71Sopenharmony_ci## cl.security.21 HUKS支持No-Hash的签名模式
348e41f4b71Sopenharmony_ci
349e41f4b71Sopenharmony_ci变更之前,应用传递huks.HuksTag.HUKS_TAG_DIGEST = huks.HuksKeyDigest.HUKS_DIGEST_NONE,HUKS默认使用huks.HuksKeyDigest.HUKS_DIGEST_SHA256进行处理;变更之后,应用传递huks.HuksTag.HUKS_TAG_DIGEST = huks.HuksKeyDigest.HUKS_DIGEST_NONE时,HUKS默认不进行摘要处理,需要业务先对原始数据进行hash操作,再将hash后的摘要传入huks进行签名/验签处理。
350e41f4b71Sopenharmony_ci
351e41f4b71Sopenharmony_ci**变更影响**
352e41f4b71Sopenharmony_ci
353e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
354e41f4b71Sopenharmony_ci应用需要进行适配,才可以使得变更前后的签名/验签结果通过。
355e41f4b71Sopenharmony_ci
356e41f4b71Sopenharmony_ci**关键的接口/组件变更**
357e41f4b71Sopenharmony_ci
358e41f4b71Sopenharmony_ci发布的JS接口不变, 传入接口的参数集合发生变更。
359e41f4b71Sopenharmony_ci
360e41f4b71Sopenharmony_ci业务使用No-Hash的签名模式,需要先对原始数据进行hash处理,再将hash后的摘要传入huks签名/验签接口。同时huks.HuksTag.HUKS_TAG_DIGEST参数设置为huks.HuksKeyDigest.HUKS_DIGEST_NONE361e41f4b71Sopenharmony_ci
362e41f4b71Sopenharmony_ci**适配指导**
363e41f4b71Sopenharmony_ci
364e41f4b71Sopenharmony_ci以签名为例,示例代码如下:
365e41f4b71Sopenharmony_ci
366e41f4b71Sopenharmony_ci```js
367e41f4b71Sopenharmony_ciimport huks from '@ohos.security.huks';
368e41f4b71Sopenharmony_ci
369e41f4b71Sopenharmony_cilet keyAlias = 'rsa_Key';
370e41f4b71Sopenharmony_ci/* sha256之后的摘要值 */
371e41f4b71Sopenharmony_cilet inDataAfterSha256 = new Uint8Array(
372e41f4b71Sopenharmony_ci    0x4B, 0x1E, 0x22, 0x64, 0xA9, 0x89, 0x60, 0x1D, 0xEC, 0x78, 0xC0, 0x5D, 0xBE, 0x46, 0xAD, 0xCF,
373e41f4b71Sopenharmony_ci    0x1C, 0x35, 0x16, 0x11, 0x34, 0x01, 0x4E, 0x9B, 0x7C, 0x00, 0x66, 0x0E, 0xCA, 0x09, 0xC0, 0xF3,
374e41f4b71Sopenharmony_ci);
375e41f4b71Sopenharmony_ci/* 签名参数 */
376e41f4b71Sopenharmony_cilet signProperties = new Array();
377e41f4b71Sopenharmony_cisignProperties[0] = {
378e41f4b71Sopenharmony_ci    tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
379e41f4b71Sopenharmony_ci    value: huks.HuksKeyAlg.HUKS_ALG_RSA,
380e41f4b71Sopenharmony_ci}
381e41f4b71Sopenharmony_cisignProperties[1] = {
382e41f4b71Sopenharmony_ci    tag: huks.HuksTag.HUKS_TAG_PURPOSE,
383e41f4b71Sopenharmony_ci    value:
384e41f4b71Sopenharmony_ci    huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_SIGN
385e41f4b71Sopenharmony_ci}
386e41f4b71Sopenharmony_cisignProperties[2] = {
387e41f4b71Sopenharmony_ci    tag: huks.HuksTag.HUKS_TAG_KEY_SIZE,
388e41f4b71Sopenharmony_ci    value: huks.HuksKeySize.HUKS_RSA_KEY_SIZE_2048,
389e41f4b71Sopenharmony_ci}
390e41f4b71Sopenharmony_cisignProperties[3] = {
391e41f4b71Sopenharmony_ci    tag: huks.HuksTag.HUKS_TAG_DIGEST,
392e41f4b71Sopenharmony_ci    value: huks.HuksKeyDigest.HUKS_DIGEST_NONE, // 设置 digest-none
393e41f4b71Sopenharmony_ci}
394e41f4b71Sopenharmony_cilet signOptions = {
395e41f4b71Sopenharmony_ci    properties: signProperties,
396e41f4b71Sopenharmony_ci    inData: inDataAfterSha256 // 设置HASH后的值
397e41f4b71Sopenharmony_ci}
398e41f4b71Sopenharmony_ci
399e41f4b71Sopenharmony_cihuks.initSession(keyAlias, signOptions);
400e41f4b71Sopenharmony_ci```
401e41f4b71Sopenharmony_ci
402e41f4b71Sopenharmony_ci更多接口的示例代码可参考[HUKS-guidelines](../../../application-dev/security/huks-guidelines.md)和[HUKS API](../../../application-dev/reference/apis/js-apis-huks.md)。
403e41f4b71Sopenharmony_ci
404e41f4b71Sopenharmony_ci## cl.security.22 HUKS支持在密钥使用时指定密钥运算参数
405e41f4b71Sopenharmony_ci
406e41f4b71Sopenharmony_ci变更之前,业务在生成密钥的时候,必须指定密钥运算的全部参数;变更之后,在生成密钥时,只需要包含必选参数即可,在密钥使用阶段再传入其他参数。业务使用会更加灵活。
407e41f4b71Sopenharmony_ci
408e41f4b71Sopenharmony_ci**变更影响**
409e41f4b71Sopenharmony_ci
410e41f4b71Sopenharmony_ci影响已发布的JS接口,接口行为发生变更。
411e41f4b71Sopenharmony_ci
412e41f4b71Sopenharmony_ci允许应用在生成密钥阶段传入的参数中包含必选参数即可,在密钥使用阶段再传入其他可选参数。
413e41f4b71Sopenharmony_ci
414e41f4b71Sopenharmony_ci**关键的接口/组件变更**
415e41f4b71Sopenharmony_ci
416e41f4b71Sopenharmony_ci发布的JS接口不变, 传入接口的参数集合发生变更,将参数分为必选参数和可选参数,具体可参考[HUKS-guidelines](../../../application-dev/security/huks-guidelines.md),涉及的接口有:
417e41f4b71Sopenharmony_ci
418e41f4b71Sopenharmony_cihuks.generateKeyItem
419e41f4b71Sopenharmony_ci
420e41f4b71Sopenharmony_cihuks.importKeyItem
421e41f4b71Sopenharmony_ci
422e41f4b71Sopenharmony_cihuks.importWrappedKeyItem
423e41f4b71Sopenharmony_ci
424e41f4b71Sopenharmony_cihuks.initSession
425e41f4b71Sopenharmony_ci
426e41f4b71Sopenharmony_cihuks.updateSession
427e41f4b71Sopenharmony_ci
428e41f4b71Sopenharmony_cihuks.finishSession
429e41f4b71Sopenharmony_ci
430e41f4b71Sopenharmony_ci**适配指导**
431e41f4b71Sopenharmony_ci
432e41f4b71Sopenharmony_ci以生成密钥为例,示例代码如下:
433e41f4b71Sopenharmony_ci
434e41f4b71Sopenharmony_ci```js
435e41f4b71Sopenharmony_cilet keyAlias = 'keyAlias';
436e41f4b71Sopenharmony_cilet properties = new Array();
437e41f4b71Sopenharmony_ci//必选参数
438e41f4b71Sopenharmony_ciproperties[0] = {
439e41f4b71Sopenharmony_ci    tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
440e41f4b71Sopenharmony_ci    value: huks.HuksKeyAlg.HUKS_ALG_RSA
441e41f4b71Sopenharmony_ci};
442e41f4b71Sopenharmony_ci//必选参数
443e41f4b71Sopenharmony_ciproperties[1] = {
444e41f4b71Sopenharmony_ci    tag: huks.HuksTag.HUKS_TAG_KEY_SIZE,
445e41f4b71Sopenharmony_ci    value: huks.HuksKeySize.HUKS_RSA_KEY_SIZE_2048
446e41f4b71Sopenharmony_ci};
447e41f4b71Sopenharmony_ci//必选参数
448e41f4b71Sopenharmony_ciproperties[2] = {
449e41f4b71Sopenharmony_ci    tag: huks.HuksTag.HUKS_TAG_PURPOSE,
450e41f4b71Sopenharmony_ci    value:
451e41f4b71Sopenharmony_ci    huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_SIGN |
452e41f4b71Sopenharmony_ci    huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_VERIFY
453e41f4b71Sopenharmony_ci};
454e41f4b71Sopenharmony_ci//可选参数,如果在生成密钥阶段没有传入,则在使用密钥阶段必须传入。
455e41f4b71Sopenharmony_ciproperties[3] = {
456e41f4b71Sopenharmony_ci    tag: huks.HuksTag.HUKS_TAG_DIGEST,
457e41f4b71Sopenharmony_ci    value: huks.HuksKeyDigest.HUKS_DIGEST_SHA256
458e41f4b71Sopenharmony_ci};
459e41f4b71Sopenharmony_cilet options = {
460e41f4b71Sopenharmony_ci    properties: properties
461e41f4b71Sopenharmony_ci};
462e41f4b71Sopenharmony_citry {
463e41f4b71Sopenharmony_ci    huks.generateKeyItem(keyAlias, options, function (error, data) {
464e41f4b71Sopenharmony_ci        if (error) {
465e41f4b71Sopenharmony_ci            console.error(`callback: generateKeyItem failed, code: ${error.code}, msg: ${error.message}`);
466e41f4b71Sopenharmony_ci        } else {
467e41f4b71Sopenharmony_ci            console.info(`callback: generateKeyItem key success`);
468e41f4b71Sopenharmony_ci        }
469e41f4b71Sopenharmony_ci    });
470e41f4b71Sopenharmony_ci} catch (error) {
471e41f4b71Sopenharmony_ci    console.error(`callback: generateKeyItem input arg invalid, code: ${error.code}, msg: ${error.message}`);
472e41f4b71Sopenharmony_ci}
473e41f4b71Sopenharmony_ci```
474e41f4b71Sopenharmony_ci
475e41f4b71Sopenharmony_ci更多接口的示例代码可参考[HUKS-guidelines](../../../application-dev/security/huks-guidelines.md)和[HUKS API](../../../application-dev/reference/apis/js-apis-huks.md)。
476