1e41f4b71Sopenharmony_ci# Security Subsystem Changelog 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci## cl.security.1 Change of setSeed() from Asynchronous to Synchronous 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci**Change Impact** 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 8e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci**Key API/Component Changes** 11e41f4b71Sopenharmony_ciAPI before the change: 12e41f4b71Sopenharmony_cisetSeed(seed : DataBlob, callback : AsyncCallback\<void>) : void; 13e41f4b71Sopenharmony_cisetSeed(seed : DataBlob) : Promise\<void>; 14e41f4b71Sopenharmony_ciAPI after the change: 15e41f4b71Sopenharmony_cisetSeed(seed : DataBlob) : void; 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci**Adaptation Guide** 18e41f4b71Sopenharmony_ciSee **setSeed()** in the following: 19e41f4b71Sopenharmony_ci[Crypto Framework](../../../application-dev/reference/apis/js-apis-cryptoFramework.md) 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci 22e41f4b71Sopenharmony_ci## cl.security.2 Move of DataArray from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts 23e41f4b71Sopenharmony_ci**Change Impact** 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 26e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 27e41f4b71Sopenharmony_ci 28e41f4b71Sopenharmony_ci**Key API/Component Changes** 29e41f4b71Sopenharmony_ciMoved **DataArray** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci**Adaptation Guide** 32e41f4b71Sopenharmony_ciImport and use the new .d.ts file: 33e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert'; 34e41f4b71Sopenharmony_ciSee the following API reference: 35e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci 38e41f4b71Sopenharmony_ci## cl.security.3 Move of EncodingFormat from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts 39e41f4b71Sopenharmony_ci**Change Impact** 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 42e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 43e41f4b71Sopenharmony_ci 44e41f4b71Sopenharmony_ci**Key API/Component Changes** 45e41f4b71Sopenharmony_ciMoved **EncodingFormat** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. 46e41f4b71Sopenharmony_ci 47e41f4b71Sopenharmony_ci**Adaptation Guide** 48e41f4b71Sopenharmony_ciImport and use the new .d.ts file: 49e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert'; 50e41f4b71Sopenharmony_ciSee the following API reference: 51e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ci 54e41f4b71Sopenharmony_ci## cl.security.4 Move of EncodingBlob from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts 55e41f4b71Sopenharmony_ci**Change Impact** 56e41f4b71Sopenharmony_ci 57e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 58e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 59e41f4b71Sopenharmony_ci 60e41f4b71Sopenharmony_ci**Key API/Component Changes** 61e41f4b71Sopenharmony_ciMoved **EncodingBlob** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. 62e41f4b71Sopenharmony_ci 63e41f4b71Sopenharmony_ci**Adaptation Guide** 64e41f4b71Sopenharmony_ciImport and use the new .d.ts file: 65e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert'; 66e41f4b71Sopenharmony_ciSee the following API reference: 67e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 68e41f4b71Sopenharmony_ci 69e41f4b71Sopenharmony_ci 70e41f4b71Sopenharmony_ci## cl.security.5 Move of CertChainData from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts 71e41f4b71Sopenharmony_ci**Change Impact** 72e41f4b71Sopenharmony_ci 73e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 74e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 75e41f4b71Sopenharmony_ci 76e41f4b71Sopenharmony_ci**Key API/Component Changes** 77e41f4b71Sopenharmony_ciMoved **interface CertChainData** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. 78e41f4b71Sopenharmony_ci 79e41f4b71Sopenharmony_ci**Adaptation Guide** 80e41f4b71Sopenharmony_ciImport and use the new .d.ts file: 81e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert'; 82e41f4b71Sopenharmony_ciSee the following API reference: 83e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 84e41f4b71Sopenharmony_ci 85e41f4b71Sopenharmony_ci 86e41f4b71Sopenharmony_ci## cl.security.6 Move of X509Cert from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts 87e41f4b71Sopenharmony_ci**Change Impact** 88e41f4b71Sopenharmony_ci 89e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 90e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 91e41f4b71Sopenharmony_ci 92e41f4b71Sopenharmony_ci**Key API/Component Changes** 93e41f4b71Sopenharmony_ciMoved **X509Cert** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. 94e41f4b71Sopenharmony_ci 95e41f4b71Sopenharmony_ci**Adaptation Guide** 96e41f4b71Sopenharmony_ciImport and use the new .d.ts file: 97e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert'; 98e41f4b71Sopenharmony_ciSee the following API reference: 99e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 100e41f4b71Sopenharmony_ci 101e41f4b71Sopenharmony_ci 102e41f4b71Sopenharmony_ci## cl.security.7 Move of createX509Cert from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts 103e41f4b71Sopenharmony_ci**Change Impact** 104e41f4b71Sopenharmony_ci 105e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 106e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 107e41f4b71Sopenharmony_ci 108e41f4b71Sopenharmony_ci**Key API/Component Changes** 109e41f4b71Sopenharmony_ciMoved **createX509Cert** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. 110e41f4b71Sopenharmony_ci 111e41f4b71Sopenharmony_ci**Adaptation Guide** 112e41f4b71Sopenharmony_ciImport and use the new .d.ts file: 113e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert'; 114e41f4b71Sopenharmony_ciSee the following API reference: 115e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 116e41f4b71Sopenharmony_ci 117e41f4b71Sopenharmony_ci 118e41f4b71Sopenharmony_ci## cl.security.8 Move of X509CrlEntry from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts. 119e41f4b71Sopenharmony_ci**Change Impact** 120e41f4b71Sopenharmony_ci 121e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 122e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 123e41f4b71Sopenharmony_ci 124e41f4b71Sopenharmony_ci**Key API/Component Changes** 125e41f4b71Sopenharmony_ciMoved **X509CrlEntry** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. 126e41f4b71Sopenharmony_ci 127e41f4b71Sopenharmony_ci**Adaptation Guide** 128e41f4b71Sopenharmony_ciImport and use the new .d.ts file: 129e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert'; 130e41f4b71Sopenharmony_ciSee the following API reference: 131e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 132e41f4b71Sopenharmony_ci 133e41f4b71Sopenharmony_ci 134e41f4b71Sopenharmony_ci## cl.security.9 Move of X509Crl from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts 135e41f4b71Sopenharmony_ci**Change Impact** 136e41f4b71Sopenharmony_ci 137e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 138e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 139e41f4b71Sopenharmony_ci 140e41f4b71Sopenharmony_ci**Key API/Component Changes** 141e41f4b71Sopenharmony_ciMoved **X509Crl** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. 142e41f4b71Sopenharmony_ci 143e41f4b71Sopenharmony_ci**Adaptation Guide** 144e41f4b71Sopenharmony_ciImport and use the new .d.ts file: 145e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert'; 146e41f4b71Sopenharmony_ciSee the following API reference: 147e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 148e41f4b71Sopenharmony_ci 149e41f4b71Sopenharmony_ci 150e41f4b71Sopenharmony_ci## cl.security.10 Move of createX509Crl from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts 151e41f4b71Sopenharmony_ci**Change Impact** 152e41f4b71Sopenharmony_ci 153e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 154e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 155e41f4b71Sopenharmony_ci 156e41f4b71Sopenharmony_ci**Key API/Component Changes** 157e41f4b71Sopenharmony_ciMoved **createX509Crl** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. 158e41f4b71Sopenharmony_ci 159e41f4b71Sopenharmony_ci**Adaptation Guide** 160e41f4b71Sopenharmony_ciImport and use the new .d.ts file: 161e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert'; 162e41f4b71Sopenharmony_ciSee the following API reference: 163e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 164e41f4b71Sopenharmony_ci 165e41f4b71Sopenharmony_ci 166e41f4b71Sopenharmony_ci## cl.security.11 Move of CertChainValidator from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts 167e41f4b71Sopenharmony_ci**Change Impact** 168e41f4b71Sopenharmony_ci 169e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 170e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 171e41f4b71Sopenharmony_ci 172e41f4b71Sopenharmony_ci**Key API/Component Changes** 173e41f4b71Sopenharmony_ciMoved **CertChainValidator** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. 174e41f4b71Sopenharmony_ci 175e41f4b71Sopenharmony_ci**Adaptation Guide** 176e41f4b71Sopenharmony_ciImport and use the new .d.ts file: 177e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert'; 178e41f4b71Sopenharmony_ciSee the following API reference: 179e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 180e41f4b71Sopenharmony_ci 181e41f4b71Sopenharmony_ci 182e41f4b71Sopenharmony_ci## cl.security.12 Move of createCertChainValidator from @ohos.security.cryptoFramework.d.ts to @ohos.security.cert.d.ts 183e41f4b71Sopenharmony_ci**Change Impact** 184e41f4b71Sopenharmony_ci 185e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 186e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 187e41f4b71Sopenharmony_ci 188e41f4b71Sopenharmony_ci**Key API/Component Changes** 189e41f4b71Sopenharmony_ciMoved **createCertChainValidator** from **@ohos.security.cryptoFramework.d.ts** to **@ohos.security.cert.d.ts**. 190e41f4b71Sopenharmony_ci 191e41f4b71Sopenharmony_ci**Adaptation Guide** 192e41f4b71Sopenharmony_ciImport and use the new .d.ts file: 193e41f4b71Sopenharmony_ciimport cryptoCert from '@ohos.security.cert'; 194e41f4b71Sopenharmony_ciSee the following API reference: 195e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 196e41f4b71Sopenharmony_ci 197e41f4b71Sopenharmony_ci 198e41f4b71Sopenharmony_ci## cl.security.13 Change of getPublicKey() of X509Cert from Asynchronous to Synchronous 199e41f4b71Sopenharmony_ci**Change Impact** 200e41f4b71Sopenharmony_ci 201e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 202e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 203e41f4b71Sopenharmony_ci 204e41f4b71Sopenharmony_ci**Key API/Component Changes** 205e41f4b71Sopenharmony_ciAPI before the change: 206e41f4b71Sopenharmony_cigetPublicKey(callback : AsyncCallback\<PubKey>) : void; 207e41f4b71Sopenharmony_cigetPublicKey() : Promise\<PubKey>; 208e41f4b71Sopenharmony_ciAPI after the change: 209e41f4b71Sopenharmony_cigetPublicKey() : cryptoFramework.PubKey; 210e41f4b71Sopenharmony_ci 211e41f4b71Sopenharmony_ci**Adaptation Guide** 212e41f4b71Sopenharmony_ciSee the following API reference: 213e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 214e41f4b71Sopenharmony_ci 215e41f4b71Sopenharmony_ci 216e41f4b71Sopenharmony_ci## cl.security.14 Change of checkValidityWithDate of X509Cert from Asynchronous to Synchronous 217e41f4b71Sopenharmony_ci**Change Impact** 218e41f4b71Sopenharmony_ci 219e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 220e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 221e41f4b71Sopenharmony_ci 222e41f4b71Sopenharmony_ci**Key API/Component Changes** 223e41f4b71Sopenharmony_ciAPI before the change: 224e41f4b71Sopenharmony_cicheckValidityWithDate(date: string, callback : AsyncCallback\<void>) : void; 225e41f4b71Sopenharmony_cicheckValidityWithDate(date: string) : Promise\<void>; 226e41f4b71Sopenharmony_ciAPI after the change: 227e41f4b71Sopenharmony_cicheckValidityWithDate(date: string) : void; 228e41f4b71Sopenharmony_ci 229e41f4b71Sopenharmony_ci**Adaptation Guide** 230e41f4b71Sopenharmony_ciSee the following API reference: 231e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 232e41f4b71Sopenharmony_ci 233e41f4b71Sopenharmony_ci 234e41f4b71Sopenharmony_ci## cl.security.15 Change of getCertIssuer of X509CrlEntry from Asynchronous to Synchronous 235e41f4b71Sopenharmony_ci**Change Impact** 236e41f4b71Sopenharmony_ci 237e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 238e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 239e41f4b71Sopenharmony_ci 240e41f4b71Sopenharmony_ci**Key API/Component Changes** 241e41f4b71Sopenharmony_ciAPI before the change: 242e41f4b71Sopenharmony_cigetCertIssuer(callback : AsyncCallback\<DataBlob>) : void; 243e41f4b71Sopenharmony_cigetCertIssuer() : Promise\<DataBlob>; 244e41f4b71Sopenharmony_ci 245e41f4b71Sopenharmony_ciAPI after the change: 246e41f4b71Sopenharmony_cigetCertIssuer() : DataBlob; 247e41f4b71Sopenharmony_ci 248e41f4b71Sopenharmony_ci**Adaptation Guide** 249e41f4b71Sopenharmony_ciSee the following API reference: 250e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 251e41f4b71Sopenharmony_ci 252e41f4b71Sopenharmony_ci 253e41f4b71Sopenharmony_ci## cl.security.16 Change of getRevocationDate of X509CrlEntry from Asynchronous to Synchronous 254e41f4b71Sopenharmony_ci**Change Impact** 255e41f4b71Sopenharmony_ci 256e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 257e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 258e41f4b71Sopenharmony_ci 259e41f4b71Sopenharmony_ci**Key API/Component Changes** 260e41f4b71Sopenharmony_ciAPI before the change: 261e41f4b71Sopenharmony_cigetRevocationDate(callback : AsyncCallback\<string>) : void; 262e41f4b71Sopenharmony_cigetRevocationDate() : Promise\<string>; 263e41f4b71Sopenharmony_ci 264e41f4b71Sopenharmony_ciAPI after the change: 265e41f4b71Sopenharmony_cigetRevocationDate() : string; 266e41f4b71Sopenharmony_ci 267e41f4b71Sopenharmony_ci**Adaptation Guide** 268e41f4b71Sopenharmony_ciSee the following API reference: 269e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 270e41f4b71Sopenharmony_ci 271e41f4b71Sopenharmony_ci 272e41f4b71Sopenharmony_ci## cl.security.17 Change of isRevoked of X509Crl from Asynchronous to Synchronous 273e41f4b71Sopenharmony_ci**Change Impact** 274e41f4b71Sopenharmony_ci 275e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 276e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 277e41f4b71Sopenharmony_ci 278e41f4b71Sopenharmony_ci**Key API/Component Changes** 279e41f4b71Sopenharmony_ciAPI before the change: 280e41f4b71Sopenharmony_ciisRevoked(cert : X509Cert, callback : AsyncCallback\<boolean>) : void; 281e41f4b71Sopenharmony_ciisRevoked(cert : X509Cert) : Promise\<boolean>; 282e41f4b71Sopenharmony_ci 283e41f4b71Sopenharmony_ciAPI after the change: 284e41f4b71Sopenharmony_ciisRevoked(cert : X509Cert) : boolean; 285e41f4b71Sopenharmony_ci 286e41f4b71Sopenharmony_ci**Adaptation Guide** 287e41f4b71Sopenharmony_ciSee the following API reference: 288e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 289e41f4b71Sopenharmony_ci 290e41f4b71Sopenharmony_ci 291e41f4b71Sopenharmony_ci## cl.security.18 Change of getRevokedCert of X509Crl from Asynchronous to Synchronous 292e41f4b71Sopenharmony_ci**Change Impact** 293e41f4b71Sopenharmony_ci 294e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 295e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 296e41f4b71Sopenharmony_ci 297e41f4b71Sopenharmony_ci**Key API/Component Changes** 298e41f4b71Sopenharmony_ciAPI before the change: 299e41f4b71Sopenharmony_cigetRevokedCert(serialNumber : number, callback : AsyncCallback\<X509CrlEntry>) : void; 300e41f4b71Sopenharmony_cigetRevokedCert(serialNumber : number) : Promise\<X509CrlEntry>; 301e41f4b71Sopenharmony_ci 302e41f4b71Sopenharmony_ciAPI after the change: 303e41f4b71Sopenharmony_cigetRevokedCert(serialNumber : number) : X509CrlEntry; 304e41f4b71Sopenharmony_ci 305e41f4b71Sopenharmony_ci**Adaptation Guide** 306e41f4b71Sopenharmony_ciSee the following API reference: 307e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 308e41f4b71Sopenharmony_ci 309e41f4b71Sopenharmony_ci 310e41f4b71Sopenharmony_ci## cl.security.19 Change of getRevokedCertWithCert of X509Crl from Asynchronous to Synchronous 311e41f4b71Sopenharmony_ci**Change Impact** 312e41f4b71Sopenharmony_ci 313e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 314e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 315e41f4b71Sopenharmony_ci 316e41f4b71Sopenharmony_ci**Key API/Component Changes** 317e41f4b71Sopenharmony_ciAPI before the change: 318e41f4b71Sopenharmony_cigetRevokedCertWithCert(cert : X509Cert, callback : AsyncCallback\<X509CrlEntry>) : void; 319e41f4b71Sopenharmony_cigetRevokedCertWithCert(cert : X509Cert) : Promise\<X509CrlEntry>; 320e41f4b71Sopenharmony_ci 321e41f4b71Sopenharmony_ciAPI after the change: 322e41f4b71Sopenharmony_cigetRevokedCertWithCert(cert : X509Cert) : X509CrlEntry; 323e41f4b71Sopenharmony_ci 324e41f4b71Sopenharmony_ci**Adaptation Guide** 325e41f4b71Sopenharmony_ciSee the following API reference: 326e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 327e41f4b71Sopenharmony_ci 328e41f4b71Sopenharmony_ci 329e41f4b71Sopenharmony_ci## cl.security.20 Change of getTbsInfo of X509Crl from Asynchronous to Synchronous 330e41f4b71Sopenharmony_ci**Change Impact** 331e41f4b71Sopenharmony_ci 332e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 333e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. 334e41f4b71Sopenharmony_ci 335e41f4b71Sopenharmony_ci**Key API/Component Changes** 336e41f4b71Sopenharmony_ciAPI before the change: 337e41f4b71Sopenharmony_cigetTbsInfo(callback : AsyncCallback\<DataBlob>) : void; 338e41f4b71Sopenharmony_cigetTbsInfo() : Promise\<DataBlob>; 339e41f4b71Sopenharmony_ci 340e41f4b71Sopenharmony_ciAPI after the change: 341e41f4b71Sopenharmony_cigetTbsInfo() : DataBlob; 342e41f4b71Sopenharmony_ci 343e41f4b71Sopenharmony_ci**Adaptation Guide** 344e41f4b71Sopenharmony_ciSee the following API reference: 345e41f4b71Sopenharmony_ci[Certificate](../../../application-dev/reference/apis/js-apis-cert.md) 346e41f4b71Sopenharmony_ci 347e41f4b71Sopenharmony_ci## cl.security.21 Support of No-Hash Signing Mode for HUKS 348e41f4b71Sopenharmony_ci 349e41f4b71Sopenharmony_ciBefore the change, the application passes **huks.HuksTag.HUKS_TAG_DIGEST = huks.HuksKeyDigest.HUKS_DIGEST_NONE** and HUKS uses **huks.HuksKeyDigest.HUKS_DIGEST_SHA256** for processing by default. After the change, the application passes **huks.HuksTag.HUKS_TAG_DIGEST = huks.HuksKeyDigest.HUKS_DIGEST_NONE** and HUKS does not generate a digest by default. Instead, the service performs a hash operation on the original data and then passes a hashed digest to HUKS for signing or signature verification. 350e41f4b71Sopenharmony_ci 351e41f4b71Sopenharmony_ci**Change Impact** 352e41f4b71Sopenharmony_ci 353e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 354e41f4b71Sopenharmony_ciThe application needs to adapt these APIs so that the signing or signature verification result can be passed before and after the change. 355e41f4b71Sopenharmony_ci 356e41f4b71Sopenharmony_ci**Key API/Component Changes** 357e41f4b71Sopenharmony_ci 358e41f4b71Sopenharmony_ciReleased JavaScript APIs remain unchanged, but parameter sets passed to the APIs are changed. 359e41f4b71Sopenharmony_ci 360e41f4b71Sopenharmony_ciThe service uses the No-Hash signing mode, and hashes the original data and then passes a hashed digest to the signing or signature verification API of HUKS. In addition, the **huks.HuksTag.HUKS_TAG_DIGEST** parameter is set to **huks.HuksKeyDigest.HUKS_DIGEST_NONE**. 361e41f4b71Sopenharmony_ci 362e41f4b71Sopenharmony_ci**Adaptation Guide** 363e41f4b71Sopenharmony_ci 364e41f4b71Sopenharmony_ciThe following uses signing as an example. 365e41f4b71Sopenharmony_ci 366e41f4b71Sopenharmony_ci```js 367e41f4b71Sopenharmony_ciimport huks from '@ohos.security.huks'; 368e41f4b71Sopenharmony_ci 369e41f4b71Sopenharmony_cilet keyAlias = 'rsa_Key'; 370e41f4b71Sopenharmony_ci/* Digest value after SHA-256 encryption */ 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/* Signing parameters */ 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, // Set digest-none. 393e41f4b71Sopenharmony_ci} 394e41f4b71Sopenharmony_cilet signOptions = { 395e41f4b71Sopenharmony_ci properties: signProperties, 396e41f4b71Sopenharmony_ci inData: inDataAfterSha256 // Set the value after hashing. 397e41f4b71Sopenharmony_ci} 398e41f4b71Sopenharmony_ci 399e41f4b71Sopenharmony_cihuks.initSession(keyAlias, signOptions); 400e41f4b71Sopenharmony_ci``` 401e41f4b71Sopenharmony_ci 402e41f4b71Sopenharmony_ciFor for information about the sample code, see [HUKS Development](../../../application-dev/security/huks-guidelines.md) and [HUKS](../../../application-dev/reference/apis/js-apis-huks.md). 403e41f4b71Sopenharmony_ci 404e41f4b71Sopenharmony_ci## cl.security.22 Support for Key Calculation Parameter Specifications During Key Usage 405e41f4b71Sopenharmony_ci 406e41f4b71Sopenharmony_ciBefore the change, all parameters for key calculation must be specified when the application generates a key. After the change, only mandatory parameters need to be specified when the application generates a key, and other parameters can be passed in when the key is used. The application can specify key calculation parameters more flexibly. 407e41f4b71Sopenharmony_ci 408e41f4b71Sopenharmony_ci**Change Impact** 409e41f4b71Sopenharmony_ci 410e41f4b71Sopenharmony_ciBehavior of released JavaScript APIs will be changed. 411e41f4b71Sopenharmony_ci 412e41f4b71Sopenharmony_ciThe application can specify only mandatory parameters when creating a key and specify other optional parameters when using the key. 413e41f4b71Sopenharmony_ci 414e41f4b71Sopenharmony_ci**Key API/Component Changes** 415e41f4b71Sopenharmony_ci 416e41f4b71Sopenharmony_ciReleased JavaScript APIs remain unchanged, but parameter sets passed to the APIs are changed and parameters are classified into mandatory parameters and optional parameters. For details, see [HUKS Development](../../../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**Adaptation Guide** 431e41f4b71Sopenharmony_ci 432e41f4b71Sopenharmony_ciThe following uses the key generation process as an example. 433e41f4b71Sopenharmony_ci 434e41f4b71Sopenharmony_ci```js 435e41f4b71Sopenharmony_cilet keyAlias = 'keyAlias'; 436e41f4b71Sopenharmony_cilet properties = new Array(); 437e41f4b71Sopenharmony_ci// Mandatory parameter. 438e41f4b71Sopenharmony_ciproperties[0] = { 439e41f4b71Sopenharmony_ci tag: huks.HuksTag.HUKS_TAG_ALGORITHM, 440e41f4b71Sopenharmony_ci value: huks.HuksKeyAlg.HUKS_ALG_RSA 441e41f4b71Sopenharmony_ci}; 442e41f4b71Sopenharmony_ci// Mandatory parameter. 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// Mandatory parameter. 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// Optional parameter. If this parameter is not specified when a key is generated, it must be specified when the key is used. 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_ciFor for information about the sample code, see [HUKS Development](../../../application-dev/security/huks-guidelines.md) and [HUKS](../../../application-dev/reference/apis/js-apis-huks.md). 476