diff --git a/api/@ohos.security.cryptoFramework.d.ts b/api/@ohos.security.cryptoFramework.d.ts index 986d48c70b0d395087d5136d6a99abd46e97a862..af323fc4ccc81d1b97b743340a8240e016dd1dd1 100644 --- a/api/@ohos.security.cryptoFramework.d.ts +++ b/api/@ohos.security.cryptoFramework.d.ts @@ -3589,11 +3589,29 @@ declare namespace cryptoFramework { * @syscap SystemCapability.Security.CryptoFramework.Cipher * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ update(data: DataBlob, callback: AsyncCallback): void; + /** + * Update the crypto operation with the input data, and feed back the encrypted or decrypted data + * this time. RSA is not supported in this function. + * + * @param { DataBlob } data - indicates the data to be encrypted or decrypted. + * @param { AsyncCallback } callback - the callback of the update function. + * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17620001 - memory operation failed. + * @throws { BusinessError } 17620002 - failed to convert parameters between arkts and c. + * @throws { BusinessError } 17630001 - crypto operation error. + * @syscap SystemCapability.Security.CryptoFramework.Cipher + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + update(data: DataBlob, callback: AsyncCallback): void; + /** * Update the crypto operation with the input data, and feed back the encrypted or decrypted data * this time. RSA is not supported in this function. @@ -3637,11 +3655,29 @@ declare namespace cryptoFramework { * @syscap SystemCapability.Security.CryptoFramework.Cipher * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ update(data: DataBlob): Promise; + /** + * Update the crypto operation with the input data, and feed back the encrypted or decrypted data + * this time. RSA is not supported in this function. + * + * @param { DataBlob } data - indicates the data to be encrypted or decrypted. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17620001 - memory operation failed. + * @throws { BusinessError } 17620002 - failed to convert parameters between arkts and c. + * @throws { BusinessError } 17630001 - crypto operation error. + * @syscap SystemCapability.Security.CryptoFramework.Cipher + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + update(data: DataBlob): Promise; + /** * Update the crypto operation with the input data, and feed back the encrypted or decrypted data * this time. RSA is not supported in this function. @@ -3656,11 +3692,29 @@ declare namespace cryptoFramework { * @syscap SystemCapability.Security.CryptoFramework.Cipher * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ updateSync(data: DataBlob): DataBlob; + /** + * Update the crypto operation with the input data, and feed back the encrypted or decrypted data + * this time. RSA is not supported in this function. + * + * @param { DataBlob } data - indicates the data to be encrypted or decrypted. + * @returns { DataBlob | null } cipherText when encrypted or plainText when decrypted. + * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17620001 - memory operation failed. + * @throws { BusinessError } 17620002 - failed to convert parameters between arkts and c. + * @throws { BusinessError } 17630001 - crypto operation error. + * @syscap SystemCapability.Security.CryptoFramework.Cipher + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + updateSync(data: DataBlob): DataBlob | null; + /** * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data. * Data cannot be updated after the crypto operation is finished. @@ -3751,11 +3805,29 @@ declare namespace cryptoFramework { * @syscap SystemCapability.Security.CryptoFramework.Cipher * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ doFinal(data: DataBlob | null, callback: AsyncCallback): void; + /** + * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data. + * Data cannot be updated after the crypto operation is finished. + * + * @param { DataBlob | null } data - indicates the data to be finally encrypted or decrypted. + * @param { AsyncCallback } callback - the callback of the doFinal function. + * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17620001 - memory operation failed. + * @throws { BusinessError } 17620002 - failed to convert parameters between arkts and c. + * @throws { BusinessError } 17630001 - crypto operation error. + * @syscap SystemCapability.Security.CryptoFramework.Cipher + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + doFinal(data: DataBlob | null, callback: AsyncCallback): void; + /** * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data. * Data cannot be updated after the crypto operation is finished. @@ -3846,11 +3918,29 @@ declare namespace cryptoFramework { * @syscap SystemCapability.Security.CryptoFramework.Cipher * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ doFinal(data: DataBlob | null): Promise; + /** + * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data. + * Data cannot be updated after the crypto operation is finished. + * + * @param { DataBlob | null } data - indicates the data to be finally encrypted or decrypted. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17620001 - memory operation failed. + * @throws { BusinessError } 17620002 - failed to convert parameters between arkts and c. + * @throws { BusinessError } 17630001 - crypto operation error. + * @syscap SystemCapability.Security.CryptoFramework.Cipher + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + doFinal(data: DataBlob | null): Promise; + /** * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data. * Data cannot be updated after the crypto operation is finished. @@ -3865,11 +3955,29 @@ declare namespace cryptoFramework { * @syscap SystemCapability.Security.CryptoFramework.Cipher * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ doFinalSync(data: DataBlob | null): DataBlob; + /** + * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data. + * Data cannot be updated after the crypto operation is finished. + * + * @param { DataBlob | null } data - indicates the data to be finally encrypted or decrypted. + * @returns { DataBlob | null } cipherText when encrypted or plainText when decrypted. + * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17620001 - memory operation failed. + * @throws { BusinessError } 17620002 - failed to convert parameters between arkts and c. + * @throws { BusinessError } 17630001 - crypto operation error. + * @syscap SystemCapability.Security.CryptoFramework.Cipher + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + doFinalSync(data: DataBlob | null): DataBlob | null; + /** * Set the specified parameter to the cipher object. * Currently, only the OAEP_MGF1_PSRC_UINT8ARR parameter in RSA is supported.