161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (c) 2022-2024 Huawei Device Co., Ltd.
361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
461847f8eSopenharmony_ci * you may not use this file except in compliance with the License.
561847f8eSopenharmony_ci * You may obtain a copy of the License at
661847f8eSopenharmony_ci *
761847f8eSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
861847f8eSopenharmony_ci *
961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and
1361847f8eSopenharmony_ci * limitations under the License.
1461847f8eSopenharmony_ci */
1561847f8eSopenharmony_ci
1661847f8eSopenharmony_ci/**
1761847f8eSopenharmony_ci * @file
1861847f8eSopenharmony_ci * @kit CryptoArchitectureKit
1961847f8eSopenharmony_ci */
2061847f8eSopenharmony_ciimport type { AsyncCallback, Callback } from './@ohos.base';
2161847f8eSopenharmony_ci
2261847f8eSopenharmony_ci/**
2361847f8eSopenharmony_ci * Provides a set of encryption and decryption algorithm library framework, shields the underlying differences,
2461847f8eSopenharmony_ci * encapsulate the relevant algorithm library, and provides a unified functional interface upward.
2561847f8eSopenharmony_ci *
2661847f8eSopenharmony_ci * @namespace cryptoFramework
2761847f8eSopenharmony_ci * @syscap SystemCapability.Security.CryptoFramework
2861847f8eSopenharmony_ci * @since 9
2961847f8eSopenharmony_ci */
3061847f8eSopenharmony_ci/**
3161847f8eSopenharmony_ci * Provides a set of encryption and decryption algorithm library framework, shields the underlying differences,
3261847f8eSopenharmony_ci * encapsulate the relevant algorithm library, and provides a unified functional interface upward.
3361847f8eSopenharmony_ci *
3461847f8eSopenharmony_ci * @namespace cryptoFramework
3561847f8eSopenharmony_ci * @syscap SystemCapability.Security.CryptoFramework
3661847f8eSopenharmony_ci * @crossplatform
3761847f8eSopenharmony_ci * @atomicservice
3861847f8eSopenharmony_ci * @since 11
3961847f8eSopenharmony_ci */
4061847f8eSopenharmony_cideclare namespace cryptoFramework {
4161847f8eSopenharmony_ci  /**
4261847f8eSopenharmony_ci   * Enum for result code.
4361847f8eSopenharmony_ci   *
4461847f8eSopenharmony_ci   * @enum { number }
4561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
4661847f8eSopenharmony_ci   * @since 9
4761847f8eSopenharmony_ci   */
4861847f8eSopenharmony_ci  /**
4961847f8eSopenharmony_ci   * Enum for result code.
5061847f8eSopenharmony_ci   *
5161847f8eSopenharmony_ci   * @enum { number }
5261847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
5361847f8eSopenharmony_ci   * @crossplatform
5461847f8eSopenharmony_ci   * @atomicservice
5561847f8eSopenharmony_ci   * @since 11
5661847f8eSopenharmony_ci   */
5761847f8eSopenharmony_ci  enum Result {
5861847f8eSopenharmony_ci    /**
5961847f8eSopenharmony_ci     * Indicates that input parameters is invalid.
6061847f8eSopenharmony_ci     *
6161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
6261847f8eSopenharmony_ci     * @since 9
6361847f8eSopenharmony_ci     */
6461847f8eSopenharmony_ci    /**
6561847f8eSopenharmony_ci     * Indicates that input parameters is invalid.
6661847f8eSopenharmony_ci     *
6761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
6861847f8eSopenharmony_ci     * @crossplatform
6961847f8eSopenharmony_ci     * @atomicservice
7061847f8eSopenharmony_ci     * @since 11
7161847f8eSopenharmony_ci     */
7261847f8eSopenharmony_ci    INVALID_PARAMS = 401,
7361847f8eSopenharmony_ci
7461847f8eSopenharmony_ci    /**
7561847f8eSopenharmony_ci     * Indicates that function or algorithm is not supported.
7661847f8eSopenharmony_ci     *
7761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
7861847f8eSopenharmony_ci     * @since 9
7961847f8eSopenharmony_ci     */
8061847f8eSopenharmony_ci    /**
8161847f8eSopenharmony_ci     * Indicates that function or algorithm is not supported.
8261847f8eSopenharmony_ci     *
8361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
8461847f8eSopenharmony_ci     * @crossplatform
8561847f8eSopenharmony_ci     * @since 11
8661847f8eSopenharmony_ci     */
8761847f8eSopenharmony_ci    /**
8861847f8eSopenharmony_ci     * Indicates that function or algorithm is not supported.
8961847f8eSopenharmony_ci     *
9061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
9161847f8eSopenharmony_ci     * @crossplatform
9261847f8eSopenharmony_ci     * @atomicservice
9361847f8eSopenharmony_ci     * @since 12
9461847f8eSopenharmony_ci     */
9561847f8eSopenharmony_ci    NOT_SUPPORT = 801,
9661847f8eSopenharmony_ci
9761847f8eSopenharmony_ci    /**
9861847f8eSopenharmony_ci     * Indicates the memory error.
9961847f8eSopenharmony_ci     *
10061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
10161847f8eSopenharmony_ci     * @since 9
10261847f8eSopenharmony_ci     */
10361847f8eSopenharmony_ci    /**
10461847f8eSopenharmony_ci     * Indicates the memory error.
10561847f8eSopenharmony_ci     *
10661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
10761847f8eSopenharmony_ci     * @crossplatform
10861847f8eSopenharmony_ci     * @atomicservice
10961847f8eSopenharmony_ci     * @since 11
11061847f8eSopenharmony_ci     */
11161847f8eSopenharmony_ci    ERR_OUT_OF_MEMORY = 17620001,
11261847f8eSopenharmony_ci
11361847f8eSopenharmony_ci    /**
11461847f8eSopenharmony_ci     * Indicates that runtime error.
11561847f8eSopenharmony_ci     *
11661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
11761847f8eSopenharmony_ci     * @since 9
11861847f8eSopenharmony_ci     */
11961847f8eSopenharmony_ci    /**
12061847f8eSopenharmony_ci     * Indicates that runtime error.
12161847f8eSopenharmony_ci     *
12261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
12361847f8eSopenharmony_ci     * @crossplatform
12461847f8eSopenharmony_ci     * @since 11
12561847f8eSopenharmony_ci     */
12661847f8eSopenharmony_ci    /**
12761847f8eSopenharmony_ci     * Indicates that runtime error.
12861847f8eSopenharmony_ci     *
12961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
13061847f8eSopenharmony_ci     * @crossplatform
13161847f8eSopenharmony_ci     * @atomicservice
13261847f8eSopenharmony_ci     * @since 12
13361847f8eSopenharmony_ci     */
13461847f8eSopenharmony_ci    ERR_RUNTIME_ERROR = 17620002,
13561847f8eSopenharmony_ci
13661847f8eSopenharmony_ci    /**
13761847f8eSopenharmony_ci     * Indicates that crypto operation error.
13861847f8eSopenharmony_ci     *
13961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
14061847f8eSopenharmony_ci     * @since 9
14161847f8eSopenharmony_ci     */
14261847f8eSopenharmony_ci    /**
14361847f8eSopenharmony_ci     * Indicates that crypto operation error.
14461847f8eSopenharmony_ci     *
14561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
14661847f8eSopenharmony_ci     * @crossplatform
14761847f8eSopenharmony_ci     * @atomicservice
14861847f8eSopenharmony_ci     * @since 11
14961847f8eSopenharmony_ci     */
15061847f8eSopenharmony_ci    ERR_CRYPTO_OPERATION = 17630001
15161847f8eSopenharmony_ci  }
15261847f8eSopenharmony_ci
15361847f8eSopenharmony_ci  /**
15461847f8eSopenharmony_ci   * Provides the data blob type.
15561847f8eSopenharmony_ci   *
15661847f8eSopenharmony_ci   * @typedef DataBlob
15761847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
15861847f8eSopenharmony_ci   * @since 9
15961847f8eSopenharmony_ci   */
16061847f8eSopenharmony_ci  /**
16161847f8eSopenharmony_ci   * Provides the data blob type.
16261847f8eSopenharmony_ci   *
16361847f8eSopenharmony_ci   * @typedef DataBlob
16461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
16561847f8eSopenharmony_ci   * @crossplatform
16661847f8eSopenharmony_ci   * @atomicservice
16761847f8eSopenharmony_ci   * @since 11
16861847f8eSopenharmony_ci   */
16961847f8eSopenharmony_ci  interface DataBlob {
17061847f8eSopenharmony_ci    /**
17161847f8eSopenharmony_ci     * Indicates the content of data blob.
17261847f8eSopenharmony_ci     *
17361847f8eSopenharmony_ci     * @type { Uint8Array }
17461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
17561847f8eSopenharmony_ci     * @since 9
17661847f8eSopenharmony_ci     */
17761847f8eSopenharmony_ci    /**
17861847f8eSopenharmony_ci     * Indicates the content of data blob.
17961847f8eSopenharmony_ci     *
18061847f8eSopenharmony_ci     * @type { Uint8Array }
18161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
18261847f8eSopenharmony_ci     * @crossplatform
18361847f8eSopenharmony_ci     * @atomicservice
18461847f8eSopenharmony_ci     * @since 11
18561847f8eSopenharmony_ci     */
18661847f8eSopenharmony_ci    data: Uint8Array;
18761847f8eSopenharmony_ci  }
18861847f8eSopenharmony_ci
18961847f8eSopenharmony_ci  /**
19061847f8eSopenharmony_ci   * Provides the ParamsSpec type, including the algorithm name.
19161847f8eSopenharmony_ci   *
19261847f8eSopenharmony_ci   * @typedef ParamsSpec
19361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
19461847f8eSopenharmony_ci   * @since 9
19561847f8eSopenharmony_ci   */
19661847f8eSopenharmony_ci  /**
19761847f8eSopenharmony_ci   * Provides the ParamsSpec type, including the algorithm name.
19861847f8eSopenharmony_ci   *
19961847f8eSopenharmony_ci   * @typedef ParamsSpec
20061847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
20161847f8eSopenharmony_ci   * @crossplatform
20261847f8eSopenharmony_ci   * @since 11
20361847f8eSopenharmony_ci   */
20461847f8eSopenharmony_ci  /**
20561847f8eSopenharmony_ci   * Provides the ParamsSpec type, including the algorithm name.
20661847f8eSopenharmony_ci   *
20761847f8eSopenharmony_ci   * @typedef ParamsSpec
20861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Cipher
20961847f8eSopenharmony_ci   * @crossplatform
21061847f8eSopenharmony_ci   * @atomicservice
21161847f8eSopenharmony_ci   * @since 12
21261847f8eSopenharmony_ci   */
21361847f8eSopenharmony_ci  interface ParamsSpec {
21461847f8eSopenharmony_ci    /**
21561847f8eSopenharmony_ci     * Indicates the algorithm name. Should be set before initialization of a cipher object.
21661847f8eSopenharmony_ci     *
21761847f8eSopenharmony_ci     * @type { string }
21861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
21961847f8eSopenharmony_ci     * @since 9
22061847f8eSopenharmony_ci     */
22161847f8eSopenharmony_ci    /**
22261847f8eSopenharmony_ci     * Indicates the algorithm name. Should be set before initialization of a cipher object.
22361847f8eSopenharmony_ci     *
22461847f8eSopenharmony_ci     * @type { string }
22561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
22661847f8eSopenharmony_ci     * @crossplatform
22761847f8eSopenharmony_ci     * @since 11
22861847f8eSopenharmony_ci     */
22961847f8eSopenharmony_ci    /**
23061847f8eSopenharmony_ci     * Indicates the algorithm name. Should be set before initialization of a cipher object.
23161847f8eSopenharmony_ci     *
23261847f8eSopenharmony_ci     * @type { string }
23361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
23461847f8eSopenharmony_ci     * @crossplatform
23561847f8eSopenharmony_ci     * @atomicservice
23661847f8eSopenharmony_ci     * @since 12
23761847f8eSopenharmony_ci     */
23861847f8eSopenharmony_ci    algName: string;
23961847f8eSopenharmony_ci  }
24061847f8eSopenharmony_ci
24161847f8eSopenharmony_ci  /**
24261847f8eSopenharmony_ci   * Provides the IvParamsSpec type, including the parameter iv.
24361847f8eSopenharmony_ci   *
24461847f8eSopenharmony_ci   * @typedef IvParamsSpec
24561847f8eSopenharmony_ci   * @extends ParamsSpec
24661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
24761847f8eSopenharmony_ci   * @since 9
24861847f8eSopenharmony_ci   */
24961847f8eSopenharmony_ci  /**
25061847f8eSopenharmony_ci   * Provides the IvParamsSpec type, including the parameter iv.
25161847f8eSopenharmony_ci   *
25261847f8eSopenharmony_ci   * @typedef IvParamsSpec
25361847f8eSopenharmony_ci   * @extends ParamsSpec
25461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
25561847f8eSopenharmony_ci   * @crossplatform
25661847f8eSopenharmony_ci   * @since 11
25761847f8eSopenharmony_ci   */
25861847f8eSopenharmony_ci  /**
25961847f8eSopenharmony_ci   * Provides the IvParamsSpec type, including the parameter iv.
26061847f8eSopenharmony_ci   *
26161847f8eSopenharmony_ci   * @typedef IvParamsSpec
26261847f8eSopenharmony_ci   * @extends ParamsSpec
26361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Cipher
26461847f8eSopenharmony_ci   * @crossplatform
26561847f8eSopenharmony_ci   * @atomicservice
26661847f8eSopenharmony_ci   * @since 12
26761847f8eSopenharmony_ci   */
26861847f8eSopenharmony_ci  interface IvParamsSpec extends ParamsSpec {
26961847f8eSopenharmony_ci    /**
27061847f8eSopenharmony_ci     * Indicates the algorithm parameters such as iv.
27161847f8eSopenharmony_ci     *
27261847f8eSopenharmony_ci     * @type { DataBlob }
27361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
27461847f8eSopenharmony_ci     * @since 9
27561847f8eSopenharmony_ci     */
27661847f8eSopenharmony_ci    /**
27761847f8eSopenharmony_ci     * Indicates the algorithm parameters such as iv.
27861847f8eSopenharmony_ci     *
27961847f8eSopenharmony_ci     * @type { DataBlob }
28061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
28161847f8eSopenharmony_ci     * @crossplatform
28261847f8eSopenharmony_ci     * @since 11
28361847f8eSopenharmony_ci     */
28461847f8eSopenharmony_ci    /**
28561847f8eSopenharmony_ci     * Indicates the algorithm parameters such as iv.
28661847f8eSopenharmony_ci     *
28761847f8eSopenharmony_ci     * @type { DataBlob }
28861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
28961847f8eSopenharmony_ci     * @crossplatform
29061847f8eSopenharmony_ci     * @atomicservice
29161847f8eSopenharmony_ci     * @since 12
29261847f8eSopenharmony_ci     */
29361847f8eSopenharmony_ci    iv: DataBlob;
29461847f8eSopenharmony_ci  }
29561847f8eSopenharmony_ci
29661847f8eSopenharmony_ci  /**
29761847f8eSopenharmony_ci   * Provides the GcmParamsSpec type, including the parameter iv, aad and authTag.
29861847f8eSopenharmony_ci   *
29961847f8eSopenharmony_ci   * @typedef GcmParamsSpec
30061847f8eSopenharmony_ci   * @extends ParamsSpec
30161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
30261847f8eSopenharmony_ci   * @since 9
30361847f8eSopenharmony_ci   */
30461847f8eSopenharmony_ci  /**
30561847f8eSopenharmony_ci   * Provides the GcmParamsSpec type, including the parameter iv, aad and authTag.
30661847f8eSopenharmony_ci   *
30761847f8eSopenharmony_ci   * @typedef GcmParamsSpec
30861847f8eSopenharmony_ci   * @extends ParamsSpec
30961847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
31061847f8eSopenharmony_ci   * @crossplatform
31161847f8eSopenharmony_ci   * @since 11
31261847f8eSopenharmony_ci   */
31361847f8eSopenharmony_ci  /**
31461847f8eSopenharmony_ci   * Provides the GcmParamsSpec type, including the parameter iv, aad and authTag.
31561847f8eSopenharmony_ci   *
31661847f8eSopenharmony_ci   * @typedef GcmParamsSpec
31761847f8eSopenharmony_ci   * @extends ParamsSpec
31861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Cipher
31961847f8eSopenharmony_ci   * @crossplatform
32061847f8eSopenharmony_ci   * @atomicservice
32161847f8eSopenharmony_ci   * @since 12
32261847f8eSopenharmony_ci   */
32361847f8eSopenharmony_ci  interface GcmParamsSpec extends ParamsSpec {
32461847f8eSopenharmony_ci    /**
32561847f8eSopenharmony_ci     * Indicates the GCM algorithm parameters such as iv.
32661847f8eSopenharmony_ci     *
32761847f8eSopenharmony_ci     * @type { DataBlob }
32861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
32961847f8eSopenharmony_ci     * @since 9
33061847f8eSopenharmony_ci     */
33161847f8eSopenharmony_ci    /**
33261847f8eSopenharmony_ci     * Indicates the GCM algorithm parameters such as iv.
33361847f8eSopenharmony_ci     *
33461847f8eSopenharmony_ci     * @type { DataBlob }
33561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
33661847f8eSopenharmony_ci     * @crossplatform
33761847f8eSopenharmony_ci     * @since 11
33861847f8eSopenharmony_ci     */
33961847f8eSopenharmony_ci    /**
34061847f8eSopenharmony_ci     * Indicates the GCM algorithm parameters such as iv.
34161847f8eSopenharmony_ci     *
34261847f8eSopenharmony_ci     * @type { DataBlob }
34361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
34461847f8eSopenharmony_ci     * @crossplatform
34561847f8eSopenharmony_ci     * @atomicservice
34661847f8eSopenharmony_ci     * @since 12
34761847f8eSopenharmony_ci     */
34861847f8eSopenharmony_ci    iv: DataBlob;
34961847f8eSopenharmony_ci
35061847f8eSopenharmony_ci    /**
35161847f8eSopenharmony_ci     * Indicates the additional Authenticated Data in GCM mode.
35261847f8eSopenharmony_ci     *
35361847f8eSopenharmony_ci     * @type { DataBlob }
35461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
35561847f8eSopenharmony_ci     * @since 9
35661847f8eSopenharmony_ci     */
35761847f8eSopenharmony_ci    /**
35861847f8eSopenharmony_ci     * Indicates the additional Authenticated Data in GCM mode.
35961847f8eSopenharmony_ci     *
36061847f8eSopenharmony_ci     * @type { DataBlob }
36161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
36261847f8eSopenharmony_ci     * @crossplatform
36361847f8eSopenharmony_ci     * @since 11
36461847f8eSopenharmony_ci     */
36561847f8eSopenharmony_ci    /**
36661847f8eSopenharmony_ci     * Indicates the additional Authenticated Data in GCM mode.
36761847f8eSopenharmony_ci     *
36861847f8eSopenharmony_ci     * @type { DataBlob }
36961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
37061847f8eSopenharmony_ci     * @crossplatform
37161847f8eSopenharmony_ci     * @atomicservice
37261847f8eSopenharmony_ci     * @since 12
37361847f8eSopenharmony_ci     */
37461847f8eSopenharmony_ci    aad: DataBlob;
37561847f8eSopenharmony_ci
37661847f8eSopenharmony_ci    /**
37761847f8eSopenharmony_ci     * Indicates the output tag from the encryption operation. The tag is used for integrity check.
37861847f8eSopenharmony_ci     *
37961847f8eSopenharmony_ci     * @type { DataBlob }
38061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
38161847f8eSopenharmony_ci     * @since 9
38261847f8eSopenharmony_ci     */
38361847f8eSopenharmony_ci    /**
38461847f8eSopenharmony_ci     * Indicates the output tag from the encryption operation. The tag is used for integrity check.
38561847f8eSopenharmony_ci     *
38661847f8eSopenharmony_ci     * @type { DataBlob }
38761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
38861847f8eSopenharmony_ci     * @crossplatform
38961847f8eSopenharmony_ci     * @since 11
39061847f8eSopenharmony_ci     */
39161847f8eSopenharmony_ci    /**
39261847f8eSopenharmony_ci     * Indicates the output tag from the encryption operation. The tag is used for integrity check.
39361847f8eSopenharmony_ci     *
39461847f8eSopenharmony_ci     * @type { DataBlob }
39561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
39661847f8eSopenharmony_ci     * @crossplatform
39761847f8eSopenharmony_ci     * @atomicservice
39861847f8eSopenharmony_ci     * @since 12
39961847f8eSopenharmony_ci     */
40061847f8eSopenharmony_ci    authTag: DataBlob;
40161847f8eSopenharmony_ci  }
40261847f8eSopenharmony_ci
40361847f8eSopenharmony_ci  /**
40461847f8eSopenharmony_ci   * Provides the CcmParamsSpec type, including the parameter iv, aad and authTag.
40561847f8eSopenharmony_ci   *
40661847f8eSopenharmony_ci   * @typedef CcmParamsSpec
40761847f8eSopenharmony_ci   * @extends ParamsSpec
40861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
40961847f8eSopenharmony_ci   * @since 9
41061847f8eSopenharmony_ci   */
41161847f8eSopenharmony_ci  /**
41261847f8eSopenharmony_ci   * Provides the CcmParamsSpec type, including the parameter iv, aad and authTag.
41361847f8eSopenharmony_ci   *
41461847f8eSopenharmony_ci   * @typedef CcmParamsSpec
41561847f8eSopenharmony_ci   * @extends ParamsSpec
41661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
41761847f8eSopenharmony_ci   * @crossplatform
41861847f8eSopenharmony_ci   * @since 11
41961847f8eSopenharmony_ci   */
42061847f8eSopenharmony_ci  /**
42161847f8eSopenharmony_ci   * Provides the CcmParamsSpec type, including the parameter iv, aad and authTag.
42261847f8eSopenharmony_ci   *
42361847f8eSopenharmony_ci   * @typedef CcmParamsSpec
42461847f8eSopenharmony_ci   * @extends ParamsSpec
42561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Cipher
42661847f8eSopenharmony_ci   * @crossplatform
42761847f8eSopenharmony_ci   * @atomicservice
42861847f8eSopenharmony_ci   * @since 12
42961847f8eSopenharmony_ci   */
43061847f8eSopenharmony_ci  interface CcmParamsSpec extends ParamsSpec {
43161847f8eSopenharmony_ci    /**
43261847f8eSopenharmony_ci     * Indicates the GCM algorithm parameters such as IV.
43361847f8eSopenharmony_ci     *
43461847f8eSopenharmony_ci     * @type { DataBlob }
43561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
43661847f8eSopenharmony_ci     * @since 9
43761847f8eSopenharmony_ci     */
43861847f8eSopenharmony_ci    /**
43961847f8eSopenharmony_ci     * Indicates the GCM algorithm parameters such as IV.
44061847f8eSopenharmony_ci     *
44161847f8eSopenharmony_ci     * @type { DataBlob }
44261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
44361847f8eSopenharmony_ci     * @crossplatform
44461847f8eSopenharmony_ci     * @since 11
44561847f8eSopenharmony_ci     */
44661847f8eSopenharmony_ci    /**
44761847f8eSopenharmony_ci     * Indicates the GCM algorithm parameters such as IV.
44861847f8eSopenharmony_ci     *
44961847f8eSopenharmony_ci     * @type { DataBlob }
45061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
45161847f8eSopenharmony_ci     * @crossplatform
45261847f8eSopenharmony_ci     * @atomicservice
45361847f8eSopenharmony_ci     * @since 12
45461847f8eSopenharmony_ci     */
45561847f8eSopenharmony_ci    iv: DataBlob;
45661847f8eSopenharmony_ci
45761847f8eSopenharmony_ci    /**
45861847f8eSopenharmony_ci     * Indicates the Additional Authenticated Data in CCM mode.
45961847f8eSopenharmony_ci     *
46061847f8eSopenharmony_ci     * @type { DataBlob }
46161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
46261847f8eSopenharmony_ci     * @since 9
46361847f8eSopenharmony_ci     */
46461847f8eSopenharmony_ci    /**
46561847f8eSopenharmony_ci     * Indicates the Additional Authenticated Data in CCM mode.
46661847f8eSopenharmony_ci     *
46761847f8eSopenharmony_ci     * @type { DataBlob }
46861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
46961847f8eSopenharmony_ci     * @crossplatform
47061847f8eSopenharmony_ci     * @since 11
47161847f8eSopenharmony_ci     */
47261847f8eSopenharmony_ci    /**
47361847f8eSopenharmony_ci     * Indicates the Additional Authenticated Data in CCM mode.
47461847f8eSopenharmony_ci     *
47561847f8eSopenharmony_ci     * @type { DataBlob }
47661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
47761847f8eSopenharmony_ci     * @crossplatform
47861847f8eSopenharmony_ci     * @atomicservice
47961847f8eSopenharmony_ci     * @since 12
48061847f8eSopenharmony_ci     */
48161847f8eSopenharmony_ci    aad: DataBlob;
48261847f8eSopenharmony_ci
48361847f8eSopenharmony_ci    /**
48461847f8eSopenharmony_ci     * Indicates the output tag from the encryption operation. The tag is used for integrity check.
48561847f8eSopenharmony_ci     *
48661847f8eSopenharmony_ci     * @type { DataBlob }
48761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
48861847f8eSopenharmony_ci     * @since 9
48961847f8eSopenharmony_ci     */
49061847f8eSopenharmony_ci    /**
49161847f8eSopenharmony_ci     * Indicates the output tag from the encryption operation. The tag is used for integrity check.
49261847f8eSopenharmony_ci     *
49361847f8eSopenharmony_ci     * @type { DataBlob }
49461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
49561847f8eSopenharmony_ci     * @crossplatform
49661847f8eSopenharmony_ci     * @since 11
49761847f8eSopenharmony_ci     */
49861847f8eSopenharmony_ci    /**
49961847f8eSopenharmony_ci     * Indicates the output tag from the encryption operation. The tag is used for integrity check.
50061847f8eSopenharmony_ci     *
50161847f8eSopenharmony_ci     * @type { DataBlob }
50261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
50361847f8eSopenharmony_ci     * @crossplatform
50461847f8eSopenharmony_ci     * @atomicservice
50561847f8eSopenharmony_ci     * @since 12
50661847f8eSopenharmony_ci     */
50761847f8eSopenharmony_ci    authTag: DataBlob;
50861847f8eSopenharmony_ci  }
50961847f8eSopenharmony_ci
51061847f8eSopenharmony_ci  /**
51161847f8eSopenharmony_ci   * Enum for obtain the crypto operation.
51261847f8eSopenharmony_ci   *
51361847f8eSopenharmony_ci   * @enum { number }
51461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
51561847f8eSopenharmony_ci   * @since 9
51661847f8eSopenharmony_ci   */
51761847f8eSopenharmony_ci  /**
51861847f8eSopenharmony_ci   * Enum for obtain the crypto operation.
51961847f8eSopenharmony_ci   *
52061847f8eSopenharmony_ci   * @enum { number }
52161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
52261847f8eSopenharmony_ci   * @crossplatform
52361847f8eSopenharmony_ci   * @since 11
52461847f8eSopenharmony_ci   */
52561847f8eSopenharmony_ci  /**
52661847f8eSopenharmony_ci   * Enum for obtain the crypto operation.
52761847f8eSopenharmony_ci   *
52861847f8eSopenharmony_ci   * @enum { number }
52961847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Cipher
53061847f8eSopenharmony_ci   * @crossplatform
53161847f8eSopenharmony_ci   * @atomicservice
53261847f8eSopenharmony_ci   * @since 12
53361847f8eSopenharmony_ci   */
53461847f8eSopenharmony_ci  enum CryptoMode {
53561847f8eSopenharmony_ci    /**
53661847f8eSopenharmony_ci     * The value of encryption operation for AES, 3DES and RSA.
53761847f8eSopenharmony_ci     *
53861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
53961847f8eSopenharmony_ci     * @since 9
54061847f8eSopenharmony_ci     */
54161847f8eSopenharmony_ci    /**
54261847f8eSopenharmony_ci     * The value of encryption operation for AES, 3DES and RSA.
54361847f8eSopenharmony_ci     *
54461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
54561847f8eSopenharmony_ci     * @crossplatform
54661847f8eSopenharmony_ci     * @since 11
54761847f8eSopenharmony_ci     */
54861847f8eSopenharmony_ci    /**
54961847f8eSopenharmony_ci     * The value of encryption operation for AES, 3DES and RSA.
55061847f8eSopenharmony_ci     *
55161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
55261847f8eSopenharmony_ci     * @crossplatform
55361847f8eSopenharmony_ci     * @atomicservice
55461847f8eSopenharmony_ci     * @since 12
55561847f8eSopenharmony_ci     */
55661847f8eSopenharmony_ci    ENCRYPT_MODE = 0,
55761847f8eSopenharmony_ci
55861847f8eSopenharmony_ci    /**
55961847f8eSopenharmony_ci     * The value of decryption operation for AES, 3DES and RSA.
56061847f8eSopenharmony_ci     *
56161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
56261847f8eSopenharmony_ci     * @since 9
56361847f8eSopenharmony_ci     */
56461847f8eSopenharmony_ci    /**
56561847f8eSopenharmony_ci     * The value of decryption operation for AES, 3DES and RSA.
56661847f8eSopenharmony_ci     *
56761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
56861847f8eSopenharmony_ci     * @crossplatform
56961847f8eSopenharmony_ci     * @since 11
57061847f8eSopenharmony_ci     */
57161847f8eSopenharmony_ci    /**
57261847f8eSopenharmony_ci     * The value of decryption operation for AES, 3DES and RSA.
57361847f8eSopenharmony_ci     *
57461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
57561847f8eSopenharmony_ci     * @crossplatform
57661847f8eSopenharmony_ci     * @atomicservice
57761847f8eSopenharmony_ci     * @since 12
57861847f8eSopenharmony_ci     */
57961847f8eSopenharmony_ci    DECRYPT_MODE = 1
58061847f8eSopenharmony_ci  }
58161847f8eSopenharmony_ci
58261847f8eSopenharmony_ci  /**
58361847f8eSopenharmony_ci   * Provides the Key type, which is the common parent class of keys.
58461847f8eSopenharmony_ci   *
58561847f8eSopenharmony_ci   * @typedef Key
58661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
58761847f8eSopenharmony_ci   * @since 9
58861847f8eSopenharmony_ci   */
58961847f8eSopenharmony_ci  /**
59061847f8eSopenharmony_ci   * Provides the Key type, which is the common parent class of keys.
59161847f8eSopenharmony_ci   *
59261847f8eSopenharmony_ci   * @typedef Key
59361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
59461847f8eSopenharmony_ci   * @crossplatform
59561847f8eSopenharmony_ci   * @since 11
59661847f8eSopenharmony_ci   */
59761847f8eSopenharmony_ci  /**
59861847f8eSopenharmony_ci   * Provides the Key type, which is the common parent class of keys.
59961847f8eSopenharmony_ci   *
60061847f8eSopenharmony_ci   * @typedef Key
60161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key
60261847f8eSopenharmony_ci   * @crossplatform
60361847f8eSopenharmony_ci   * @atomicservice
60461847f8eSopenharmony_ci   * @since 12
60561847f8eSopenharmony_ci   */
60661847f8eSopenharmony_ci  interface Key {
60761847f8eSopenharmony_ci    /**
60861847f8eSopenharmony_ci     * Encode the key object to binary data.
60961847f8eSopenharmony_ci     *
61061847f8eSopenharmony_ci     * @returns { DataBlob } the binary data of the key object.
61161847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
61261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
61361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
61461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
61561847f8eSopenharmony_ci     * @since 9
61661847f8eSopenharmony_ci     */
61761847f8eSopenharmony_ci    /**
61861847f8eSopenharmony_ci     * Encode the key object to binary data.
61961847f8eSopenharmony_ci     *
62061847f8eSopenharmony_ci     * @returns { DataBlob } the binary data of the key object.
62161847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
62261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
62361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
62461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
62561847f8eSopenharmony_ci     * @crossplatform
62661847f8eSopenharmony_ci     * @since 11
62761847f8eSopenharmony_ci     */
62861847f8eSopenharmony_ci    /**
62961847f8eSopenharmony_ci     * Encode the key object to binary data.
63061847f8eSopenharmony_ci     *
63161847f8eSopenharmony_ci     * @returns { DataBlob } the binary data of the key object.
63261847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
63361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
63461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
63561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key
63661847f8eSopenharmony_ci     * @crossplatform
63761847f8eSopenharmony_ci     * @atomicservice
63861847f8eSopenharmony_ci     * @since 12
63961847f8eSopenharmony_ci     */
64061847f8eSopenharmony_ci    getEncoded(): DataBlob;
64161847f8eSopenharmony_ci
64261847f8eSopenharmony_ci    /**
64361847f8eSopenharmony_ci     * Indicates the format of the key object.
64461847f8eSopenharmony_ci     *
64561847f8eSopenharmony_ci     * @type { string }
64661847f8eSopenharmony_ci     * @readonly
64761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
64861847f8eSopenharmony_ci     * @since 9
64961847f8eSopenharmony_ci     */
65061847f8eSopenharmony_ci    /**
65161847f8eSopenharmony_ci     * Indicates the format of the key object.
65261847f8eSopenharmony_ci     *
65361847f8eSopenharmony_ci     * @type { string }
65461847f8eSopenharmony_ci     * @readonly
65561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
65661847f8eSopenharmony_ci     * @crossplatform
65761847f8eSopenharmony_ci     * @since 11
65861847f8eSopenharmony_ci     */
65961847f8eSopenharmony_ci    /**
66061847f8eSopenharmony_ci     * Indicates the format of the key object.
66161847f8eSopenharmony_ci     *
66261847f8eSopenharmony_ci     * @type { string }
66361847f8eSopenharmony_ci     * @readonly
66461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key
66561847f8eSopenharmony_ci     * @crossplatform
66661847f8eSopenharmony_ci     * @atomicservice
66761847f8eSopenharmony_ci     * @since 12
66861847f8eSopenharmony_ci     */
66961847f8eSopenharmony_ci    readonly format: string;
67061847f8eSopenharmony_ci
67161847f8eSopenharmony_ci    /**
67261847f8eSopenharmony_ci     * Indicates the algorithm name of the key object.
67361847f8eSopenharmony_ci     *
67461847f8eSopenharmony_ci     * @type { string }
67561847f8eSopenharmony_ci     * @readonly
67661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
67761847f8eSopenharmony_ci     * @since 9
67861847f8eSopenharmony_ci     */
67961847f8eSopenharmony_ci    /**
68061847f8eSopenharmony_ci     * Indicates the algorithm name of the key object.
68161847f8eSopenharmony_ci     *
68261847f8eSopenharmony_ci     * @type { string }
68361847f8eSopenharmony_ci     * @readonly
68461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
68561847f8eSopenharmony_ci     * @crossplatform
68661847f8eSopenharmony_ci     * @since 11
68761847f8eSopenharmony_ci     */
68861847f8eSopenharmony_ci    /**
68961847f8eSopenharmony_ci     * Indicates the algorithm name of the key object.
69061847f8eSopenharmony_ci     *
69161847f8eSopenharmony_ci     * @type { string }
69261847f8eSopenharmony_ci     * @readonly
69361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key
69461847f8eSopenharmony_ci     * @crossplatform
69561847f8eSopenharmony_ci     * @atomicservice
69661847f8eSopenharmony_ci     * @since 12
69761847f8eSopenharmony_ci     */
69861847f8eSopenharmony_ci    readonly algName: string;
69961847f8eSopenharmony_ci  }
70061847f8eSopenharmony_ci
70161847f8eSopenharmony_ci  /**
70261847f8eSopenharmony_ci   * Provides the SymKey type, which is used for symmetric cryptography.
70361847f8eSopenharmony_ci   *
70461847f8eSopenharmony_ci   * @typedef SymKey
70561847f8eSopenharmony_ci   * @extends Key
70661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
70761847f8eSopenharmony_ci   * @since 9
70861847f8eSopenharmony_ci   */
70961847f8eSopenharmony_ci  /**
71061847f8eSopenharmony_ci   * Provides the SymKey type, which is used for symmetric cryptography.
71161847f8eSopenharmony_ci   *
71261847f8eSopenharmony_ci   * @typedef SymKey
71361847f8eSopenharmony_ci   * @extends Key
71461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
71561847f8eSopenharmony_ci   * @crossplatform
71661847f8eSopenharmony_ci   * @since 11
71761847f8eSopenharmony_ci   */
71861847f8eSopenharmony_ci  /**
71961847f8eSopenharmony_ci   * Provides the SymKey type, which is used for symmetric cryptography.
72061847f8eSopenharmony_ci   *
72161847f8eSopenharmony_ci   * @typedef SymKey
72261847f8eSopenharmony_ci   * @extends Key
72361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.SymKey
72461847f8eSopenharmony_ci   * @crossplatform
72561847f8eSopenharmony_ci   * @atomicservice
72661847f8eSopenharmony_ci   * @since 12
72761847f8eSopenharmony_ci   */
72861847f8eSopenharmony_ci  interface SymKey extends Key {
72961847f8eSopenharmony_ci    /**
73061847f8eSopenharmony_ci     * Reset the key data to zero in the memory.
73161847f8eSopenharmony_ci     *
73261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
73361847f8eSopenharmony_ci     * @since 9
73461847f8eSopenharmony_ci     */
73561847f8eSopenharmony_ci    /**
73661847f8eSopenharmony_ci     * Reset the key data to zero in the memory.
73761847f8eSopenharmony_ci     *
73861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
73961847f8eSopenharmony_ci     * @crossplatform
74061847f8eSopenharmony_ci     * @since 11
74161847f8eSopenharmony_ci     */
74261847f8eSopenharmony_ci    /**
74361847f8eSopenharmony_ci     * Reset the key data to zero in the memory.
74461847f8eSopenharmony_ci     *
74561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.SymKey
74661847f8eSopenharmony_ci     * @crossplatform
74761847f8eSopenharmony_ci     * @atomicservice
74861847f8eSopenharmony_ci     * @since 12
74961847f8eSopenharmony_ci     */
75061847f8eSopenharmony_ci    clearMem(): void;
75161847f8eSopenharmony_ci  }
75261847f8eSopenharmony_ci
75361847f8eSopenharmony_ci  /**
75461847f8eSopenharmony_ci   * Provides the private key type.
75561847f8eSopenharmony_ci   *
75661847f8eSopenharmony_ci   * @typedef PriKey
75761847f8eSopenharmony_ci   * @extends Key
75861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
75961847f8eSopenharmony_ci   * @since 9
76061847f8eSopenharmony_ci   */
76161847f8eSopenharmony_ci  /**
76261847f8eSopenharmony_ci   * Provides the private key type.
76361847f8eSopenharmony_ci   *
76461847f8eSopenharmony_ci   * @typedef PriKey
76561847f8eSopenharmony_ci   * @extends Key
76661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
76761847f8eSopenharmony_ci   * @crossplatform
76861847f8eSopenharmony_ci   * @since 11
76961847f8eSopenharmony_ci   */
77061847f8eSopenharmony_ci  /**
77161847f8eSopenharmony_ci   * Provides the private key type.
77261847f8eSopenharmony_ci   *
77361847f8eSopenharmony_ci   * @typedef PriKey
77461847f8eSopenharmony_ci   * @extends Key
77561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
77661847f8eSopenharmony_ci   * @crossplatform
77761847f8eSopenharmony_ci   * @atomicservice
77861847f8eSopenharmony_ci   * @since 12
77961847f8eSopenharmony_ci   */
78061847f8eSopenharmony_ci  interface PriKey extends Key {
78161847f8eSopenharmony_ci    /**
78261847f8eSopenharmony_ci     * Clear memory of private key.
78361847f8eSopenharmony_ci     *
78461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
78561847f8eSopenharmony_ci     * @since 9
78661847f8eSopenharmony_ci     */
78761847f8eSopenharmony_ci    /**
78861847f8eSopenharmony_ci     * Clear memory of private key.
78961847f8eSopenharmony_ci     *
79061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
79161847f8eSopenharmony_ci     * @crossplatform
79261847f8eSopenharmony_ci     * @since 11
79361847f8eSopenharmony_ci     */
79461847f8eSopenharmony_ci    /**
79561847f8eSopenharmony_ci     * Clear memory of private key.
79661847f8eSopenharmony_ci     *
79761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
79861847f8eSopenharmony_ci     * @crossplatform
79961847f8eSopenharmony_ci     * @atomicservice
80061847f8eSopenharmony_ci     * @since 12
80161847f8eSopenharmony_ci     */
80261847f8eSopenharmony_ci    clearMem(): void;
80361847f8eSopenharmony_ci
80461847f8eSopenharmony_ci    /**
80561847f8eSopenharmony_ci     * Get the specified parameter of the private key.
80661847f8eSopenharmony_ci     *
80761847f8eSopenharmony_ci     * @param { AsyKeySpecItem } itemType - indicates the specified parameters type.
80861847f8eSopenharmony_ci     * @returns { bigint | string | number } the specified parameters value.
80961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
81061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
81161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
81261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
81361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
81461847f8eSopenharmony_ci     * @since 10
81561847f8eSopenharmony_ci     */
81661847f8eSopenharmony_ci    /**
81761847f8eSopenharmony_ci     * Get the specified parameter of the private key.
81861847f8eSopenharmony_ci     *
81961847f8eSopenharmony_ci     * @param { AsyKeySpecItem } itemType - indicates the specified parameters type.
82061847f8eSopenharmony_ci     * @returns { bigint | string | number } the specified parameters value.
82161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
82261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
82361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
82461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
82561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
82661847f8eSopenharmony_ci     * @crossplatform
82761847f8eSopenharmony_ci     * @since 11
82861847f8eSopenharmony_ci     */
82961847f8eSopenharmony_ci    /**
83061847f8eSopenharmony_ci     * Get the specified parameter of the private key.
83161847f8eSopenharmony_ci     *
83261847f8eSopenharmony_ci     * @param { AsyKeySpecItem } itemType - indicates the specified parameters type.
83361847f8eSopenharmony_ci     * @returns { bigint | string | number } the specified parameters value.
83461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
83561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
83661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
83761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
83861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
83961847f8eSopenharmony_ci     * @crossplatform
84061847f8eSopenharmony_ci     * @atomicservice
84161847f8eSopenharmony_ci     * @since 12
84261847f8eSopenharmony_ci     */
84361847f8eSopenharmony_ci    getAsyKeySpec(itemType: AsyKeySpecItem): bigint | string | number;
84461847f8eSopenharmony_ci
84561847f8eSopenharmony_ci    /**
84661847f8eSopenharmony_ci     * Encode the private key object to binary data in DER format.
84761847f8eSopenharmony_ci     *
84861847f8eSopenharmony_ci     * @param { string } format - indicates the encoding format.
84961847f8eSopenharmony_ci     * @returns { DataBlob } the binary data of the key object in DER format.
85061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
85161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
85261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
85361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
85461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
85561847f8eSopenharmony_ci     * @crossplatform
85661847f8eSopenharmony_ci     * @atomicservice
85761847f8eSopenharmony_ci     * @since 12
85861847f8eSopenharmony_ci     */
85961847f8eSopenharmony_ci    getEncodedDer(format: string): DataBlob;
86061847f8eSopenharmony_ci
86161847f8eSopenharmony_ci    /**
86261847f8eSopenharmony_ci     * Encode the private key object to string in PEM format.
86361847f8eSopenharmony_ci     *
86461847f8eSopenharmony_ci     * @param { string } format - indicates the encoding format.
86561847f8eSopenharmony_ci     * @returns { string } the string of the key object in PEM format.
86661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
86761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
86861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
86961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
87061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
87161847f8eSopenharmony_ci     * @crossplatform
87261847f8eSopenharmony_ci     * @atomicservice
87361847f8eSopenharmony_ci     * @since 12
87461847f8eSopenharmony_ci     */
87561847f8eSopenharmony_ci    getEncodedPem(format: string): string;
87661847f8eSopenharmony_ci  }
87761847f8eSopenharmony_ci
87861847f8eSopenharmony_ci  /**
87961847f8eSopenharmony_ci   * Provides the public key interface for asymmetric keys.
88061847f8eSopenharmony_ci   *
88161847f8eSopenharmony_ci   * @typedef PubKey
88261847f8eSopenharmony_ci   * @extends Key
88361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
88461847f8eSopenharmony_ci   * @since 9
88561847f8eSopenharmony_ci   */
88661847f8eSopenharmony_ci  /**
88761847f8eSopenharmony_ci   * Provides the public key interface for asymmetric keys.
88861847f8eSopenharmony_ci   *
88961847f8eSopenharmony_ci   * @typedef PubKey
89061847f8eSopenharmony_ci   * @extends Key
89161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
89261847f8eSopenharmony_ci   * @crossplatform
89361847f8eSopenharmony_ci   * @since 11
89461847f8eSopenharmony_ci   */
89561847f8eSopenharmony_ci  /**
89661847f8eSopenharmony_ci   * Provides the public key interface for asymmetric keys.
89761847f8eSopenharmony_ci   *
89861847f8eSopenharmony_ci   * @typedef PubKey
89961847f8eSopenharmony_ci   * @extends Key
90061847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
90161847f8eSopenharmony_ci   * @crossplatform
90261847f8eSopenharmony_ci   * @atomicservice
90361847f8eSopenharmony_ci   * @since 12
90461847f8eSopenharmony_ci   */
90561847f8eSopenharmony_ci  interface PubKey extends Key {
90661847f8eSopenharmony_ci    /**
90761847f8eSopenharmony_ci     * Get the specified parameter of the public key.
90861847f8eSopenharmony_ci     *
90961847f8eSopenharmony_ci     * @param { AsyKeySpecItem } itemType - indicates the specified parameters type.
91061847f8eSopenharmony_ci     * @returns { bigint | string | number } the specified parameters value.
91161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
91261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
91361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
91461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
91561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
91661847f8eSopenharmony_ci     * @since 10
91761847f8eSopenharmony_ci     */
91861847f8eSopenharmony_ci    /**
91961847f8eSopenharmony_ci     * Get the specified parameter of the public key.
92061847f8eSopenharmony_ci     *
92161847f8eSopenharmony_ci     * @param { AsyKeySpecItem } itemType - indicates the specified parameters type.
92261847f8eSopenharmony_ci     * @returns { bigint | string | number } the specified parameters value.
92361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
92461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
92561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
92661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
92761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
92861847f8eSopenharmony_ci     * @crossplatform
92961847f8eSopenharmony_ci     * @since 11
93061847f8eSopenharmony_ci     */
93161847f8eSopenharmony_ci    /**
93261847f8eSopenharmony_ci     * Get the specified parameter of the public key.
93361847f8eSopenharmony_ci     *
93461847f8eSopenharmony_ci     * @param { AsyKeySpecItem } itemType - indicates the specified parameters type.
93561847f8eSopenharmony_ci     * @returns { bigint | string | number } the specified parameters value.
93661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
93761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
93861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
93961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
94061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
94161847f8eSopenharmony_ci     * @crossplatform
94261847f8eSopenharmony_ci     * @atomicservice
94361847f8eSopenharmony_ci     * @since 12
94461847f8eSopenharmony_ci     */
94561847f8eSopenharmony_ci    getAsyKeySpec(itemType: AsyKeySpecItem): bigint | string | number;
94661847f8eSopenharmony_ci
94761847f8eSopenharmony_ci    /**
94861847f8eSopenharmony_ci     * Encode the public key object to binary data in DER format.
94961847f8eSopenharmony_ci     *
95061847f8eSopenharmony_ci     * @param { string } format - indicates the encoding format.
95161847f8eSopenharmony_ci     * @returns { DataBlob } the binary data of the key object in DER format.
95261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
95361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
95461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
95561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
95661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
95761847f8eSopenharmony_ci     * @crossplatform
95861847f8eSopenharmony_ci     * @atomicservice
95961847f8eSopenharmony_ci     * @since 12
96061847f8eSopenharmony_ci     */
96161847f8eSopenharmony_ci    getEncodedDer(format: string): DataBlob;
96261847f8eSopenharmony_ci
96361847f8eSopenharmony_ci    /**
96461847f8eSopenharmony_ci     * Encode the public key object to string in PEM format.
96561847f8eSopenharmony_ci     *
96661847f8eSopenharmony_ci     * @param { string } format - indicates the encoding format.
96761847f8eSopenharmony_ci     * @returns { string } the string of the key object in PEM format.
96861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
96961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
97061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
97161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
97261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
97361847f8eSopenharmony_ci     * @crossplatform
97461847f8eSopenharmony_ci     * @atomicservice
97561847f8eSopenharmony_ci     * @since 12
97661847f8eSopenharmony_ci     */
97761847f8eSopenharmony_ci    getEncodedPem(format: string): string;
97861847f8eSopenharmony_ci  }
97961847f8eSopenharmony_ci
98061847f8eSopenharmony_ci  /**
98161847f8eSopenharmony_ci   * Provides the keypair interface for asymmetric keys. A keyPair object contains both private key and public key.
98261847f8eSopenharmony_ci   *
98361847f8eSopenharmony_ci   * @typedef KeyPair
98461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
98561847f8eSopenharmony_ci   * @since 9
98661847f8eSopenharmony_ci   */
98761847f8eSopenharmony_ci  /**
98861847f8eSopenharmony_ci   * Provides the keypair interface for asymmetric keys. A keyPair object contains both private key and public key.
98961847f8eSopenharmony_ci   *
99061847f8eSopenharmony_ci   * @typedef KeyPair
99161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
99261847f8eSopenharmony_ci   * @crossplatform
99361847f8eSopenharmony_ci   * @since 11
99461847f8eSopenharmony_ci   */
99561847f8eSopenharmony_ci  /**
99661847f8eSopenharmony_ci   * Provides the keypair interface for asymmetric keys. A keyPair object contains both private key and public key.
99761847f8eSopenharmony_ci   *
99861847f8eSopenharmony_ci   * @typedef KeyPair
99961847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
100061847f8eSopenharmony_ci   * @crossplatform
100161847f8eSopenharmony_ci   * @atomicservice
100261847f8eSopenharmony_ci   * @since 12
100361847f8eSopenharmony_ci   */
100461847f8eSopenharmony_ci  interface KeyPair {
100561847f8eSopenharmony_ci    /**
100661847f8eSopenharmony_ci     * KeyPair's private key.
100761847f8eSopenharmony_ci     *
100861847f8eSopenharmony_ci     * @type { PriKey }
100961847f8eSopenharmony_ci     * @readonly
101061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
101161847f8eSopenharmony_ci     * @since 9
101261847f8eSopenharmony_ci     */
101361847f8eSopenharmony_ci    /**
101461847f8eSopenharmony_ci     * KeyPair's private key.
101561847f8eSopenharmony_ci     *
101661847f8eSopenharmony_ci     * @type { PriKey }
101761847f8eSopenharmony_ci     * @readonly
101861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
101961847f8eSopenharmony_ci     * @crossplatform
102061847f8eSopenharmony_ci     * @since 11
102161847f8eSopenharmony_ci     */
102261847f8eSopenharmony_ci    /**
102361847f8eSopenharmony_ci     * KeyPair's private key.
102461847f8eSopenharmony_ci     *
102561847f8eSopenharmony_ci     * @type { PriKey }
102661847f8eSopenharmony_ci     * @readonly
102761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
102861847f8eSopenharmony_ci     * @crossplatform
102961847f8eSopenharmony_ci     * @atomicservice
103061847f8eSopenharmony_ci     * @since 12
103161847f8eSopenharmony_ci     */
103261847f8eSopenharmony_ci    readonly priKey: PriKey;
103361847f8eSopenharmony_ci
103461847f8eSopenharmony_ci    /**
103561847f8eSopenharmony_ci     * KeyPair's public key.
103661847f8eSopenharmony_ci     *
103761847f8eSopenharmony_ci     * @type { PubKey }
103861847f8eSopenharmony_ci     * @readonly
103961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
104061847f8eSopenharmony_ci     * @since 9
104161847f8eSopenharmony_ci     */
104261847f8eSopenharmony_ci    /**
104361847f8eSopenharmony_ci     * KeyPair's public key.
104461847f8eSopenharmony_ci     *
104561847f8eSopenharmony_ci     * @type { PubKey }
104661847f8eSopenharmony_ci     * @readonly
104761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
104861847f8eSopenharmony_ci     * @crossplatform
104961847f8eSopenharmony_ci     * @since 11
105061847f8eSopenharmony_ci     */
105161847f8eSopenharmony_ci    /**
105261847f8eSopenharmony_ci     * KeyPair's public key.
105361847f8eSopenharmony_ci     *
105461847f8eSopenharmony_ci     * @type { PubKey }
105561847f8eSopenharmony_ci     * @readonly
105661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
105761847f8eSopenharmony_ci     * @crossplatform
105861847f8eSopenharmony_ci     * @atomicservice
105961847f8eSopenharmony_ci     * @since 12
106061847f8eSopenharmony_ci     */
106161847f8eSopenharmony_ci    readonly pubKey: PubKey;
106261847f8eSopenharmony_ci  }
106361847f8eSopenharmony_ci
106461847f8eSopenharmony_ci  /**
106561847f8eSopenharmony_ci   * Provides the random interface.
106661847f8eSopenharmony_ci   *
106761847f8eSopenharmony_ci   * @typedef Random
106861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
106961847f8eSopenharmony_ci   * @since 9
107061847f8eSopenharmony_ci   */
107161847f8eSopenharmony_ci  /**
107261847f8eSopenharmony_ci   * Provides the random interface.
107361847f8eSopenharmony_ci   *
107461847f8eSopenharmony_ci   * @typedef Random
107561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
107661847f8eSopenharmony_ci   * @crossplatform
107761847f8eSopenharmony_ci   * @atomicservice
107861847f8eSopenharmony_ci   * @since 11
107961847f8eSopenharmony_ci   */
108061847f8eSopenharmony_ci  /**
108161847f8eSopenharmony_ci   * Provides the random interface.
108261847f8eSopenharmony_ci   *
108361847f8eSopenharmony_ci   * @typedef Random
108461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Rand
108561847f8eSopenharmony_ci   * @crossplatform
108661847f8eSopenharmony_ci   * @atomicservice
108761847f8eSopenharmony_ci   * @since 12
108861847f8eSopenharmony_ci   */
108961847f8eSopenharmony_ci  interface Random {
109061847f8eSopenharmony_ci    /**
109161847f8eSopenharmony_ci     * Generate random DataBlob by given length.
109261847f8eSopenharmony_ci     *
109361847f8eSopenharmony_ci     * @param { number } len - indicates the length of random DataBlob.
109461847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback used to return random DataBlob.
109561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
109661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
109761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
109861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
109961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
110061847f8eSopenharmony_ci     * @since 9
110161847f8eSopenharmony_ci     */
110261847f8eSopenharmony_ci    /**
110361847f8eSopenharmony_ci     * Generate random DataBlob by given length.
110461847f8eSopenharmony_ci     *
110561847f8eSopenharmony_ci     * @param { number } len - indicates the length of random DataBlob.
110661847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback used to return random DataBlob.
110761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
110861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
110961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
111061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
111161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
111261847f8eSopenharmony_ci     * @crossplatform
111361847f8eSopenharmony_ci     * @atomicservice
111461847f8eSopenharmony_ci     * @since 11
111561847f8eSopenharmony_ci     */
111661847f8eSopenharmony_ci    /**
111761847f8eSopenharmony_ci     * Generate random DataBlob by given length.
111861847f8eSopenharmony_ci     *
111961847f8eSopenharmony_ci     * @param { number } len - indicates the length of random DataBlob.
112061847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback used to return random DataBlob.
112161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
112261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
112361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
112461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
112561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Rand
112661847f8eSopenharmony_ci     * @crossplatform
112761847f8eSopenharmony_ci     * @atomicservice
112861847f8eSopenharmony_ci     * @since 12
112961847f8eSopenharmony_ci     */
113061847f8eSopenharmony_ci    generateRandom(len: number, callback: AsyncCallback<DataBlob>): void;
113161847f8eSopenharmony_ci
113261847f8eSopenharmony_ci    /**
113361847f8eSopenharmony_ci     * Generate random DataBlob by given length.
113461847f8eSopenharmony_ci     *
113561847f8eSopenharmony_ci     * @param { number } len - indicates the length of random DataBlob.
113661847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise used to return the generated random blob.
113761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
113861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
113961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
114061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
114161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
114261847f8eSopenharmony_ci     * @since 9
114361847f8eSopenharmony_ci     */
114461847f8eSopenharmony_ci    /**
114561847f8eSopenharmony_ci     * Generate random DataBlob by given length.
114661847f8eSopenharmony_ci     *
114761847f8eSopenharmony_ci     * @param { number } len - indicates the length of random DataBlob.
114861847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise used to return the generated random blob.
114961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
115061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
115161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
115261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
115361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
115461847f8eSopenharmony_ci     * @crossplatform
115561847f8eSopenharmony_ci     * @atomicservice
115661847f8eSopenharmony_ci     * @since 11
115761847f8eSopenharmony_ci     */
115861847f8eSopenharmony_ci    /**
115961847f8eSopenharmony_ci     * Generate random DataBlob by given length.
116061847f8eSopenharmony_ci     *
116161847f8eSopenharmony_ci     * @param { number } len - indicates the length of random DataBlob.
116261847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise used to return the generated random blob.
116361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
116461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
116561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
116661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
116761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Rand
116861847f8eSopenharmony_ci     * @crossplatform
116961847f8eSopenharmony_ci     * @atomicservice
117061847f8eSopenharmony_ci     * @since 12
117161847f8eSopenharmony_ci     */
117261847f8eSopenharmony_ci    generateRandom(len: number): Promise<DataBlob>;
117361847f8eSopenharmony_ci
117461847f8eSopenharmony_ci    /**
117561847f8eSopenharmony_ci     * Generate random DataBlob by given length synchronously.
117661847f8eSopenharmony_ci     *
117761847f8eSopenharmony_ci     * @param { number } len - indicates the length of random DataBlob.
117861847f8eSopenharmony_ci     * @returns { DataBlob } return the generated random blob.
117961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
118061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
118161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
118261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
118361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
118461847f8eSopenharmony_ci     * @since 10
118561847f8eSopenharmony_ci     */
118661847f8eSopenharmony_ci    /**
118761847f8eSopenharmony_ci     * Generate random DataBlob by given length synchronously.
118861847f8eSopenharmony_ci     *
118961847f8eSopenharmony_ci     * @param { number } len - indicates the length of random DataBlob.
119061847f8eSopenharmony_ci     * @returns { DataBlob } return the generated random blob.
119161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
119261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
119361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
119461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
119561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
119661847f8eSopenharmony_ci     * @crossplatform
119761847f8eSopenharmony_ci     * @atomicservice
119861847f8eSopenharmony_ci     * @since 11
119961847f8eSopenharmony_ci     */
120061847f8eSopenharmony_ci    /**
120161847f8eSopenharmony_ci     * Generate random DataBlob by given length synchronously.
120261847f8eSopenharmony_ci     *
120361847f8eSopenharmony_ci     * @param { number } len - indicates the length of random DataBlob.
120461847f8eSopenharmony_ci     * @returns { DataBlob } return the generated random blob.
120561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
120661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
120761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
120861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
120961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Rand
121061847f8eSopenharmony_ci     * @crossplatform
121161847f8eSopenharmony_ci     * @atomicservice
121261847f8eSopenharmony_ci     * @since 12
121361847f8eSopenharmony_ci     */
121461847f8eSopenharmony_ci    generateRandomSync(len: number): DataBlob;
121561847f8eSopenharmony_ci
121661847f8eSopenharmony_ci    /**
121761847f8eSopenharmony_ci     * Set seed by given DataBlob.
121861847f8eSopenharmony_ci     *
121961847f8eSopenharmony_ci     * @param { DataBlob } seed - indicates the seed DataBlob.
122061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
122161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
122261847f8eSopenharmony_ci     * @crossplatform
122361847f8eSopenharmony_ci     * @since 9
122461847f8eSopenharmony_ci     */
122561847f8eSopenharmony_ci    /**
122661847f8eSopenharmony_ci     * Set seed by given DataBlob.
122761847f8eSopenharmony_ci     *
122861847f8eSopenharmony_ci     * @param { DataBlob } seed - indicates the seed DataBlob.
122961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
123061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
123161847f8eSopenharmony_ci     * @crossplatform
123261847f8eSopenharmony_ci     * @atomicservice
123361847f8eSopenharmony_ci     * @since 11
123461847f8eSopenharmony_ci     */
123561847f8eSopenharmony_ci    /**
123661847f8eSopenharmony_ci     * Set seed by given DataBlob.
123761847f8eSopenharmony_ci     *
123861847f8eSopenharmony_ci     * @param { DataBlob } seed - indicates the seed DataBlob.
123961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
124061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Rand
124161847f8eSopenharmony_ci     * @crossplatform
124261847f8eSopenharmony_ci     * @atomicservice
124361847f8eSopenharmony_ci     * @since 12
124461847f8eSopenharmony_ci     */
124561847f8eSopenharmony_ci    setSeed(seed: DataBlob): void;
124661847f8eSopenharmony_ci
124761847f8eSopenharmony_ci    /**
124861847f8eSopenharmony_ci     * Indicates the random generation algorithm name.
124961847f8eSopenharmony_ci     *
125061847f8eSopenharmony_ci     * @type { string }
125161847f8eSopenharmony_ci     * @readonly
125261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
125361847f8eSopenharmony_ci     * @since 10
125461847f8eSopenharmony_ci     */
125561847f8eSopenharmony_ci    /**
125661847f8eSopenharmony_ci     * Indicates the random generation algorithm name.
125761847f8eSopenharmony_ci     *
125861847f8eSopenharmony_ci     * @type { string }
125961847f8eSopenharmony_ci     * @readonly
126061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
126161847f8eSopenharmony_ci     * @crossplatform
126261847f8eSopenharmony_ci     * @atomicservice
126361847f8eSopenharmony_ci     * @since 11
126461847f8eSopenharmony_ci     */
126561847f8eSopenharmony_ci    /**
126661847f8eSopenharmony_ci     * Indicates the random generation algorithm name.
126761847f8eSopenharmony_ci     *
126861847f8eSopenharmony_ci     * @type { string }
126961847f8eSopenharmony_ci     * @readonly
127061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Rand
127161847f8eSopenharmony_ci     * @crossplatform
127261847f8eSopenharmony_ci     * @atomicservice
127361847f8eSopenharmony_ci     * @since 12
127461847f8eSopenharmony_ci     */
127561847f8eSopenharmony_ci    readonly algName: string;
127661847f8eSopenharmony_ci  }
127761847f8eSopenharmony_ci
127861847f8eSopenharmony_ci  /**
127961847f8eSopenharmony_ci   * Create a random generator instance.
128061847f8eSopenharmony_ci   *
128161847f8eSopenharmony_ci   * @returns { Random } returns the created rand instance.
128261847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
128361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
128461847f8eSopenharmony_ci   * @since 9
128561847f8eSopenharmony_ci   */
128661847f8eSopenharmony_ci  /**
128761847f8eSopenharmony_ci   * Create a random generator instance.
128861847f8eSopenharmony_ci   *
128961847f8eSopenharmony_ci   * @returns { Random } returns the created rand instance.
129061847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
129161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
129261847f8eSopenharmony_ci   * @crossplatform
129361847f8eSopenharmony_ci   * @atomicservice
129461847f8eSopenharmony_ci   * @since 11
129561847f8eSopenharmony_ci   */
129661847f8eSopenharmony_ci  /**
129761847f8eSopenharmony_ci   * Create a random generator instance.
129861847f8eSopenharmony_ci   *
129961847f8eSopenharmony_ci   * @returns { Random } returns the created rand instance.
130061847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
130161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Rand
130261847f8eSopenharmony_ci   * @crossplatform
130361847f8eSopenharmony_ci   * @atomicservice
130461847f8eSopenharmony_ci   * @since 12
130561847f8eSopenharmony_ci   */
130661847f8eSopenharmony_ci  function createRandom(): Random;
130761847f8eSopenharmony_ci
130861847f8eSopenharmony_ci  /**
130961847f8eSopenharmony_ci   * The AsyKeyGenerator provides the ability to generate or convert keyPair.
131061847f8eSopenharmony_ci   *
131161847f8eSopenharmony_ci   * @typedef AsyKeyGenerator
131261847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
131361847f8eSopenharmony_ci   * @since 9
131461847f8eSopenharmony_ci   */
131561847f8eSopenharmony_ci  /**
131661847f8eSopenharmony_ci   * The AsyKeyGenerator provides the ability to generate or convert keyPair.
131761847f8eSopenharmony_ci   *
131861847f8eSopenharmony_ci   * @typedef AsyKeyGenerator
131961847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
132061847f8eSopenharmony_ci   * @crossplatform
132161847f8eSopenharmony_ci   * @since 11
132261847f8eSopenharmony_ci   */
132361847f8eSopenharmony_ci  /**
132461847f8eSopenharmony_ci   * The AsyKeyGenerator provides the ability to generate or convert keyPair.
132561847f8eSopenharmony_ci   *
132661847f8eSopenharmony_ci   * @typedef AsyKeyGenerator
132761847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
132861847f8eSopenharmony_ci   * @crossplatform
132961847f8eSopenharmony_ci   * @atomicservice
133061847f8eSopenharmony_ci   * @since 12
133161847f8eSopenharmony_ci   */
133261847f8eSopenharmony_ci  interface AsyKeyGenerator {
133361847f8eSopenharmony_ci    /**
133461847f8eSopenharmony_ci     * Used to generate asymmetric keypair.
133561847f8eSopenharmony_ci     *
133661847f8eSopenharmony_ci     * @param { AsyncCallback<KeyPair> } callback - the callback used to return keypair.
133761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: Incorrect parameter types;
133861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
133961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
134061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
134161847f8eSopenharmony_ci     * @since 9
134261847f8eSopenharmony_ci     */
134361847f8eSopenharmony_ci    /**
134461847f8eSopenharmony_ci     * Used to generate asymmetric keypair.
134561847f8eSopenharmony_ci     *
134661847f8eSopenharmony_ci     * @param { AsyncCallback<KeyPair> } callback - the callback used to return keypair.
134761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: Incorrect parameter types;
134861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
134961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
135061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
135161847f8eSopenharmony_ci     * @crossplatform
135261847f8eSopenharmony_ci     * @since 11
135361847f8eSopenharmony_ci     */
135461847f8eSopenharmony_ci    /**
135561847f8eSopenharmony_ci     * Used to generate asymmetric keypair.
135661847f8eSopenharmony_ci     *
135761847f8eSopenharmony_ci     * @param { AsyncCallback<KeyPair> } callback - the callback used to return keypair.
135861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: Incorrect parameter types;
135961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
136061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
136161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
136261847f8eSopenharmony_ci     * @crossplatform
136361847f8eSopenharmony_ci     * @atomicservice
136461847f8eSopenharmony_ci     * @since 12
136561847f8eSopenharmony_ci     */
136661847f8eSopenharmony_ci    generateKeyPair(callback: AsyncCallback<KeyPair>): void;
136761847f8eSopenharmony_ci
136861847f8eSopenharmony_ci    /**
136961847f8eSopenharmony_ci     * Used to generate asymmetric keypair.
137061847f8eSopenharmony_ci     *
137161847f8eSopenharmony_ci     * @returns { Promise<KeyPair> } the promise used to return keypair.
137261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
137361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
137461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
137561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
137661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
137761847f8eSopenharmony_ci     * @since 9
137861847f8eSopenharmony_ci     */
137961847f8eSopenharmony_ci    /**
138061847f8eSopenharmony_ci     * Used to generate asymmetric keypair.
138161847f8eSopenharmony_ci     *
138261847f8eSopenharmony_ci     * @returns { Promise<KeyPair> } the promise used to return keypair.
138361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
138461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
138561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
138661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
138761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
138861847f8eSopenharmony_ci     * @crossplatform
138961847f8eSopenharmony_ci     * @since 11
139061847f8eSopenharmony_ci     */
139161847f8eSopenharmony_ci    /**
139261847f8eSopenharmony_ci     * Used to generate asymmetric keypair.
139361847f8eSopenharmony_ci     *
139461847f8eSopenharmony_ci     * @returns { Promise<KeyPair> } the promise used to return keypair.
139561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
139661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
139761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
139861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
139961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
140061847f8eSopenharmony_ci     * @crossplatform
140161847f8eSopenharmony_ci     * @atomicservice
140261847f8eSopenharmony_ci     * @since 12
140361847f8eSopenharmony_ci     */
140461847f8eSopenharmony_ci    generateKeyPair(): Promise<KeyPair>;
140561847f8eSopenharmony_ci
140661847f8eSopenharmony_ci    /**
140761847f8eSopenharmony_ci     * Used to generate asymmetric keypair.
140861847f8eSopenharmony_ci     *
140961847f8eSopenharmony_ci     * @returns { KeyPair } return keypair.
141061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
141161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
141261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
141361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
141461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
141561847f8eSopenharmony_ci     * @crossplatform
141661847f8eSopenharmony_ci     * @atomicservice
141761847f8eSopenharmony_ci     * @since 12
141861847f8eSopenharmony_ci     */
141961847f8eSopenharmony_ci    generateKeyPairSync(): KeyPair;
142061847f8eSopenharmony_ci
142161847f8eSopenharmony_ci    /**
142261847f8eSopenharmony_ci     * Used to convert asymmetric key data to keypair object.
142361847f8eSopenharmony_ci     *
142461847f8eSopenharmony_ci     * @param { DataBlob } pubKey - the public key data blob.
142561847f8eSopenharmony_ci     * @param { DataBlob } priKey - the private key data blob.
142661847f8eSopenharmony_ci     * @param { AsyncCallback<KeyPair> } callback - the callback used to return keypair.
142761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
142861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
142961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
143061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
143161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
143261847f8eSopenharmony_ci     * @since 9
143361847f8eSopenharmony_ci     */
143461847f8eSopenharmony_ci    /**
143561847f8eSopenharmony_ci     * Used to convert asymmetric key data to keypair object.
143661847f8eSopenharmony_ci     *
143761847f8eSopenharmony_ci     * @param { DataBlob } pubKey - the public key data blob.
143861847f8eSopenharmony_ci     * @param { DataBlob } priKey - the private key data blob.
143961847f8eSopenharmony_ci     * @param { AsyncCallback<KeyPair> } callback - the callback used to return keypair.
144061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
144161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
144261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
144361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
144461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
144561847f8eSopenharmony_ci     * @crossplatform
144661847f8eSopenharmony_ci     * @since 11
144761847f8eSopenharmony_ci     */
144861847f8eSopenharmony_ci    /**
144961847f8eSopenharmony_ci     * Used to convert asymmetric key data to keypair object.
145061847f8eSopenharmony_ci     *
145161847f8eSopenharmony_ci     * @param { DataBlob } pubKey - the public key data blob.
145261847f8eSopenharmony_ci     * @param { DataBlob } priKey - the private key data blob.
145361847f8eSopenharmony_ci     * @param { AsyncCallback<KeyPair> } callback - the callback used to return keypair.
145461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
145561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
145661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
145761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
145861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
145961847f8eSopenharmony_ci     * @crossplatform
146061847f8eSopenharmony_ci     * @atomicservice
146161847f8eSopenharmony_ci     * @since 12
146261847f8eSopenharmony_ci     */
146361847f8eSopenharmony_ci    convertKey(pubKey: DataBlob, priKey: DataBlob, callback: AsyncCallback<KeyPair>): void;
146461847f8eSopenharmony_ci
146561847f8eSopenharmony_ci    /**
146661847f8eSopenharmony_ci     * Used to convert asymmetric key data to keypair object.
146761847f8eSopenharmony_ci     *
146861847f8eSopenharmony_ci     * @param { DataBlob | null } pubKey - the public key data blob.
146961847f8eSopenharmony_ci     * @param { DataBlob | null } priKey - the private key data blob.
147061847f8eSopenharmony_ci     * @param { AsyncCallback<KeyPair> } callback - the callback used to return keypair.
147161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
147261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
147361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
147461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
147561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
147661847f8eSopenharmony_ci     * @since 10
147761847f8eSopenharmony_ci     */
147861847f8eSopenharmony_ci    /**
147961847f8eSopenharmony_ci     * Used to convert asymmetric key data to keypair object.
148061847f8eSopenharmony_ci     *
148161847f8eSopenharmony_ci     * @param { DataBlob | null } pubKey - the public key data blob.
148261847f8eSopenharmony_ci     * @param { DataBlob | null } priKey - the private key data blob.
148361847f8eSopenharmony_ci     * @param { AsyncCallback<KeyPair> } callback - the callback used to return keypair.
148461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
148561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
148661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
148761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
148861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
148961847f8eSopenharmony_ci     * @crossplatform
149061847f8eSopenharmony_ci     * @since 11
149161847f8eSopenharmony_ci     */
149261847f8eSopenharmony_ci    /**
149361847f8eSopenharmony_ci     * Used to convert asymmetric key data to keypair object.
149461847f8eSopenharmony_ci     *
149561847f8eSopenharmony_ci     * @param { DataBlob | null } pubKey - the public key data blob.
149661847f8eSopenharmony_ci     * @param { DataBlob | null } priKey - the private key data blob.
149761847f8eSopenharmony_ci     * @param { AsyncCallback<KeyPair> } callback - the callback used to return keypair.
149861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
149961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
150061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
150161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
150261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
150361847f8eSopenharmony_ci     * @crossplatform
150461847f8eSopenharmony_ci     * @atomicservice
150561847f8eSopenharmony_ci     * @since 12
150661847f8eSopenharmony_ci     */
150761847f8eSopenharmony_ci    convertKey(pubKey: DataBlob | null, priKey: DataBlob | null, callback: AsyncCallback<KeyPair>): void;
150861847f8eSopenharmony_ci
150961847f8eSopenharmony_ci    /**
151061847f8eSopenharmony_ci     * Used to convert asymmetric key data to keypair object.
151161847f8eSopenharmony_ci     *
151261847f8eSopenharmony_ci     * @param { DataBlob } pubKey - the public key data blob.
151361847f8eSopenharmony_ci     * @param { DataBlob } priKey - the private key data blob.
151461847f8eSopenharmony_ci     * @returns { Promise<KeyPair> } the promise used to return keypair.
151561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
151661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
151761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
151861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
151961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
152061847f8eSopenharmony_ci     * @since 9
152161847f8eSopenharmony_ci     */
152261847f8eSopenharmony_ci    /**
152361847f8eSopenharmony_ci     * Used to convert asymmetric key data to keypair object.
152461847f8eSopenharmony_ci     *
152561847f8eSopenharmony_ci     * @param { DataBlob } pubKey - the public key data blob.
152661847f8eSopenharmony_ci     * @param { DataBlob } priKey - the private key data blob.
152761847f8eSopenharmony_ci     * @returns { Promise<KeyPair> } the promise used to return keypair.
152861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
152961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
153061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
153161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
153261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
153361847f8eSopenharmony_ci     * @crossplatform
153461847f8eSopenharmony_ci     * @since 11
153561847f8eSopenharmony_ci     */
153661847f8eSopenharmony_ci    /**
153761847f8eSopenharmony_ci     * Used to convert asymmetric key data to keypair object.
153861847f8eSopenharmony_ci     *
153961847f8eSopenharmony_ci     * @param { DataBlob } pubKey - the public key data blob.
154061847f8eSopenharmony_ci     * @param { DataBlob } priKey - the private key data blob.
154161847f8eSopenharmony_ci     * @returns { Promise<KeyPair> } the promise used to return keypair.
154261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
154361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
154461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
154561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
154661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
154761847f8eSopenharmony_ci     * @crossplatform
154861847f8eSopenharmony_ci     * @atomicservice
154961847f8eSopenharmony_ci     * @since 12
155061847f8eSopenharmony_ci     */
155161847f8eSopenharmony_ci    convertKey(pubKey: DataBlob, priKey: DataBlob): Promise<KeyPair>;
155261847f8eSopenharmony_ci
155361847f8eSopenharmony_ci    /**
155461847f8eSopenharmony_ci     * Used to convert asymmetric key data to keypair object.
155561847f8eSopenharmony_ci     *
155661847f8eSopenharmony_ci     * @param { DataBlob | null } pubKey - the public key data blob.
155761847f8eSopenharmony_ci     * @param { DataBlob | null } priKey - the private key data blob.
155861847f8eSopenharmony_ci     * @returns { Promise<KeyPair> } the promise used to return keypair.
155961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
156061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
156161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
156261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
156361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
156461847f8eSopenharmony_ci     * @since 10
156561847f8eSopenharmony_ci     */
156661847f8eSopenharmony_ci    /**
156761847f8eSopenharmony_ci     * Used to convert asymmetric key data to keypair object.
156861847f8eSopenharmony_ci     *
156961847f8eSopenharmony_ci     * @param { DataBlob | null } pubKey - the public key data blob.
157061847f8eSopenharmony_ci     * @param { DataBlob | null } priKey - the private key data blob.
157161847f8eSopenharmony_ci     * @returns { Promise<KeyPair> } the promise used to return keypair.
157261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
157361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
157461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
157561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
157661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
157761847f8eSopenharmony_ci     * @crossplatform
157861847f8eSopenharmony_ci     * @since 11
157961847f8eSopenharmony_ci     */
158061847f8eSopenharmony_ci    /**
158161847f8eSopenharmony_ci     * Used to convert asymmetric key data to keypair object.
158261847f8eSopenharmony_ci     *
158361847f8eSopenharmony_ci     * @param { DataBlob | null } pubKey - the public key data blob.
158461847f8eSopenharmony_ci     * @param { DataBlob | null } priKey - the private key data blob.
158561847f8eSopenharmony_ci     * @returns { Promise<KeyPair> } the promise used to return keypair.
158661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
158761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
158861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
158961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
159061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
159161847f8eSopenharmony_ci     * @crossplatform
159261847f8eSopenharmony_ci     * @atomicservice
159361847f8eSopenharmony_ci     * @since 12
159461847f8eSopenharmony_ci     */
159561847f8eSopenharmony_ci    convertKey(pubKey: DataBlob | null, priKey: DataBlob | null): Promise<KeyPair>;
159661847f8eSopenharmony_ci
159761847f8eSopenharmony_ci    /**
159861847f8eSopenharmony_ci     * Used to convert asymmetric key data to keypair object.
159961847f8eSopenharmony_ci     *
160061847f8eSopenharmony_ci     * @param { DataBlob | null } pubKey - the public key data blob.
160161847f8eSopenharmony_ci     * @param { DataBlob | null } priKey - the private key data blob.
160261847f8eSopenharmony_ci     * @returns { KeyPair } return keypair.
160361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
160461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
160561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
160661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
160761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
160861847f8eSopenharmony_ci     * @crossplatform
160961847f8eSopenharmony_ci     * @atomicservice
161061847f8eSopenharmony_ci     * @since 12
161161847f8eSopenharmony_ci     */
161261847f8eSopenharmony_ci    convertKeySync(pubKey: DataBlob | null, priKey: DataBlob | null): KeyPair;
161361847f8eSopenharmony_ci
161461847f8eSopenharmony_ci    /**
161561847f8eSopenharmony_ci     * Used to convert asymmetric key in PEM format to keypair object.
161661847f8eSopenharmony_ci     *
161761847f8eSopenharmony_ci     * @param { string | null } pubKey - the public key string in PEM format.
161861847f8eSopenharmony_ci     * @param { string | null } priKey - the private key string in PEM format.
161961847f8eSopenharmony_ci     * @returns { Promise<KeyPair> } return keypair.
162061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
162161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
162261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
162361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
162461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
162561847f8eSopenharmony_ci     * @crossplatform
162661847f8eSopenharmony_ci     * @atomicservice
162761847f8eSopenharmony_ci     * @since 12
162861847f8eSopenharmony_ci     */
162961847f8eSopenharmony_ci    convertPemKey(pubKey: string | null, priKey: string | null): Promise<KeyPair>;
163061847f8eSopenharmony_ci
163161847f8eSopenharmony_ci    /**
163261847f8eSopenharmony_ci     * Used to convert asymmetric key in PEM format to keypair object.
163361847f8eSopenharmony_ci     *
163461847f8eSopenharmony_ci     * @param { string | null } pubKey - the public key string in PEM format.
163561847f8eSopenharmony_ci     * @param { string | null } priKey - the private key string in PEM format.
163661847f8eSopenharmony_ci     * @returns { KeyPair } return keypair.
163761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
163861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
163961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
164061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
164161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
164261847f8eSopenharmony_ci     * @crossplatform
164361847f8eSopenharmony_ci     * @atomicservice
164461847f8eSopenharmony_ci     * @since 12
164561847f8eSopenharmony_ci     */
164661847f8eSopenharmony_ci    convertPemKeySync(pubKey: string | null, priKey: string | null): KeyPair;
164761847f8eSopenharmony_ci
164861847f8eSopenharmony_ci    /**
164961847f8eSopenharmony_ci     * The algName of the AsyKeyGenerator.
165061847f8eSopenharmony_ci     *
165161847f8eSopenharmony_ci     * @type { string }
165261847f8eSopenharmony_ci     * @readonly
165361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
165461847f8eSopenharmony_ci     * @since 9
165561847f8eSopenharmony_ci     */
165661847f8eSopenharmony_ci    /**
165761847f8eSopenharmony_ci     * The algName of the AsyKeyGenerator.
165861847f8eSopenharmony_ci     *
165961847f8eSopenharmony_ci     * @type { string }
166061847f8eSopenharmony_ci     * @readonly
166161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
166261847f8eSopenharmony_ci     * @crossplatform
166361847f8eSopenharmony_ci     * @since 11
166461847f8eSopenharmony_ci     */
166561847f8eSopenharmony_ci    /**
166661847f8eSopenharmony_ci     * The algName of the AsyKeyGenerator.
166761847f8eSopenharmony_ci     *
166861847f8eSopenharmony_ci     * @type { string }
166961847f8eSopenharmony_ci     * @readonly
167061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
167161847f8eSopenharmony_ci     * @crossplatform
167261847f8eSopenharmony_ci     * @atomicservice
167361847f8eSopenharmony_ci     * @since 12
167461847f8eSopenharmony_ci     */
167561847f8eSopenharmony_ci    readonly algName: string;
167661847f8eSopenharmony_ci  }
167761847f8eSopenharmony_ci
167861847f8eSopenharmony_ci  /**
167961847f8eSopenharmony_ci   * Provides the SymKeyGenerator type, which is used for generating symmetric key.
168061847f8eSopenharmony_ci   *
168161847f8eSopenharmony_ci   * @typedef SymKeyGenerator
168261847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
168361847f8eSopenharmony_ci   * @since 9
168461847f8eSopenharmony_ci   */
168561847f8eSopenharmony_ci  /**
168661847f8eSopenharmony_ci   * Provides the SymKeyGenerator type, which is used for generating symmetric key.
168761847f8eSopenharmony_ci   *
168861847f8eSopenharmony_ci   * @typedef SymKeyGenerator
168961847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
169061847f8eSopenharmony_ci   * @crossplatform
169161847f8eSopenharmony_ci   * @since 11
169261847f8eSopenharmony_ci   */
169361847f8eSopenharmony_ci  /**
169461847f8eSopenharmony_ci   * Provides the SymKeyGenerator type, which is used for generating symmetric key.
169561847f8eSopenharmony_ci   *
169661847f8eSopenharmony_ci   * @typedef SymKeyGenerator
169761847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.SymKey
169861847f8eSopenharmony_ci   * @crossplatform
169961847f8eSopenharmony_ci   * @atomicservice
170061847f8eSopenharmony_ci   * @since 12
170161847f8eSopenharmony_ci   */
170261847f8eSopenharmony_ci  interface SymKeyGenerator {
170361847f8eSopenharmony_ci    /**
170461847f8eSopenharmony_ci     * Generate a symmetric key object randomly.
170561847f8eSopenharmony_ci     *
170661847f8eSopenharmony_ci     * @param { AsyncCallback<SymKey> } callback - the callback of generateSymKey.
170761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
170861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
170961847f8eSopenharmony_ci     * @since 9
171061847f8eSopenharmony_ci     */
171161847f8eSopenharmony_ci    /**
171261847f8eSopenharmony_ci     * Generate a symmetric key object randomly.
171361847f8eSopenharmony_ci     *
171461847f8eSopenharmony_ci     * @param { AsyncCallback<SymKey> } callback - the callback of generateSymKey.
171561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
171661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
171761847f8eSopenharmony_ci     * @crossplatform
171861847f8eSopenharmony_ci     * @since 11
171961847f8eSopenharmony_ci     */
172061847f8eSopenharmony_ci    /**
172161847f8eSopenharmony_ci     * Generate a symmetric key object randomly.
172261847f8eSopenharmony_ci     *
172361847f8eSopenharmony_ci     * @param { AsyncCallback<SymKey> } callback - the callback of generateSymKey.
172461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
172561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.SymKey
172661847f8eSopenharmony_ci     * @crossplatform
172761847f8eSopenharmony_ci     * @atomicservice
172861847f8eSopenharmony_ci     * @since 12
172961847f8eSopenharmony_ci     */
173061847f8eSopenharmony_ci    generateSymKey(callback: AsyncCallback<SymKey>): void;
173161847f8eSopenharmony_ci
173261847f8eSopenharmony_ci    /**
173361847f8eSopenharmony_ci     * Generate a symmetric key object randomly.
173461847f8eSopenharmony_ci     *
173561847f8eSopenharmony_ci     * @returns { Promise<SymKey> } the promise returned by the function.
173661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
173761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
173861847f8eSopenharmony_ci     * @since 9
173961847f8eSopenharmony_ci     */
174061847f8eSopenharmony_ci    /**
174161847f8eSopenharmony_ci     * Generate a symmetric key object randomly.
174261847f8eSopenharmony_ci     *
174361847f8eSopenharmony_ci     * @returns { Promise<SymKey> } the promise returned by the function.
174461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
174561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
174661847f8eSopenharmony_ci     * @crossplatform
174761847f8eSopenharmony_ci     * @since 11
174861847f8eSopenharmony_ci     */
174961847f8eSopenharmony_ci    /**
175061847f8eSopenharmony_ci     * Generate a symmetric key object randomly.
175161847f8eSopenharmony_ci     *
175261847f8eSopenharmony_ci     * @returns { Promise<SymKey> } the promise returned by the function.
175361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
175461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.SymKey
175561847f8eSopenharmony_ci     * @crossplatform
175661847f8eSopenharmony_ci     * @atomicservice
175761847f8eSopenharmony_ci     * @since 12
175861847f8eSopenharmony_ci     */
175961847f8eSopenharmony_ci    generateSymKey(): Promise<SymKey>;
176061847f8eSopenharmony_ci
176161847f8eSopenharmony_ci    /**
176261847f8eSopenharmony_ci     * Generate a symmetric key object randomly.
176361847f8eSopenharmony_ci     *
176461847f8eSopenharmony_ci     * @returns { SymKey } return SymKey.
176561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
176661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.SymKey
176761847f8eSopenharmony_ci     * @crossplatform
176861847f8eSopenharmony_ci     * @atomicservice
176961847f8eSopenharmony_ci     * @since 12
177061847f8eSopenharmony_ci     */
177161847f8eSopenharmony_ci    generateSymKeySync(): SymKey;
177261847f8eSopenharmony_ci
177361847f8eSopenharmony_ci    /**
177461847f8eSopenharmony_ci     * Used to convert symmetric key data to a symmetric key object.
177561847f8eSopenharmony_ci     *
177661847f8eSopenharmony_ci     * @param { DataBlob } key - the key data blob.
177761847f8eSopenharmony_ci     * @param { AsyncCallback<SymKey> } callback - the callback of generateSymKey.
177861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
177961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
178061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
178161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
178261847f8eSopenharmony_ci     * @since 9
178361847f8eSopenharmony_ci     */
178461847f8eSopenharmony_ci    /**
178561847f8eSopenharmony_ci     * Used to convert symmetric key data to a symmetric key object.
178661847f8eSopenharmony_ci     *
178761847f8eSopenharmony_ci     * @param { DataBlob } key - the key data blob.
178861847f8eSopenharmony_ci     * @param { AsyncCallback<SymKey> } callback - the callback of generateSymKey.
178961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
179061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
179161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
179261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
179361847f8eSopenharmony_ci     * @crossplatform
179461847f8eSopenharmony_ci     * @since 11
179561847f8eSopenharmony_ci     */
179661847f8eSopenharmony_ci    /**
179761847f8eSopenharmony_ci     * Used to convert symmetric key data to a symmetric key object.
179861847f8eSopenharmony_ci     *
179961847f8eSopenharmony_ci     * @param { DataBlob } key - the key data blob.
180061847f8eSopenharmony_ci     * @param { AsyncCallback<SymKey> } callback - the callback of generateSymKey.
180161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
180261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
180361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
180461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.SymKey
180561847f8eSopenharmony_ci     * @crossplatform
180661847f8eSopenharmony_ci     * @atomicservice
180761847f8eSopenharmony_ci     * @since 12
180861847f8eSopenharmony_ci     */
180961847f8eSopenharmony_ci    convertKey(key: DataBlob, callback: AsyncCallback<SymKey>): void;
181061847f8eSopenharmony_ci
181161847f8eSopenharmony_ci    /**
181261847f8eSopenharmony_ci     * Used to convert symmetric key data to a symmetric key object.
181361847f8eSopenharmony_ci     *
181461847f8eSopenharmony_ci     * @param { DataBlob } key - the key data blob.
181561847f8eSopenharmony_ci     * @returns { Promise<SymKey> } the promise returned by the function.
181661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
181761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
181861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
181961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
182061847f8eSopenharmony_ci     * @since 9
182161847f8eSopenharmony_ci     */
182261847f8eSopenharmony_ci    /**
182361847f8eSopenharmony_ci     * Used to convert symmetric key data to a symmetric key object.
182461847f8eSopenharmony_ci     *
182561847f8eSopenharmony_ci     * @param { DataBlob } key - the key data blob.
182661847f8eSopenharmony_ci     * @returns { Promise<SymKey> } the promise returned by the function.
182761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
182861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
182961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
183061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
183161847f8eSopenharmony_ci     * @crossplatform
183261847f8eSopenharmony_ci     * @since 11
183361847f8eSopenharmony_ci     */
183461847f8eSopenharmony_ci    /**
183561847f8eSopenharmony_ci     * Used to convert symmetric key data to a symmetric key object.
183661847f8eSopenharmony_ci     *
183761847f8eSopenharmony_ci     * @param { DataBlob } key - the key data blob.
183861847f8eSopenharmony_ci     * @returns { Promise<SymKey> } the promise returned by the function.
183961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
184061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
184161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
184261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.SymKey
184361847f8eSopenharmony_ci     * @crossplatform
184461847f8eSopenharmony_ci     * @atomicservice
184561847f8eSopenharmony_ci     * @since 12
184661847f8eSopenharmony_ci     */
184761847f8eSopenharmony_ci    convertKey(key: DataBlob): Promise<SymKey>;
184861847f8eSopenharmony_ci
184961847f8eSopenharmony_ci    /**
185061847f8eSopenharmony_ci     * Used to convert symmetric key data to a symmetric key object.
185161847f8eSopenharmony_ci     *
185261847f8eSopenharmony_ci     * @param { DataBlob } key - the key data blob.
185361847f8eSopenharmony_ci     * @returns { SymKey } return SymKey.
185461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
185561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
185661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
185761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.SymKey
185861847f8eSopenharmony_ci     * @crossplatform
185961847f8eSopenharmony_ci     * @atomicservice
186061847f8eSopenharmony_ci     * @since 12
186161847f8eSopenharmony_ci     */
186261847f8eSopenharmony_ci    convertKeySync(key: DataBlob): SymKey;
186361847f8eSopenharmony_ci
186461847f8eSopenharmony_ci    /**
186561847f8eSopenharmony_ci     * Indicates the algorithm name of the SymKeyGenerator object.
186661847f8eSopenharmony_ci     *
186761847f8eSopenharmony_ci     * @type { string }
186861847f8eSopenharmony_ci     * @readonly
186961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
187061847f8eSopenharmony_ci     * @since 9
187161847f8eSopenharmony_ci     */
187261847f8eSopenharmony_ci    /**
187361847f8eSopenharmony_ci     * Indicates the algorithm name of the SymKeyGenerator object.
187461847f8eSopenharmony_ci     *
187561847f8eSopenharmony_ci     * @type { string }
187661847f8eSopenharmony_ci     * @readonly
187761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
187861847f8eSopenharmony_ci     * @crossplatform
187961847f8eSopenharmony_ci     * @since 11
188061847f8eSopenharmony_ci     */
188161847f8eSopenharmony_ci    /**
188261847f8eSopenharmony_ci     * Indicates the algorithm name of the SymKeyGenerator object.
188361847f8eSopenharmony_ci     *
188461847f8eSopenharmony_ci     * @type { string }
188561847f8eSopenharmony_ci     * @readonly
188661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.SymKey
188761847f8eSopenharmony_ci     * @crossplatform
188861847f8eSopenharmony_ci     * @atomicservice
188961847f8eSopenharmony_ci     * @since 12
189061847f8eSopenharmony_ci     */
189161847f8eSopenharmony_ci    readonly algName: string;
189261847f8eSopenharmony_ci  }
189361847f8eSopenharmony_ci
189461847f8eSopenharmony_ci  /**
189561847f8eSopenharmony_ci   * Create the asymmetric key generator instance according to the given algorithm name.
189661847f8eSopenharmony_ci   *
189761847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name. Multiple parameters need to be concatenated by "|".
189861847f8eSopenharmony_ci   * @returns { AsyKeyGenerator } the asymmetric key generator instance.
189961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
190061847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
190161847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
190261847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
190361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
190461847f8eSopenharmony_ci   * @since 9
190561847f8eSopenharmony_ci   */
190661847f8eSopenharmony_ci  /**
190761847f8eSopenharmony_ci   * Create the asymmetric key generator instance according to the given algorithm name.
190861847f8eSopenharmony_ci   *
190961847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name.
191061847f8eSopenharmony_ci   * @returns { AsyKeyGenerator } the asymmetric key generator instance. Multiple parameters need to be concatenated by "|".
191161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
191261847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
191361847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
191461847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
191561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
191661847f8eSopenharmony_ci   * @crossplatform
191761847f8eSopenharmony_ci   * @since 11
191861847f8eSopenharmony_ci   */
191961847f8eSopenharmony_ci  /**
192061847f8eSopenharmony_ci   * Create the asymmetric key generator instance according to the given algorithm name.
192161847f8eSopenharmony_ci   *
192261847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name. Multiple parameters need to be concatenated by "|".
192361847f8eSopenharmony_ci   * @returns { AsyKeyGenerator } the asymmetric key generator instance.
192461847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
192561847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
192661847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
192761847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
192861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
192961847f8eSopenharmony_ci   * @crossplatform
193061847f8eSopenharmony_ci   * @atomicservice
193161847f8eSopenharmony_ci   * @since 12
193261847f8eSopenharmony_ci   */
193361847f8eSopenharmony_ci  function createAsyKeyGenerator(algName: string): AsyKeyGenerator;
193461847f8eSopenharmony_ci
193561847f8eSopenharmony_ci  /**
193661847f8eSopenharmony_ci   * Create a symmetric key generator according to the given algorithm name.
193761847f8eSopenharmony_ci   *
193861847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name.
193961847f8eSopenharmony_ci   * @returns { SymKeyGenerator } the symmetric key generator instance. Multiple parameters need to be concatenated by "|".
194061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
194161847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
194261847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
194361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
194461847f8eSopenharmony_ci   * @since 9
194561847f8eSopenharmony_ci   */
194661847f8eSopenharmony_ci  /**
194761847f8eSopenharmony_ci   * Create a symmetric key generator according to the given algorithm name.
194861847f8eSopenharmony_ci   *
194961847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name. Multiple parameters need to be concatenated by "|".
195061847f8eSopenharmony_ci   * @returns { SymKeyGenerator } the symmetric key generator instance.
195161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
195261847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
195361847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
195461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
195561847f8eSopenharmony_ci   * @crossplatform
195661847f8eSopenharmony_ci   * @since 11
195761847f8eSopenharmony_ci   */
195861847f8eSopenharmony_ci  /**
195961847f8eSopenharmony_ci   * Create a symmetric key generator according to the given algorithm name.
196061847f8eSopenharmony_ci   *
196161847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name. Multiple parameters need to be concatenated by "|".
196261847f8eSopenharmony_ci   * @returns { SymKeyGenerator } the symmetric key generator instance.
196361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
196461847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
196561847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
196661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.SymKey
196761847f8eSopenharmony_ci   * @crossplatform
196861847f8eSopenharmony_ci   * @atomicservice
196961847f8eSopenharmony_ci   * @since 12
197061847f8eSopenharmony_ci   */
197161847f8eSopenharmony_ci  function createSymKeyGenerator(algName: string): SymKeyGenerator;
197261847f8eSopenharmony_ci
197361847f8eSopenharmony_ci  /**
197461847f8eSopenharmony_ci   * Provides the Mac type, which is used for Mac generation.
197561847f8eSopenharmony_ci   *
197661847f8eSopenharmony_ci   * @typedef Mac
197761847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
197861847f8eSopenharmony_ci   * @since 9
197961847f8eSopenharmony_ci   */
198061847f8eSopenharmony_ci  /**
198161847f8eSopenharmony_ci   * Provides the Mac type, which is used for Mac generation.
198261847f8eSopenharmony_ci   *
198361847f8eSopenharmony_ci   * @typedef Mac
198461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
198561847f8eSopenharmony_ci   * @crossplatform
198661847f8eSopenharmony_ci   * @since 11
198761847f8eSopenharmony_ci   */
198861847f8eSopenharmony_ci  /**
198961847f8eSopenharmony_ci   * Provides the Mac type, which is used for Mac generation.
199061847f8eSopenharmony_ci   *
199161847f8eSopenharmony_ci   * @typedef Mac
199261847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Mac
199361847f8eSopenharmony_ci   * @crossplatform
199461847f8eSopenharmony_ci   * @atomicservice
199561847f8eSopenharmony_ci   * @since 12
199661847f8eSopenharmony_ci   */
199761847f8eSopenharmony_ci  interface Mac {
199861847f8eSopenharmony_ci    /**
199961847f8eSopenharmony_ci     * Init hmac with given SymKey.
200061847f8eSopenharmony_ci     *
200161847f8eSopenharmony_ci     * @param { SymKey } key - indicates the SymKey.
200261847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of the init function.
200361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
200461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
200561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
200661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
200761847f8eSopenharmony_ci     * @since 9
200861847f8eSopenharmony_ci     */
200961847f8eSopenharmony_ci    /**
201061847f8eSopenharmony_ci     * Init hmac with given SymKey.
201161847f8eSopenharmony_ci     *
201261847f8eSopenharmony_ci     * @param { SymKey } key - indicates the SymKey.
201361847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of the init function.
201461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
201561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
201661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
201761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
201861847f8eSopenharmony_ci     * @crossplatform
201961847f8eSopenharmony_ci     * @since 11
202061847f8eSopenharmony_ci     */
202161847f8eSopenharmony_ci    /**
202261847f8eSopenharmony_ci     * Init hmac with given SymKey.
202361847f8eSopenharmony_ci     *
202461847f8eSopenharmony_ci     * @param { SymKey } key - indicates the SymKey.
202561847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of the init function.
202661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
202761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
202861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
202961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Mac
203061847f8eSopenharmony_ci     * @crossplatform
203161847f8eSopenharmony_ci     * @atomicservice
203261847f8eSopenharmony_ci     * @since 12
203361847f8eSopenharmony_ci     */
203461847f8eSopenharmony_ci    init(key: SymKey, callback: AsyncCallback<void>): void;
203561847f8eSopenharmony_ci
203661847f8eSopenharmony_ci    /**
203761847f8eSopenharmony_ci     * Init hmac with given SymKey.
203861847f8eSopenharmony_ci     *
203961847f8eSopenharmony_ci     * @param { SymKey } key - indicates the SymKey.
204061847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
204161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
204261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
204361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
204461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
204561847f8eSopenharmony_ci     * @since 9
204661847f8eSopenharmony_ci     */
204761847f8eSopenharmony_ci    /**
204861847f8eSopenharmony_ci     * Init hmac with given SymKey.
204961847f8eSopenharmony_ci     *
205061847f8eSopenharmony_ci     * @param { SymKey } key - indicates the SymKey.
205161847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
205261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
205361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
205461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
205561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
205661847f8eSopenharmony_ci     * @crossplatform
205761847f8eSopenharmony_ci     * @since 11
205861847f8eSopenharmony_ci     */
205961847f8eSopenharmony_ci    /**
206061847f8eSopenharmony_ci     * Init hmac with given SymKey.
206161847f8eSopenharmony_ci     *
206261847f8eSopenharmony_ci     * @param { SymKey } key - indicates the SymKey.
206361847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
206461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
206561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
206661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
206761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Mac
206861847f8eSopenharmony_ci     * @crossplatform
206961847f8eSopenharmony_ci     * @atomicservice
207061847f8eSopenharmony_ci     * @since 12
207161847f8eSopenharmony_ci     */
207261847f8eSopenharmony_ci    init(key: SymKey): Promise<void>;
207361847f8eSopenharmony_ci
207461847f8eSopenharmony_ci    /**
207561847f8eSopenharmony_ci     * Init hmac with given SymKey.
207661847f8eSopenharmony_ci     *
207761847f8eSopenharmony_ci     * @param { SymKey } key - indicates the SymKey.
207861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
207961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
208061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
208161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Mac
208261847f8eSopenharmony_ci     * @crossplatform
208361847f8eSopenharmony_ci     * @atomicservice
208461847f8eSopenharmony_ci     * @since 12
208561847f8eSopenharmony_ci     */
208661847f8eSopenharmony_ci    initSync(key: SymKey): void;
208761847f8eSopenharmony_ci
208861847f8eSopenharmony_ci    /**
208961847f8eSopenharmony_ci     * Update hmac with DataBlob.
209061847f8eSopenharmony_ci     *
209161847f8eSopenharmony_ci     * @param { DataBlob } input - indicates the DataBlob.
209261847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of the update function.
209361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
209461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
209561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
209661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
209761847f8eSopenharmony_ci     * @since 9
209861847f8eSopenharmony_ci     */
209961847f8eSopenharmony_ci    /**
210061847f8eSopenharmony_ci     * Update hmac with DataBlob.
210161847f8eSopenharmony_ci     *
210261847f8eSopenharmony_ci     * @param { DataBlob } input - indicates the DataBlob.
210361847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of the update function.
210461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
210561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
210661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
210761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
210861847f8eSopenharmony_ci     * @crossplatform
210961847f8eSopenharmony_ci     * @since 11
211061847f8eSopenharmony_ci     */
211161847f8eSopenharmony_ci    /**
211261847f8eSopenharmony_ci     * Update hmac with DataBlob.
211361847f8eSopenharmony_ci     *
211461847f8eSopenharmony_ci     * @param { DataBlob } input - indicates the DataBlob.
211561847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of the update function.
211661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
211761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
211861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
211961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Mac
212061847f8eSopenharmony_ci     * @crossplatform
212161847f8eSopenharmony_ci     * @atomicservice
212261847f8eSopenharmony_ci     * @since 12
212361847f8eSopenharmony_ci     */
212461847f8eSopenharmony_ci    update(input: DataBlob, callback: AsyncCallback<void>): void;
212561847f8eSopenharmony_ci
212661847f8eSopenharmony_ci    /**
212761847f8eSopenharmony_ci     * Update hmac with DataBlob.
212861847f8eSopenharmony_ci     *
212961847f8eSopenharmony_ci     * @param { DataBlob } input - indicates the DataBlob.
213061847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
213161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
213261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
213361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
213461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
213561847f8eSopenharmony_ci     * @since 9
213661847f8eSopenharmony_ci     */
213761847f8eSopenharmony_ci    /**
213861847f8eSopenharmony_ci     * Update hmac with DataBlob.
213961847f8eSopenharmony_ci     *
214061847f8eSopenharmony_ci     * @param { DataBlob } input - indicates the DataBlob.
214161847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
214261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
214361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
214461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
214561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
214661847f8eSopenharmony_ci     * @crossplatform
214761847f8eSopenharmony_ci     * @since 11
214861847f8eSopenharmony_ci     */
214961847f8eSopenharmony_ci    /**
215061847f8eSopenharmony_ci     * Update hmac with DataBlob.
215161847f8eSopenharmony_ci     *
215261847f8eSopenharmony_ci     * @param { DataBlob } input - indicates the DataBlob.
215361847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
215461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
215561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
215661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
215761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Mac
215861847f8eSopenharmony_ci     * @crossplatform
215961847f8eSopenharmony_ci     * @atomicservice
216061847f8eSopenharmony_ci     * @since 12
216161847f8eSopenharmony_ci     */
216261847f8eSopenharmony_ci    update(input: DataBlob): Promise<void>;
216361847f8eSopenharmony_ci
216461847f8eSopenharmony_ci    /**
216561847f8eSopenharmony_ci     * Update hmac with DataBlob.
216661847f8eSopenharmony_ci     *
216761847f8eSopenharmony_ci     * @param { DataBlob } input - indicates the DataBlob.
216861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
216961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
217061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
217161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Mac
217261847f8eSopenharmony_ci     * @crossplatform
217361847f8eSopenharmony_ci     * @atomicservice
217461847f8eSopenharmony_ci     * @since 12
217561847f8eSopenharmony_ci     */
217661847f8eSopenharmony_ci    updateSync(input: DataBlob): void;
217761847f8eSopenharmony_ci
217861847f8eSopenharmony_ci    /**
217961847f8eSopenharmony_ci     * Output the result of hmac calculation.
218061847f8eSopenharmony_ci     *
218161847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback of the doFinal function.
218261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
218361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
218461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
218561847f8eSopenharmony_ci     * @since 9
218661847f8eSopenharmony_ci     */
218761847f8eSopenharmony_ci    /**
218861847f8eSopenharmony_ci     * Output the result of hmac calculation.
218961847f8eSopenharmony_ci     *
219061847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback of the doFinal function.
219161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
219261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
219361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
219461847f8eSopenharmony_ci     * @crossplatform
219561847f8eSopenharmony_ci     * @since 11
219661847f8eSopenharmony_ci     */
219761847f8eSopenharmony_ci    /**
219861847f8eSopenharmony_ci     * Output the result of hmac calculation.
219961847f8eSopenharmony_ci     *
220061847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback of the doFinal function.
220161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
220261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
220361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Mac
220461847f8eSopenharmony_ci     * @crossplatform
220561847f8eSopenharmony_ci     * @atomicservice
220661847f8eSopenharmony_ci     * @since 12
220761847f8eSopenharmony_ci     */
220861847f8eSopenharmony_ci    doFinal(callback: AsyncCallback<DataBlob>): void;
220961847f8eSopenharmony_ci
221061847f8eSopenharmony_ci    /**
221161847f8eSopenharmony_ci     * Output the result of hmac calculation.
221261847f8eSopenharmony_ci     *
221361847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise returned by the function.
221461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
221561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
221661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
221761847f8eSopenharmony_ci     * @since 9
221861847f8eSopenharmony_ci     */
221961847f8eSopenharmony_ci    /**
222061847f8eSopenharmony_ci     * Output the result of hmac calculation.
222161847f8eSopenharmony_ci     *
222261847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise returned by the function.
222361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
222461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
222561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
222661847f8eSopenharmony_ci     * @crossplatform
222761847f8eSopenharmony_ci     * @since 11
222861847f8eSopenharmony_ci     */
222961847f8eSopenharmony_ci    /**
223061847f8eSopenharmony_ci     * Output the result of hmac calculation.
223161847f8eSopenharmony_ci     *
223261847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise returned by the function.
223361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
223461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
223561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Mac
223661847f8eSopenharmony_ci     * @crossplatform
223761847f8eSopenharmony_ci     * @atomicservice
223861847f8eSopenharmony_ci     * @since 12
223961847f8eSopenharmony_ci     */
224061847f8eSopenharmony_ci    doFinal(): Promise<DataBlob>;
224161847f8eSopenharmony_ci
224261847f8eSopenharmony_ci    /**
224361847f8eSopenharmony_ci     * Output the result of hmac calculation.
224461847f8eSopenharmony_ci     *
224561847f8eSopenharmony_ci     * @returns { DataBlob } the sync returned by the function.
224661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
224761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
224861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
224961847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
225061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
225161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Mac
225261847f8eSopenharmony_ci     * @crossplatform
225361847f8eSopenharmony_ci     * @atomicservice
225461847f8eSopenharmony_ci     * @since 12
225561847f8eSopenharmony_ci     */
225661847f8eSopenharmony_ci    doFinalSync(): DataBlob;
225761847f8eSopenharmony_ci
225861847f8eSopenharmony_ci    /**
225961847f8eSopenharmony_ci     * Output the length of hmac result.
226061847f8eSopenharmony_ci     *
226161847f8eSopenharmony_ci     * @returns { number } returns the length of the hmac result.
226261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
226361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
226461847f8eSopenharmony_ci     * @since 9
226561847f8eSopenharmony_ci     */
226661847f8eSopenharmony_ci    /**
226761847f8eSopenharmony_ci     * Output the length of hmac result.
226861847f8eSopenharmony_ci     *
226961847f8eSopenharmony_ci     * @returns { number } returns the length of the hmac result.
227061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
227161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
227261847f8eSopenharmony_ci     * @crossplatform
227361847f8eSopenharmony_ci     * @since 11
227461847f8eSopenharmony_ci     */
227561847f8eSopenharmony_ci    /**
227661847f8eSopenharmony_ci     * Output the length of hmac result.
227761847f8eSopenharmony_ci     *
227861847f8eSopenharmony_ci     * @returns { number } returns the length of the hmac result.
227961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
228061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Mac
228161847f8eSopenharmony_ci     * @crossplatform
228261847f8eSopenharmony_ci     * @atomicservice
228361847f8eSopenharmony_ci     * @since 12
228461847f8eSopenharmony_ci     */
228561847f8eSopenharmony_ci    getMacLength(): number;
228661847f8eSopenharmony_ci
228761847f8eSopenharmony_ci    /**
228861847f8eSopenharmony_ci     * Indicates the algorithm name.
228961847f8eSopenharmony_ci     *
229061847f8eSopenharmony_ci     * @type { string }
229161847f8eSopenharmony_ci     * @readonly
229261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
229361847f8eSopenharmony_ci     * @since 9
229461847f8eSopenharmony_ci     */
229561847f8eSopenharmony_ci    /**
229661847f8eSopenharmony_ci     * Indicates the algorithm name.
229761847f8eSopenharmony_ci     *
229861847f8eSopenharmony_ci     * @type { string }
229961847f8eSopenharmony_ci     * @readonly
230061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
230161847f8eSopenharmony_ci     * @crossplatform
230261847f8eSopenharmony_ci     * @since 11
230361847f8eSopenharmony_ci     */
230461847f8eSopenharmony_ci    /**
230561847f8eSopenharmony_ci     * Indicates the algorithm name.
230661847f8eSopenharmony_ci     *
230761847f8eSopenharmony_ci     * @type { string }
230861847f8eSopenharmony_ci     * @readonly
230961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Mac
231061847f8eSopenharmony_ci     * @crossplatform
231161847f8eSopenharmony_ci     * @atomicservice
231261847f8eSopenharmony_ci     * @since 12
231361847f8eSopenharmony_ci     */
231461847f8eSopenharmony_ci    readonly algName: string;
231561847f8eSopenharmony_ci  }
231661847f8eSopenharmony_ci
231761847f8eSopenharmony_ci  /**
231861847f8eSopenharmony_ci   * Provides the mac create func.
231961847f8eSopenharmony_ci   *
232061847f8eSopenharmony_ci   * @param { string } algName - indicates the mac algorithm name.
232161847f8eSopenharmony_ci   * @returns { Mac } returns the created mac instance.
232261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
232361847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
232461847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
232561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
232661847f8eSopenharmony_ci   * @since 9
232761847f8eSopenharmony_ci   */
232861847f8eSopenharmony_ci  /**
232961847f8eSopenharmony_ci   * Provides the mac create func.
233061847f8eSopenharmony_ci   *
233161847f8eSopenharmony_ci   * @param { string } algName - indicates the mac algorithm name.
233261847f8eSopenharmony_ci   * @returns { Mac } returns the created mac instance.
233361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
233461847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
233561847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
233661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
233761847f8eSopenharmony_ci   * @crossplatform
233861847f8eSopenharmony_ci   * @since 11
233961847f8eSopenharmony_ci   */
234061847f8eSopenharmony_ci  /**
234161847f8eSopenharmony_ci   * Provides the mac create func.
234261847f8eSopenharmony_ci   *
234361847f8eSopenharmony_ci   * @param { string } algName - indicates the mac algorithm name.
234461847f8eSopenharmony_ci   * @returns { Mac } returns the created mac instance.
234561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
234661847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
234761847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
234861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Mac
234961847f8eSopenharmony_ci   * @crossplatform
235061847f8eSopenharmony_ci   * @atomicservice
235161847f8eSopenharmony_ci   * @since 12
235261847f8eSopenharmony_ci   */
235361847f8eSopenharmony_ci  function createMac(algName: string): Mac;
235461847f8eSopenharmony_ci
235561847f8eSopenharmony_ci  /**
235661847f8eSopenharmony_ci   * Provides the Md type, which is used for Md generation.
235761847f8eSopenharmony_ci   *
235861847f8eSopenharmony_ci   * @typedef Md
235961847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
236061847f8eSopenharmony_ci   * @since 9
236161847f8eSopenharmony_ci   */
236261847f8eSopenharmony_ci  /**
236361847f8eSopenharmony_ci   * Provides the Md type, which is used for Md generation.
236461847f8eSopenharmony_ci   *
236561847f8eSopenharmony_ci   * @typedef Md
236661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
236761847f8eSopenharmony_ci   * @crossplatform
236861847f8eSopenharmony_ci   * @since 11
236961847f8eSopenharmony_ci   */
237061847f8eSopenharmony_ci  /**
237161847f8eSopenharmony_ci   * Provides the Md type, which is used for Md generation.
237261847f8eSopenharmony_ci   *
237361847f8eSopenharmony_ci   * @typedef Md
237461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.MessageDigest
237561847f8eSopenharmony_ci   * @crossplatform
237661847f8eSopenharmony_ci   * @atomicservice
237761847f8eSopenharmony_ci   * @since 12
237861847f8eSopenharmony_ci   */
237961847f8eSopenharmony_ci  interface Md {
238061847f8eSopenharmony_ci    /**
238161847f8eSopenharmony_ci     * Update md with DataBlob.
238261847f8eSopenharmony_ci     *
238361847f8eSopenharmony_ci     * @param { DataBlob } input - indicates the DataBlob.
238461847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of the update function.
238561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
238661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
238761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
238861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
238961847f8eSopenharmony_ci     * @since 9
239061847f8eSopenharmony_ci     */
239161847f8eSopenharmony_ci    /**
239261847f8eSopenharmony_ci     * Update md with DataBlob.
239361847f8eSopenharmony_ci     *
239461847f8eSopenharmony_ci     * @param { DataBlob } input - indicates the DataBlob.
239561847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of the update function.
239661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
239761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
239861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
239961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
240061847f8eSopenharmony_ci     * @crossplatform
240161847f8eSopenharmony_ci     * @since 11
240261847f8eSopenharmony_ci     */
240361847f8eSopenharmony_ci    /**
240461847f8eSopenharmony_ci     * Update md with DataBlob.
240561847f8eSopenharmony_ci     *
240661847f8eSopenharmony_ci     * @param { DataBlob } input - indicates the DataBlob.
240761847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of the update function.
240861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
240961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
241061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
241161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.MessageDigest
241261847f8eSopenharmony_ci     * @crossplatform
241361847f8eSopenharmony_ci     * @atomicservice
241461847f8eSopenharmony_ci     * @since 12
241561847f8eSopenharmony_ci     */
241661847f8eSopenharmony_ci    update(input: DataBlob, callback: AsyncCallback<void>): void;
241761847f8eSopenharmony_ci
241861847f8eSopenharmony_ci    /**
241961847f8eSopenharmony_ci     * Update md with DataBlob.
242061847f8eSopenharmony_ci     *
242161847f8eSopenharmony_ci     * @param { DataBlob } input - indicates the DataBlob.
242261847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
242361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
242461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
242561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
242661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
242761847f8eSopenharmony_ci     * @since 9
242861847f8eSopenharmony_ci     */
242961847f8eSopenharmony_ci    /**
243061847f8eSopenharmony_ci     * Update md with DataBlob.
243161847f8eSopenharmony_ci     *
243261847f8eSopenharmony_ci     * @param { DataBlob } input - indicates the DataBlob.
243361847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
243461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
243561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
243661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
243761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
243861847f8eSopenharmony_ci     * @crossplatform
243961847f8eSopenharmony_ci     * @since 11
244061847f8eSopenharmony_ci     */
244161847f8eSopenharmony_ci    /**
244261847f8eSopenharmony_ci     * Update md with DataBlob.
244361847f8eSopenharmony_ci     *
244461847f8eSopenharmony_ci     * @param { DataBlob } input - indicates the DataBlob.
244561847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
244661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
244761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
244861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
244961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.MessageDigest
245061847f8eSopenharmony_ci     * @crossplatform
245161847f8eSopenharmony_ci     * @atomicservice
245261847f8eSopenharmony_ci     * @since 12
245361847f8eSopenharmony_ci     */
245461847f8eSopenharmony_ci    update(input: DataBlob): Promise<void>;
245561847f8eSopenharmony_ci
245661847f8eSopenharmony_ci    /**
245761847f8eSopenharmony_ci     * Update md with DataBlob.
245861847f8eSopenharmony_ci     *
245961847f8eSopenharmony_ci     * @param { DataBlob } input - indicates the DataBlob.
246061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
246161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
246261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
246361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.MessageDigest
246461847f8eSopenharmony_ci     * @crossplatform
246561847f8eSopenharmony_ci     * @atomicservice
246661847f8eSopenharmony_ci     * @since 12
246761847f8eSopenharmony_ci     */
246861847f8eSopenharmony_ci    updateSync(input: DataBlob): void;
246961847f8eSopenharmony_ci
247061847f8eSopenharmony_ci    /**
247161847f8eSopenharmony_ci     * Output the result of md calculation.
247261847f8eSopenharmony_ci     *
247361847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback of the digest function.
247461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
247561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
247661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
247761847f8eSopenharmony_ci     * @since 9
247861847f8eSopenharmony_ci     */
247961847f8eSopenharmony_ci    /**
248061847f8eSopenharmony_ci     * Output the result of md calculation.
248161847f8eSopenharmony_ci     *
248261847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback of the digest function.
248361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
248461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
248561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
248661847f8eSopenharmony_ci     * @crossplatform
248761847f8eSopenharmony_ci     * @since 11
248861847f8eSopenharmony_ci     */
248961847f8eSopenharmony_ci    /**
249061847f8eSopenharmony_ci     * Output the result of md calculation.
249161847f8eSopenharmony_ci     *
249261847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback of the digest function.
249361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
249461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
249561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.MessageDigest
249661847f8eSopenharmony_ci     * @crossplatform
249761847f8eSopenharmony_ci     * @atomicservice
249861847f8eSopenharmony_ci     * @since 12
249961847f8eSopenharmony_ci     */
250061847f8eSopenharmony_ci    digest(callback: AsyncCallback<DataBlob>): void;
250161847f8eSopenharmony_ci
250261847f8eSopenharmony_ci    /**
250361847f8eSopenharmony_ci     * Output the result of md calculation.
250461847f8eSopenharmony_ci     *
250561847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise returned by the function.
250661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
250761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
250861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
250961847f8eSopenharmony_ci     * @since 9
251061847f8eSopenharmony_ci     */
251161847f8eSopenharmony_ci    /**
251261847f8eSopenharmony_ci     * Output the result of md calculation.
251361847f8eSopenharmony_ci     *
251461847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise returned by the function.
251561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
251661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
251761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
251861847f8eSopenharmony_ci     * @crossplatform
251961847f8eSopenharmony_ci     * @since 11
252061847f8eSopenharmony_ci     */
252161847f8eSopenharmony_ci    /**
252261847f8eSopenharmony_ci     * Output the result of md calculation.
252361847f8eSopenharmony_ci     *
252461847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise returned by the function.
252561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
252661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
252761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.MessageDigest
252861847f8eSopenharmony_ci     * @crossplatform
252961847f8eSopenharmony_ci     * @atomicservice
253061847f8eSopenharmony_ci     * @since 12
253161847f8eSopenharmony_ci     */
253261847f8eSopenharmony_ci    digest(): Promise<DataBlob>;
253361847f8eSopenharmony_ci
253461847f8eSopenharmony_ci    /**
253561847f8eSopenharmony_ci     * Output the result of md calculation.
253661847f8eSopenharmony_ci     *
253761847f8eSopenharmony_ci     * @returns { DataBlob } the sync returned by the function.
253861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
253961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
254061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
254161847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
254261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
254361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.MessageDigest
254461847f8eSopenharmony_ci     * @crossplatform
254561847f8eSopenharmony_ci     * @atomicservice
254661847f8eSopenharmony_ci     * @since 12
254761847f8eSopenharmony_ci     */
254861847f8eSopenharmony_ci    digestSync(): DataBlob;
254961847f8eSopenharmony_ci
255061847f8eSopenharmony_ci    /**
255161847f8eSopenharmony_ci     * Output the length of md result.
255261847f8eSopenharmony_ci     *
255361847f8eSopenharmony_ci     * @returns { number } returns the length of the hmac result.
255461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
255561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
255661847f8eSopenharmony_ci     * @since 9
255761847f8eSopenharmony_ci     */
255861847f8eSopenharmony_ci    /**
255961847f8eSopenharmony_ci     * Output the length of md result.
256061847f8eSopenharmony_ci     *
256161847f8eSopenharmony_ci     * @returns { number } returns the length of the hmac result.
256261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
256361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
256461847f8eSopenharmony_ci     * @crossplatform
256561847f8eSopenharmony_ci     * @since 11
256661847f8eSopenharmony_ci     */
256761847f8eSopenharmony_ci    /**
256861847f8eSopenharmony_ci     * Output the length of md result.
256961847f8eSopenharmony_ci     *
257061847f8eSopenharmony_ci     * @returns { number } returns the length of the hmac result.
257161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
257261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.MessageDigest
257361847f8eSopenharmony_ci     * @crossplatform
257461847f8eSopenharmony_ci     * @atomicservice
257561847f8eSopenharmony_ci     * @since 12
257661847f8eSopenharmony_ci     */
257761847f8eSopenharmony_ci    getMdLength(): number;
257861847f8eSopenharmony_ci
257961847f8eSopenharmony_ci    /**
258061847f8eSopenharmony_ci     * Indicates the algorithm name.
258161847f8eSopenharmony_ci     *
258261847f8eSopenharmony_ci     * @type { string }
258361847f8eSopenharmony_ci     * @readonly
258461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
258561847f8eSopenharmony_ci     * @since 9
258661847f8eSopenharmony_ci     */
258761847f8eSopenharmony_ci    /**
258861847f8eSopenharmony_ci     * Indicates the algorithm name.
258961847f8eSopenharmony_ci     *
259061847f8eSopenharmony_ci     * @type { string }
259161847f8eSopenharmony_ci     * @readonly
259261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
259361847f8eSopenharmony_ci     * @crossplatform
259461847f8eSopenharmony_ci     * @since 11
259561847f8eSopenharmony_ci     */
259661847f8eSopenharmony_ci    /**
259761847f8eSopenharmony_ci     * Indicates the algorithm name.
259861847f8eSopenharmony_ci     *
259961847f8eSopenharmony_ci     * @type { string }
260061847f8eSopenharmony_ci     * @readonly
260161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.MessageDigest
260261847f8eSopenharmony_ci     * @crossplatform
260361847f8eSopenharmony_ci     * @atomicservice
260461847f8eSopenharmony_ci     * @since 12
260561847f8eSopenharmony_ci     */
260661847f8eSopenharmony_ci    readonly algName: string;
260761847f8eSopenharmony_ci  }
260861847f8eSopenharmony_ci
260961847f8eSopenharmony_ci  /**
261061847f8eSopenharmony_ci   * Provides the md create func.
261161847f8eSopenharmony_ci   *
261261847f8eSopenharmony_ci   * @param { string } algName - indicates the md algorithm name.
261361847f8eSopenharmony_ci   * @returns { Md } returns the created md instance.
261461847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
261561847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
261661847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
261761847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
261861847f8eSopenharmony_ci   * @since 9
261961847f8eSopenharmony_ci   */
262061847f8eSopenharmony_ci  /**
262161847f8eSopenharmony_ci   * Provides the md create func.
262261847f8eSopenharmony_ci   *
262361847f8eSopenharmony_ci   * @param { string } algName - indicates the md algorithm name.
262461847f8eSopenharmony_ci   * @returns { Md } returns the created md instance.
262561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
262661847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
262761847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
262861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
262961847f8eSopenharmony_ci   * @crossplatform
263061847f8eSopenharmony_ci   * @since 11
263161847f8eSopenharmony_ci   */
263261847f8eSopenharmony_ci  /**
263361847f8eSopenharmony_ci   * Provides the md create func.
263461847f8eSopenharmony_ci   *
263561847f8eSopenharmony_ci   * @param { string } algName - indicates the md algorithm name.
263661847f8eSopenharmony_ci   * @returns { Md } returns the created md instance.
263761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
263861847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
263961847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
264061847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.MessageDigest
264161847f8eSopenharmony_ci   * @crossplatform
264261847f8eSopenharmony_ci   * @atomicservice
264361847f8eSopenharmony_ci   * @since 12
264461847f8eSopenharmony_ci   */
264561847f8eSopenharmony_ci  function createMd(algName: string): Md;
264661847f8eSopenharmony_ci
264761847f8eSopenharmony_ci  /**
264861847f8eSopenharmony_ci   * Enum for encryption specified parameters.
264961847f8eSopenharmony_ci   *
265061847f8eSopenharmony_ci   * @enum { number }
265161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
265261847f8eSopenharmony_ci   * @since 10
265361847f8eSopenharmony_ci   */
265461847f8eSopenharmony_ci  /**
265561847f8eSopenharmony_ci   * Enum for encryption specified parameters.
265661847f8eSopenharmony_ci   *
265761847f8eSopenharmony_ci   * @enum { number }
265861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
265961847f8eSopenharmony_ci   * @crossplatform
266061847f8eSopenharmony_ci   * @since 11
266161847f8eSopenharmony_ci   */
266261847f8eSopenharmony_ci  /**
266361847f8eSopenharmony_ci   * Enum for encryption specified parameters.
266461847f8eSopenharmony_ci   *
266561847f8eSopenharmony_ci   * @enum { number }
266661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Cipher
266761847f8eSopenharmony_ci   * @crossplatform
266861847f8eSopenharmony_ci   * @atomicservice
266961847f8eSopenharmony_ci   * @since 12
267061847f8eSopenharmony_ci   */
267161847f8eSopenharmony_ci  enum CipherSpecItem {
267261847f8eSopenharmony_ci    /**
267361847f8eSopenharmony_ci     * Indicates the algorithm name of the message digest function. It is used during RSA encryption.
267461847f8eSopenharmony_ci     *
267561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
267661847f8eSopenharmony_ci     * @since 10
267761847f8eSopenharmony_ci     */
267861847f8eSopenharmony_ci    /**
267961847f8eSopenharmony_ci     * Indicates the algorithm name of the message digest function. It is used during RSA encryption.
268061847f8eSopenharmony_ci     *
268161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
268261847f8eSopenharmony_ci     * @crossplatform
268361847f8eSopenharmony_ci     * @since 11
268461847f8eSopenharmony_ci     */
268561847f8eSopenharmony_ci    /**
268661847f8eSopenharmony_ci     * Indicates the algorithm name of the message digest function. It is used during RSA encryption.
268761847f8eSopenharmony_ci     *
268861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
268961847f8eSopenharmony_ci     * @crossplatform
269061847f8eSopenharmony_ci     * @atomicservice
269161847f8eSopenharmony_ci     * @since 12
269261847f8eSopenharmony_ci     */
269361847f8eSopenharmony_ci    OAEP_MD_NAME_STR = 100,
269461847f8eSopenharmony_ci
269561847f8eSopenharmony_ci    /**
269661847f8eSopenharmony_ci     * Indicates the algorithm name for the mask generation function. It is used during RSA encryption.
269761847f8eSopenharmony_ci     *
269861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
269961847f8eSopenharmony_ci     * @since 10
270061847f8eSopenharmony_ci     */
270161847f8eSopenharmony_ci    /**
270261847f8eSopenharmony_ci     * Indicates the algorithm name for the mask generation function. It is used during RSA encryption.
270361847f8eSopenharmony_ci     *
270461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
270561847f8eSopenharmony_ci     * @crossplatform
270661847f8eSopenharmony_ci     * @since 11
270761847f8eSopenharmony_ci     */
270861847f8eSopenharmony_ci    /**
270961847f8eSopenharmony_ci     * Indicates the algorithm name for the mask generation function. It is used during RSA encryption.
271061847f8eSopenharmony_ci     *
271161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
271261847f8eSopenharmony_ci     * @crossplatform
271361847f8eSopenharmony_ci     * @atomicservice
271461847f8eSopenharmony_ci     * @since 12
271561847f8eSopenharmony_ci     */
271661847f8eSopenharmony_ci    OAEP_MGF_NAME_STR = 101,
271761847f8eSopenharmony_ci
271861847f8eSopenharmony_ci    /**
271961847f8eSopenharmony_ci     * Indicates the message digest parameter for the MGF1 mask generation function. It is used during RSA encryption.
272061847f8eSopenharmony_ci     *
272161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
272261847f8eSopenharmony_ci     * @since 10
272361847f8eSopenharmony_ci     */
272461847f8eSopenharmony_ci    /**
272561847f8eSopenharmony_ci     * Indicates the message digest parameter for the MGF1 mask generation function. It is used during RSA encryption.
272661847f8eSopenharmony_ci     *
272761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
272861847f8eSopenharmony_ci     * @crossplatform
272961847f8eSopenharmony_ci     * @since 11
273061847f8eSopenharmony_ci     */
273161847f8eSopenharmony_ci    /**
273261847f8eSopenharmony_ci     * Indicates the message digest parameter for the MGF1 mask generation function. It is used during RSA encryption.
273361847f8eSopenharmony_ci     *
273461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
273561847f8eSopenharmony_ci     * @crossplatform
273661847f8eSopenharmony_ci     * @atomicservice
273761847f8eSopenharmony_ci     * @since 12
273861847f8eSopenharmony_ci     */
273961847f8eSopenharmony_ci    OAEP_MGF1_MD_STR = 102,
274061847f8eSopenharmony_ci
274161847f8eSopenharmony_ci    /**
274261847f8eSopenharmony_ci     * Indicates the source of the encoding input P. It is used during RSA encryption.
274361847f8eSopenharmony_ci     *
274461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
274561847f8eSopenharmony_ci     * @since 10
274661847f8eSopenharmony_ci     */
274761847f8eSopenharmony_ci    /**
274861847f8eSopenharmony_ci     * Indicates the source of the encoding input P. It is used during RSA encryption.
274961847f8eSopenharmony_ci     *
275061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
275161847f8eSopenharmony_ci     * @crossplatform
275261847f8eSopenharmony_ci     * @since 11
275361847f8eSopenharmony_ci     */
275461847f8eSopenharmony_ci    /**
275561847f8eSopenharmony_ci     * Indicates the source of the encoding input P. It is used during RSA encryption.
275661847f8eSopenharmony_ci     *
275761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
275861847f8eSopenharmony_ci     * @crossplatform
275961847f8eSopenharmony_ci     * @atomicservice
276061847f8eSopenharmony_ci     * @since 12
276161847f8eSopenharmony_ci     */
276261847f8eSopenharmony_ci    OAEP_MGF1_PSRC_UINT8ARR = 103,
276361847f8eSopenharmony_ci
276461847f8eSopenharmony_ci    /**
276561847f8eSopenharmony_ci     * Indicates the hash algorithm name of SM2 cipher process.
276661847f8eSopenharmony_ci     *
276761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
276861847f8eSopenharmony_ci     * @crossplatform
276961847f8eSopenharmony_ci     * @since 11
277061847f8eSopenharmony_ci     */
277161847f8eSopenharmony_ci    /**
277261847f8eSopenharmony_ci     * Indicates the hash algorithm name of SM2 cipher process.
277361847f8eSopenharmony_ci     *
277461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
277561847f8eSopenharmony_ci     * @crossplatform
277661847f8eSopenharmony_ci     * @atomicservice
277761847f8eSopenharmony_ci     * @since 12
277861847f8eSopenharmony_ci     */
277961847f8eSopenharmony_ci    SM2_MD_NAME_STR = 104
278061847f8eSopenharmony_ci  }
278161847f8eSopenharmony_ci
278261847f8eSopenharmony_ci  /**
278361847f8eSopenharmony_ci   * Enum for signature specified parameters, also used for verification.
278461847f8eSopenharmony_ci   *
278561847f8eSopenharmony_ci   * @enum { number }
278661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
278761847f8eSopenharmony_ci   * @since 10
278861847f8eSopenharmony_ci   */
278961847f8eSopenharmony_ci  /**
279061847f8eSopenharmony_ci   * Enum for signature specified parameters, also used for verification.
279161847f8eSopenharmony_ci   *
279261847f8eSopenharmony_ci   * @enum { number }
279361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
279461847f8eSopenharmony_ci   * @crossplatform
279561847f8eSopenharmony_ci   * @since 11
279661847f8eSopenharmony_ci   */
279761847f8eSopenharmony_ci  /**
279861847f8eSopenharmony_ci   * Enum for signature specified parameters, also used for verification.
279961847f8eSopenharmony_ci   *
280061847f8eSopenharmony_ci   * @enum { number }
280161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Signature
280261847f8eSopenharmony_ci   * @crossplatform
280361847f8eSopenharmony_ci   * @atomicservice
280461847f8eSopenharmony_ci   * @since 12
280561847f8eSopenharmony_ci   */
280661847f8eSopenharmony_ci  enum SignSpecItem {
280761847f8eSopenharmony_ci    /**
280861847f8eSopenharmony_ci     * Indicates the algorithm name of the message digest function. It is used in RSA signing and verifying process.
280961847f8eSopenharmony_ci     *
281061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
281161847f8eSopenharmony_ci     * @since 10
281261847f8eSopenharmony_ci     */
281361847f8eSopenharmony_ci    /**
281461847f8eSopenharmony_ci     * Indicates the algorithm name of the message digest function. It is used in RSA signing and verifying process.
281561847f8eSopenharmony_ci     *
281661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
281761847f8eSopenharmony_ci     * @crossplatform
281861847f8eSopenharmony_ci     * @since 11
281961847f8eSopenharmony_ci     */
282061847f8eSopenharmony_ci    /**
282161847f8eSopenharmony_ci     * Indicates the algorithm name of the message digest function. It is used in RSA signing and verifying process.
282261847f8eSopenharmony_ci     *
282361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
282461847f8eSopenharmony_ci     * @crossplatform
282561847f8eSopenharmony_ci     * @atomicservice
282661847f8eSopenharmony_ci     * @since 12
282761847f8eSopenharmony_ci     */
282861847f8eSopenharmony_ci    PSS_MD_NAME_STR = 100,
282961847f8eSopenharmony_ci
283061847f8eSopenharmony_ci    /**
283161847f8eSopenharmony_ci     * Indicates the algorithm name of the mask generation function. It is used in RSA signing and verifying process.
283261847f8eSopenharmony_ci     *
283361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
283461847f8eSopenharmony_ci     * @since 10
283561847f8eSopenharmony_ci     */
283661847f8eSopenharmony_ci    /**
283761847f8eSopenharmony_ci     * Indicates the algorithm name of the mask generation function. It is used in RSA signing and verifying process.
283861847f8eSopenharmony_ci     *
283961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
284061847f8eSopenharmony_ci     * @crossplatform
284161847f8eSopenharmony_ci     * @since 11
284261847f8eSopenharmony_ci     */
284361847f8eSopenharmony_ci    /**
284461847f8eSopenharmony_ci     * Indicates the algorithm name of the mask generation function. It is used in RSA signing and verifying process.
284561847f8eSopenharmony_ci     *
284661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
284761847f8eSopenharmony_ci     * @crossplatform
284861847f8eSopenharmony_ci     * @atomicservice
284961847f8eSopenharmony_ci     * @since 12
285061847f8eSopenharmony_ci     */
285161847f8eSopenharmony_ci    PSS_MGF_NAME_STR = 101,
285261847f8eSopenharmony_ci
285361847f8eSopenharmony_ci    /**
285461847f8eSopenharmony_ci     * Indicates the message digest parameter for the MGF1 mask generation function.
285561847f8eSopenharmony_ci     * It is used in RSA signing and verifying process.
285661847f8eSopenharmony_ci     *
285761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
285861847f8eSopenharmony_ci     * @since 10
285961847f8eSopenharmony_ci     */
286061847f8eSopenharmony_ci    /**
286161847f8eSopenharmony_ci     * Indicates the message digest parameter for the MGF1 mask generation function.
286261847f8eSopenharmony_ci     * It is used in RSA signing and verifying process.
286361847f8eSopenharmony_ci     *
286461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
286561847f8eSopenharmony_ci     * @crossplatform
286661847f8eSopenharmony_ci     * @since 11
286761847f8eSopenharmony_ci     */
286861847f8eSopenharmony_ci    /**
286961847f8eSopenharmony_ci     * Indicates the message digest parameter for the MGF1 mask generation function.
287061847f8eSopenharmony_ci     * It is used in RSA signing and verifying process.
287161847f8eSopenharmony_ci     *
287261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
287361847f8eSopenharmony_ci     * @crossplatform
287461847f8eSopenharmony_ci     * @atomicservice
287561847f8eSopenharmony_ci     * @since 12
287661847f8eSopenharmony_ci     */
287761847f8eSopenharmony_ci    PSS_MGF1_MD_STR = 102,
287861847f8eSopenharmony_ci
287961847f8eSopenharmony_ci    /**
288061847f8eSopenharmony_ci     * Indicates the salt length in bits. It is used in RSA signing and verifying process.
288161847f8eSopenharmony_ci     *
288261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
288361847f8eSopenharmony_ci     * @since 10
288461847f8eSopenharmony_ci     */
288561847f8eSopenharmony_ci    /**
288661847f8eSopenharmony_ci     * Indicates the salt length in bits. It is used in RSA signing and verifying process.
288761847f8eSopenharmony_ci     *
288861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
288961847f8eSopenharmony_ci     * @crossplatform
289061847f8eSopenharmony_ci     * @since 11
289161847f8eSopenharmony_ci     */
289261847f8eSopenharmony_ci    /**
289361847f8eSopenharmony_ci     * Indicates the salt length in bits. It is used in RSA signing and verifying process.
289461847f8eSopenharmony_ci     *
289561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
289661847f8eSopenharmony_ci     * @crossplatform
289761847f8eSopenharmony_ci     * @atomicservice
289861847f8eSopenharmony_ci     * @since 12
289961847f8eSopenharmony_ci     */
290061847f8eSopenharmony_ci    PSS_SALT_LEN_NUM = 103,
290161847f8eSopenharmony_ci
290261847f8eSopenharmony_ci    /**
290361847f8eSopenharmony_ci     * Indicates the value for the trailer field. It is used in RSA signing and verifying process.
290461847f8eSopenharmony_ci     *
290561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
290661847f8eSopenharmony_ci     * @since 10
290761847f8eSopenharmony_ci     */
290861847f8eSopenharmony_ci    /**
290961847f8eSopenharmony_ci     * Indicates the value for the trailer field. It is used in RSA signing and verifying process.
291061847f8eSopenharmony_ci     *
291161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
291261847f8eSopenharmony_ci     * @crossplatform
291361847f8eSopenharmony_ci     * @since 11
291461847f8eSopenharmony_ci     */
291561847f8eSopenharmony_ci    /**
291661847f8eSopenharmony_ci     * Indicates the value for the trailer field. It is used in RSA signing and verifying process.
291761847f8eSopenharmony_ci     *
291861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
291961847f8eSopenharmony_ci     * @crossplatform
292061847f8eSopenharmony_ci     * @atomicservice
292161847f8eSopenharmony_ci     * @since 12
292261847f8eSopenharmony_ci     */
292361847f8eSopenharmony_ci    PSS_TRAILER_FIELD_NUM = 104,
292461847f8eSopenharmony_ci
292561847f8eSopenharmony_ci    /**
292661847f8eSopenharmony_ci     * Indicates the value for user id. It is used in SM2 signing and verifying process.
292761847f8eSopenharmony_ci     *
292861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
292961847f8eSopenharmony_ci     * @crossplatform
293061847f8eSopenharmony_ci     * @since 11
293161847f8eSopenharmony_ci     */
293261847f8eSopenharmony_ci    /**
293361847f8eSopenharmony_ci     * Indicates the value for user id. It is used in SM2 signing and verifying process.
293461847f8eSopenharmony_ci     *
293561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
293661847f8eSopenharmony_ci     * @crossplatform
293761847f8eSopenharmony_ci     * @atomicservice
293861847f8eSopenharmony_ci     * @since 12
293961847f8eSopenharmony_ci     */
294061847f8eSopenharmony_ci    SM2_USER_ID_UINT8ARR = 105
294161847f8eSopenharmony_ci  }
294261847f8eSopenharmony_ci
294361847f8eSopenharmony_ci  /**
294461847f8eSopenharmony_ci   * Provides the Cipher type, which is used for encryption and decryption operations.
294561847f8eSopenharmony_ci   *
294661847f8eSopenharmony_ci   * @typedef Cipher
294761847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
294861847f8eSopenharmony_ci   * @since 9
294961847f8eSopenharmony_ci   */
295061847f8eSopenharmony_ci  /**
295161847f8eSopenharmony_ci   * Provides the Cipher type, which is used for encryption and decryption operations.
295261847f8eSopenharmony_ci   *
295361847f8eSopenharmony_ci   * @typedef Cipher
295461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
295561847f8eSopenharmony_ci   * @crossplatform
295661847f8eSopenharmony_ci   * @since 11
295761847f8eSopenharmony_ci   */
295861847f8eSopenharmony_ci  /**
295961847f8eSopenharmony_ci   * Provides the Cipher type, which is used for encryption and decryption operations.
296061847f8eSopenharmony_ci   *
296161847f8eSopenharmony_ci   * @typedef Cipher
296261847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Cipher
296361847f8eSopenharmony_ci   * @crossplatform
296461847f8eSopenharmony_ci   * @atomicservice
296561847f8eSopenharmony_ci   * @since 12
296661847f8eSopenharmony_ci   */
296761847f8eSopenharmony_ci  interface Cipher {
296861847f8eSopenharmony_ci    /**
296961847f8eSopenharmony_ci     * Init the crypto operation with the given crypto mode, key and parameters.
297061847f8eSopenharmony_ci     *
297161847f8eSopenharmony_ci     * @param { CryptoMode } opMode - indicates the crypto mode is encryption or decryption.
297261847f8eSopenharmony_ci     * @param { Key } key - indicates the symmetric key or the asymmetric key.
297361847f8eSopenharmony_ci     * @param { ParamsSpec } params - indicates the algorithm parameters such as IV.
297461847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of the init function.
297561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
297661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
297761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
297861847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
297961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
298061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
298161847f8eSopenharmony_ci     * @since 9
298261847f8eSopenharmony_ci     */
298361847f8eSopenharmony_ci    /**
298461847f8eSopenharmony_ci     * Init the crypto operation with the given crypto mode, key and parameters.
298561847f8eSopenharmony_ci     *
298661847f8eSopenharmony_ci     * @param { CryptoMode } opMode - indicates the crypto mode is encryption or decryption.
298761847f8eSopenharmony_ci     * @param { Key } key - indicates the symmetric key or the asymmetric key.
298861847f8eSopenharmony_ci     * @param { ParamsSpec } params - indicates the algorithm parameters such as IV.
298961847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of the init function.
299061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
299161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
299261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
299361847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
299461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
299561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
299661847f8eSopenharmony_ci     * @crossplatform
299761847f8eSopenharmony_ci     * @since 11
299861847f8eSopenharmony_ci     */
299961847f8eSopenharmony_ci    /**
300061847f8eSopenharmony_ci     * Init the crypto operation with the given crypto mode, key and parameters.
300161847f8eSopenharmony_ci     *
300261847f8eSopenharmony_ci     * @param { CryptoMode } opMode - indicates the crypto mode is encryption or decryption.
300361847f8eSopenharmony_ci     * @param { Key } key - indicates the symmetric key or the asymmetric key.
300461847f8eSopenharmony_ci     * @param { ParamsSpec } params - indicates the algorithm parameters such as IV.
300561847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of the init function.
300661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
300761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
300861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
300961847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
301061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
301161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
301261847f8eSopenharmony_ci     * @crossplatform
301361847f8eSopenharmony_ci     * @atomicservice
301461847f8eSopenharmony_ci     * @since 12
301561847f8eSopenharmony_ci     */
301661847f8eSopenharmony_ci    init(opMode: CryptoMode, key: Key, params: ParamsSpec, callback: AsyncCallback<void>): void;
301761847f8eSopenharmony_ci
301861847f8eSopenharmony_ci    /**
301961847f8eSopenharmony_ci     * Init the crypto operation with the given crypto mode, key and parameters.
302061847f8eSopenharmony_ci     *
302161847f8eSopenharmony_ci     * @param { CryptoMode } opMode - indicates the crypto mode is encryption or decryption.
302261847f8eSopenharmony_ci     * @param { Key } key - indicates the symmetric key or the asymmetric key.
302361847f8eSopenharmony_ci     * @param { ParamsSpec | null } params - indicates the algorithm parameters such as IV.
302461847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of the init function.
302561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
302661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
302761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
302861847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
302961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
303061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
303161847f8eSopenharmony_ci     * @since 10
303261847f8eSopenharmony_ci     */
303361847f8eSopenharmony_ci    /**
303461847f8eSopenharmony_ci     * Init the crypto operation with the given crypto mode, key and parameters.
303561847f8eSopenharmony_ci     *
303661847f8eSopenharmony_ci     * @param { CryptoMode } opMode - indicates the crypto mode is encryption or decryption.
303761847f8eSopenharmony_ci     * @param { Key } key - indicates the symmetric key or the asymmetric key.
303861847f8eSopenharmony_ci     * @param { ParamsSpec | null } params - indicates the algorithm parameters such as IV.
303961847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of the init function.
304061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
304161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
304261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
304361847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
304461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
304561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
304661847f8eSopenharmony_ci     * @crossplatform
304761847f8eSopenharmony_ci     * @since 11
304861847f8eSopenharmony_ci     */
304961847f8eSopenharmony_ci    /**
305061847f8eSopenharmony_ci     * Init the crypto operation with the given crypto mode, key and parameters.
305161847f8eSopenharmony_ci     *
305261847f8eSopenharmony_ci     * @param { CryptoMode } opMode - indicates the crypto mode is encryption or decryption.
305361847f8eSopenharmony_ci     * @param { Key } key - indicates the symmetric key or the asymmetric key.
305461847f8eSopenharmony_ci     * @param { ParamsSpec | null } params - indicates the algorithm parameters such as IV.
305561847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of the init function.
305661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
305761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
305861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
305961847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
306061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
306161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
306261847f8eSopenharmony_ci     * @crossplatform
306361847f8eSopenharmony_ci     * @atomicservice
306461847f8eSopenharmony_ci     * @since 12
306561847f8eSopenharmony_ci     */
306661847f8eSopenharmony_ci    init(opMode: CryptoMode, key: Key, params: ParamsSpec | null, callback: AsyncCallback<void>): void;
306761847f8eSopenharmony_ci
306861847f8eSopenharmony_ci    /**
306961847f8eSopenharmony_ci     * Init the crypto operation with the given crypto mode, key and parameters.
307061847f8eSopenharmony_ci     *
307161847f8eSopenharmony_ci     * @param { CryptoMode } opMode - indicates the crypto mode is encryption or decryption.
307261847f8eSopenharmony_ci     * @param { Key } key - indicates the symmetric key or the asymmetric key.
307361847f8eSopenharmony_ci     * @param { ParamsSpec } params - indicates the algorithm parameters such as IV.
307461847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
307561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
307661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
307761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
307861847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
307961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
308061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
308161847f8eSopenharmony_ci     * @since 9
308261847f8eSopenharmony_ci     */
308361847f8eSopenharmony_ci    /**
308461847f8eSopenharmony_ci     * Init the crypto operation with the given crypto mode, key and parameters.
308561847f8eSopenharmony_ci     *
308661847f8eSopenharmony_ci     * @param { CryptoMode } opMode - indicates the crypto mode is encryption or decryption.
308761847f8eSopenharmony_ci     * @param { Key } key - indicates the symmetric key or the asymmetric key.
308861847f8eSopenharmony_ci     * @param { ParamsSpec } params - indicates the algorithm parameters such as IV.
308961847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
309061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
309161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
309261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
309361847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
309461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
309561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
309661847f8eSopenharmony_ci     * @crossplatform
309761847f8eSopenharmony_ci     * @since 11
309861847f8eSopenharmony_ci     */
309961847f8eSopenharmony_ci    /**
310061847f8eSopenharmony_ci     * Init the crypto operation with the given crypto mode, key and parameters.
310161847f8eSopenharmony_ci     *
310261847f8eSopenharmony_ci     * @param { CryptoMode } opMode - indicates the crypto mode is encryption or decryption.
310361847f8eSopenharmony_ci     * @param { Key } key - indicates the symmetric key or the asymmetric key.
310461847f8eSopenharmony_ci     * @param { ParamsSpec } params - indicates the algorithm parameters such as IV.
310561847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
310661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
310761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
310861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
310961847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
311061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
311161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
311261847f8eSopenharmony_ci     * @crossplatform
311361847f8eSopenharmony_ci     * @atomicservice
311461847f8eSopenharmony_ci     * @since 12
311561847f8eSopenharmony_ci     */
311661847f8eSopenharmony_ci    init(opMode: CryptoMode, key: Key, params: ParamsSpec): Promise<void>;
311761847f8eSopenharmony_ci
311861847f8eSopenharmony_ci    /**
311961847f8eSopenharmony_ci     * Init the crypto operation with the given crypto mode, key and parameters.
312061847f8eSopenharmony_ci     *
312161847f8eSopenharmony_ci     * @param { CryptoMode } opMode - indicates the crypto mode is encryption or decryption.
312261847f8eSopenharmony_ci     * @param { Key } key - indicates the symmetric key or the asymmetric key.
312361847f8eSopenharmony_ci     * @param { ParamsSpec | null } params - indicates the algorithm parameters such as IV.
312461847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
312561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
312661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
312761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
312861847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
312961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
313061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
313161847f8eSopenharmony_ci     * @since 10
313261847f8eSopenharmony_ci     */
313361847f8eSopenharmony_ci    /**
313461847f8eSopenharmony_ci     * Init the crypto operation with the given crypto mode, key and parameters.
313561847f8eSopenharmony_ci     *
313661847f8eSopenharmony_ci     * @param { CryptoMode } opMode - indicates the crypto mode is encryption or decryption.
313761847f8eSopenharmony_ci     * @param { Key } key - indicates the symmetric key or the asymmetric key.
313861847f8eSopenharmony_ci     * @param { ParamsSpec | null } params - indicates the algorithm parameters such as IV.
313961847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
314061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
314161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
314261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
314361847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
314461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
314561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
314661847f8eSopenharmony_ci     * @crossplatform
314761847f8eSopenharmony_ci     * @since 11
314861847f8eSopenharmony_ci     */
314961847f8eSopenharmony_ci    /**
315061847f8eSopenharmony_ci     * Init the crypto operation with the given crypto mode, key and parameters.
315161847f8eSopenharmony_ci     *
315261847f8eSopenharmony_ci     * @param { CryptoMode } opMode - indicates the crypto mode is encryption or decryption.
315361847f8eSopenharmony_ci     * @param { Key } key - indicates the symmetric key or the asymmetric key.
315461847f8eSopenharmony_ci     * @param { ParamsSpec | null } params - indicates the algorithm parameters such as IV.
315561847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
315661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
315761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
315861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
315961847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
316061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
316161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
316261847f8eSopenharmony_ci     * @crossplatform
316361847f8eSopenharmony_ci     * @atomicservice
316461847f8eSopenharmony_ci     * @since 12
316561847f8eSopenharmony_ci     */
316661847f8eSopenharmony_ci    init(opMode: CryptoMode, key: Key, params: ParamsSpec | null): Promise<void>;
316761847f8eSopenharmony_ci
316861847f8eSopenharmony_ci    /**
316961847f8eSopenharmony_ci     * Init the crypto operation with the given crypto mode, key and parameters.
317061847f8eSopenharmony_ci     *
317161847f8eSopenharmony_ci     * @param { CryptoMode } opMode - indicates the crypto mode is encryption or decryption.
317261847f8eSopenharmony_ci     * @param { Key } key - indicates the symmetric key or the asymmetric key.
317361847f8eSopenharmony_ci     * @param { ParamsSpec | null } params - indicates the algorithm parameters such as IV.
317461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
317561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
317661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
317761847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
317861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
317961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
318061847f8eSopenharmony_ci     * @crossplatform
318161847f8eSopenharmony_ci     * @atomicservice
318261847f8eSopenharmony_ci     * @since 12
318361847f8eSopenharmony_ci     */
318461847f8eSopenharmony_ci    initSync(opMode: CryptoMode, key: Key, params: ParamsSpec | null): void;
318561847f8eSopenharmony_ci
318661847f8eSopenharmony_ci    /**
318761847f8eSopenharmony_ci     * Update the crypto operation with the input data, and feed back the encrypted or decrypted data
318861847f8eSopenharmony_ci     * this time. RSA is not supported in this function.
318961847f8eSopenharmony_ci     *
319061847f8eSopenharmony_ci     * @param { DataBlob } data - indicates the data to be encrypted or decrypted.
319161847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback of the update function.
319261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
319361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
319461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
319561847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
319661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
319761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
319861847f8eSopenharmony_ci     * @since 9
319961847f8eSopenharmony_ci     */
320061847f8eSopenharmony_ci    /**
320161847f8eSopenharmony_ci     * Update the crypto operation with the input data, and feed back the encrypted or decrypted data
320261847f8eSopenharmony_ci     * this time. RSA is not supported in this function.
320361847f8eSopenharmony_ci     *
320461847f8eSopenharmony_ci     * @param { DataBlob } data - indicates the data to be encrypted or decrypted.
320561847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback of the update function.
320661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
320761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
320861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
320961847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
321061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
321161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
321261847f8eSopenharmony_ci     * @crossplatform
321361847f8eSopenharmony_ci     * @since 11
321461847f8eSopenharmony_ci     */
321561847f8eSopenharmony_ci    /**
321661847f8eSopenharmony_ci     * Update the crypto operation with the input data, and feed back the encrypted or decrypted data
321761847f8eSopenharmony_ci     * this time. RSA is not supported in this function.
321861847f8eSopenharmony_ci     *
321961847f8eSopenharmony_ci     * @param { DataBlob } data - indicates the data to be encrypted or decrypted.
322061847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback of the update function.
322161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
322261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
322361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
322461847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
322561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
322661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
322761847f8eSopenharmony_ci     * @crossplatform
322861847f8eSopenharmony_ci     * @atomicservice
322961847f8eSopenharmony_ci     * @since 12
323061847f8eSopenharmony_ci     */
323161847f8eSopenharmony_ci    update(data: DataBlob, callback: AsyncCallback<DataBlob>): void;
323261847f8eSopenharmony_ci
323361847f8eSopenharmony_ci    /**
323461847f8eSopenharmony_ci     * Update the crypto operation with the input data, and feed back the encrypted or decrypted data
323561847f8eSopenharmony_ci     * this time. RSA is not supported in this function.
323661847f8eSopenharmony_ci     *
323761847f8eSopenharmony_ci     * @param { DataBlob } data - indicates the data to be encrypted or decrypted.
323861847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise returned by the function.
323961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
324061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
324161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
324261847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
324361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
324461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
324561847f8eSopenharmony_ci     * @since 9
324661847f8eSopenharmony_ci     */
324761847f8eSopenharmony_ci    /**
324861847f8eSopenharmony_ci     * Update the crypto operation with the input data, and feed back the encrypted or decrypted data
324961847f8eSopenharmony_ci     * this time. RSA is not supported in this function.
325061847f8eSopenharmony_ci     *
325161847f8eSopenharmony_ci     * @param { DataBlob } data - indicates the data to be encrypted or decrypted.
325261847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise returned by the function.
325361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
325461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
325561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
325661847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
325761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
325861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
325961847f8eSopenharmony_ci     * @crossplatform
326061847f8eSopenharmony_ci     * @since 11
326161847f8eSopenharmony_ci     */
326261847f8eSopenharmony_ci    /**
326361847f8eSopenharmony_ci     * Update the crypto operation with the input data, and feed back the encrypted or decrypted data
326461847f8eSopenharmony_ci     * this time. RSA is not supported in this function.
326561847f8eSopenharmony_ci     *
326661847f8eSopenharmony_ci     * @param { DataBlob } data - indicates the data to be encrypted or decrypted.
326761847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise returned by the function.
326861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
326961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
327061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
327161847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
327261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
327361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
327461847f8eSopenharmony_ci     * @crossplatform
327561847f8eSopenharmony_ci     * @atomicservice
327661847f8eSopenharmony_ci     * @since 12
327761847f8eSopenharmony_ci     */
327861847f8eSopenharmony_ci    update(data: DataBlob): Promise<DataBlob>;
327961847f8eSopenharmony_ci
328061847f8eSopenharmony_ci    /**
328161847f8eSopenharmony_ci     * Update the crypto operation with the input data, and feed back the encrypted or decrypted data
328261847f8eSopenharmony_ci     * this time. RSA is not supported in this function.
328361847f8eSopenharmony_ci     *
328461847f8eSopenharmony_ci     * @param { DataBlob } data - indicates the data to be encrypted or decrypted.
328561847f8eSopenharmony_ci     * @returns { DataBlob } cipherText when encrypted or plainText when decrypted.
328661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
328761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
328861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
328961847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
329061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
329161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
329261847f8eSopenharmony_ci     * @crossplatform
329361847f8eSopenharmony_ci     * @atomicservice
329461847f8eSopenharmony_ci     * @since 12
329561847f8eSopenharmony_ci     */
329661847f8eSopenharmony_ci    updateSync(data: DataBlob): DataBlob;
329761847f8eSopenharmony_ci
329861847f8eSopenharmony_ci    /**
329961847f8eSopenharmony_ci     * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data.
330061847f8eSopenharmony_ci     * Data cannot be updated after the crypto operation is finished.
330161847f8eSopenharmony_ci     *
330261847f8eSopenharmony_ci     * @param { DataBlob } data - indicates the data to be finally encrypted or decrypted.
330361847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback of the doFinal function.
330461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
330561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
330661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
330761847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
330861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
330961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
331061847f8eSopenharmony_ci     * @since 9
331161847f8eSopenharmony_ci     */
331261847f8eSopenharmony_ci    /**
331361847f8eSopenharmony_ci     * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data.
331461847f8eSopenharmony_ci     * Data cannot be updated after the crypto operation is finished.
331561847f8eSopenharmony_ci     *
331661847f8eSopenharmony_ci     * @param { DataBlob } data - indicates the data to be finally encrypted or decrypted.
331761847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback of the doFinal function.
331861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
331961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
332061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
332161847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
332261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
332361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
332461847f8eSopenharmony_ci     * @crossplatform
332561847f8eSopenharmony_ci     * @since 11
332661847f8eSopenharmony_ci     */
332761847f8eSopenharmony_ci    /**
332861847f8eSopenharmony_ci     * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data.
332961847f8eSopenharmony_ci     * Data cannot be updated after the crypto operation is finished.
333061847f8eSopenharmony_ci     *
333161847f8eSopenharmony_ci     * @param { DataBlob } data - indicates the data to be finally encrypted or decrypted.
333261847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback of the doFinal function.
333361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
333461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
333561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
333661847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
333761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
333861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
333961847f8eSopenharmony_ci     * @crossplatform
334061847f8eSopenharmony_ci     * @atomicservice
334161847f8eSopenharmony_ci     * @since 12
334261847f8eSopenharmony_ci     */
334361847f8eSopenharmony_ci    doFinal(data: DataBlob, callback: AsyncCallback<DataBlob>): void;
334461847f8eSopenharmony_ci
334561847f8eSopenharmony_ci    /**
334661847f8eSopenharmony_ci     * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data.
334761847f8eSopenharmony_ci     * Data cannot be updated after the crypto operation is finished.
334861847f8eSopenharmony_ci     *
334961847f8eSopenharmony_ci     * @param { DataBlob | null } data - indicates the data to be finally encrypted or decrypted.
335061847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback of the doFinal function.
335161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
335261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
335361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
335461847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
335561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
335661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
335761847f8eSopenharmony_ci     * @since 10
335861847f8eSopenharmony_ci     */
335961847f8eSopenharmony_ci    /**
336061847f8eSopenharmony_ci     * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data.
336161847f8eSopenharmony_ci     * Data cannot be updated after the crypto operation is finished.
336261847f8eSopenharmony_ci     *
336361847f8eSopenharmony_ci     * @param { DataBlob | null } data - indicates the data to be finally encrypted or decrypted.
336461847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback of the doFinal function.
336561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
336661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
336761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
336861847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
336961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
337061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
337161847f8eSopenharmony_ci     * @crossplatform
337261847f8eSopenharmony_ci     * @since 11
337361847f8eSopenharmony_ci     */
337461847f8eSopenharmony_ci    /**
337561847f8eSopenharmony_ci     * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data.
337661847f8eSopenharmony_ci     * Data cannot be updated after the crypto operation is finished.
337761847f8eSopenharmony_ci     *
337861847f8eSopenharmony_ci     * @param { DataBlob | null } data - indicates the data to be finally encrypted or decrypted.
337961847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback of the doFinal function.
338061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
338161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
338261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
338361847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
338461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
338561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
338661847f8eSopenharmony_ci     * @crossplatform
338761847f8eSopenharmony_ci     * @atomicservice
338861847f8eSopenharmony_ci     * @since 12
338961847f8eSopenharmony_ci     */
339061847f8eSopenharmony_ci    doFinal(data: DataBlob | null, callback: AsyncCallback<DataBlob>): void;
339161847f8eSopenharmony_ci
339261847f8eSopenharmony_ci    /**
339361847f8eSopenharmony_ci     * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data.
339461847f8eSopenharmony_ci     * Data cannot be updated after the crypto operation is finished.
339561847f8eSopenharmony_ci     *
339661847f8eSopenharmony_ci     * @param { DataBlob } data - indicates the data to be finally encrypted or decrypted.
339761847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise returned by the function.
339861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
339961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
340061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
340161847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
340261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
340361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
340461847f8eSopenharmony_ci     * @since 9
340561847f8eSopenharmony_ci     */
340661847f8eSopenharmony_ci    /**
340761847f8eSopenharmony_ci     * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data.
340861847f8eSopenharmony_ci     * Data cannot be updated after the crypto operation is finished.
340961847f8eSopenharmony_ci     *
341061847f8eSopenharmony_ci     * @param { DataBlob } data - indicates the data to be finally encrypted or decrypted.
341161847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise returned by the function.
341261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
341361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
341461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
341561847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
341661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
341761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
341861847f8eSopenharmony_ci     * @crossplatform
341961847f8eSopenharmony_ci     * @since 11
342061847f8eSopenharmony_ci     */
342161847f8eSopenharmony_ci    /**
342261847f8eSopenharmony_ci     * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data.
342361847f8eSopenharmony_ci     * Data cannot be updated after the crypto operation is finished.
342461847f8eSopenharmony_ci     *
342561847f8eSopenharmony_ci     * @param { DataBlob } data - indicates the data to be finally encrypted or decrypted.
342661847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise returned by the function.
342761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
342861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
342961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
343061847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
343161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
343261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
343361847f8eSopenharmony_ci     * @crossplatform
343461847f8eSopenharmony_ci     * @atomicservice
343561847f8eSopenharmony_ci     * @since 12
343661847f8eSopenharmony_ci     */
343761847f8eSopenharmony_ci    doFinal(data: DataBlob): Promise<DataBlob>;
343861847f8eSopenharmony_ci
343961847f8eSopenharmony_ci    /**
344061847f8eSopenharmony_ci     * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data.
344161847f8eSopenharmony_ci     * Data cannot be updated after the crypto operation is finished.
344261847f8eSopenharmony_ci     *
344361847f8eSopenharmony_ci     * @param { DataBlob | null } data - indicates the data to be finally encrypted or decrypted.
344461847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise returned by the function.
344561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
344661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
344761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
344861847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
344961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
345061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
345161847f8eSopenharmony_ci     * @since 10
345261847f8eSopenharmony_ci     */
345361847f8eSopenharmony_ci    /**
345461847f8eSopenharmony_ci     * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data.
345561847f8eSopenharmony_ci     * Data cannot be updated after the crypto operation is finished.
345661847f8eSopenharmony_ci     *
345761847f8eSopenharmony_ci     * @param { DataBlob | null } data - indicates the data to be finally encrypted or decrypted.
345861847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise returned by the function.
345961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
346061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
346161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
346261847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
346361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
346461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
346561847f8eSopenharmony_ci     * @crossplatform
346661847f8eSopenharmony_ci     * @since 11
346761847f8eSopenharmony_ci     */
346861847f8eSopenharmony_ci    /**
346961847f8eSopenharmony_ci     * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data.
347061847f8eSopenharmony_ci     * Data cannot be updated after the crypto operation is finished.
347161847f8eSopenharmony_ci     *
347261847f8eSopenharmony_ci     * @param { DataBlob | null } data - indicates the data to be finally encrypted or decrypted.
347361847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise returned by the function.
347461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
347561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
347661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
347761847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
347861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
347961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
348061847f8eSopenharmony_ci     * @crossplatform
348161847f8eSopenharmony_ci     * @atomicservice
348261847f8eSopenharmony_ci     * @since 12
348361847f8eSopenharmony_ci     */
348461847f8eSopenharmony_ci    doFinal(data: DataBlob | null): Promise<DataBlob>;
348561847f8eSopenharmony_ci
348661847f8eSopenharmony_ci    /**
348761847f8eSopenharmony_ci     * Finish the crypto operation, encrypt or decrypt the input data, and then feed back the output data.
348861847f8eSopenharmony_ci     * Data cannot be updated after the crypto operation is finished.
348961847f8eSopenharmony_ci     *
349061847f8eSopenharmony_ci     * @param { DataBlob | null } data - indicates the data to be finally encrypted or decrypted.
349161847f8eSopenharmony_ci     * @returns { DataBlob } cipherText when encrypted or plainText when decrypted.
349261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
349361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
349461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
349561847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
349661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
349761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
349861847f8eSopenharmony_ci     * @crossplatform
349961847f8eSopenharmony_ci     * @atomicservice
350061847f8eSopenharmony_ci     * @since 12
350161847f8eSopenharmony_ci     */
350261847f8eSopenharmony_ci    doFinalSync(data: DataBlob | null): DataBlob;
350361847f8eSopenharmony_ci
350461847f8eSopenharmony_ci    /**
350561847f8eSopenharmony_ci     * Set the specified parameter to the cipher object.
350661847f8eSopenharmony_ci     * Currently, only the OAEP_MGF1_PSRC_UINT8ARR parameter in RSA is supported.
350761847f8eSopenharmony_ci     *
350861847f8eSopenharmony_ci     * @param { CipherSpecItem } itemType - indicates the specified parameter type.
350961847f8eSopenharmony_ci     * @param { Uint8Array } itemValue - the value of the specified parameter.
351061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
351161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
351261847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
351361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
351461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
351561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
351661847f8eSopenharmony_ci     * @since 10
351761847f8eSopenharmony_ci     */
351861847f8eSopenharmony_ci    /**
351961847f8eSopenharmony_ci     * Set the specified parameter to the cipher object.
352061847f8eSopenharmony_ci     * Currently, only the OAEP_MGF1_PSRC_UINT8ARR parameter in RSA is supported.
352161847f8eSopenharmony_ci     *
352261847f8eSopenharmony_ci     * @param { CipherSpecItem } itemType - indicates the specified parameter type.
352361847f8eSopenharmony_ci     * @param { Uint8Array } itemValue - the value of the specified parameter.
352461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
352561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
352661847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
352761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
352861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
352961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
353061847f8eSopenharmony_ci     * @crossplatform
353161847f8eSopenharmony_ci     * @since 11
353261847f8eSopenharmony_ci     */
353361847f8eSopenharmony_ci    /**
353461847f8eSopenharmony_ci     * Set the specified parameter to the cipher object.
353561847f8eSopenharmony_ci     * Currently, only the OAEP_MGF1_PSRC_UINT8ARR parameter in RSA is supported.
353661847f8eSopenharmony_ci     *
353761847f8eSopenharmony_ci     * @param { CipherSpecItem } itemType - indicates the specified parameter type.
353861847f8eSopenharmony_ci     * @param { Uint8Array } itemValue - the value of the specified parameter.
353961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
354061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
354161847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
354261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
354361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
354461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
354561847f8eSopenharmony_ci     * @crossplatform
354661847f8eSopenharmony_ci     * @atomicservice
354761847f8eSopenharmony_ci     * @since 12
354861847f8eSopenharmony_ci     */
354961847f8eSopenharmony_ci    setCipherSpec(itemType: CipherSpecItem, itemValue: Uint8Array): void;
355061847f8eSopenharmony_ci
355161847f8eSopenharmony_ci    /**
355261847f8eSopenharmony_ci     * Get the specified parameter from the cipher object.
355361847f8eSopenharmony_ci     * Currently, only OAEP parameters in RSA is supported.
355461847f8eSopenharmony_ci     *
355561847f8eSopenharmony_ci     * @param { CipherSpecItem } itemType - indicates the specified parameter type.
355661847f8eSopenharmony_ci     * @returns { string | Uint8Array } the value of the specified parameter.
355761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
355861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
355961847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
356061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
356161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
356261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
356361847f8eSopenharmony_ci     * @since 10
356461847f8eSopenharmony_ci     */
356561847f8eSopenharmony_ci    /**
356661847f8eSopenharmony_ci     * Get the specified parameter from the cipher object.
356761847f8eSopenharmony_ci     * Currently, only OAEP parameters in RSA is supported.
356861847f8eSopenharmony_ci     *
356961847f8eSopenharmony_ci     * @param { CipherSpecItem } itemType - indicates the specified parameter type.
357061847f8eSopenharmony_ci     * @returns { string | Uint8Array } the value of the specified parameter.
357161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
357261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
357361847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
357461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
357561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
357661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
357761847f8eSopenharmony_ci     * @crossplatform
357861847f8eSopenharmony_ci     * @since 11
357961847f8eSopenharmony_ci     */
358061847f8eSopenharmony_ci    /**
358161847f8eSopenharmony_ci     * Get the specified parameter from the cipher object.
358261847f8eSopenharmony_ci     * Currently, only OAEP parameters in RSA is supported.
358361847f8eSopenharmony_ci     *
358461847f8eSopenharmony_ci     * @param { CipherSpecItem } itemType - indicates the specified parameter type.
358561847f8eSopenharmony_ci     * @returns { string | Uint8Array } the value of the specified parameter.
358661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
358761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
358861847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
358961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
359061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
359161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
359261847f8eSopenharmony_ci     * @crossplatform
359361847f8eSopenharmony_ci     * @atomicservice
359461847f8eSopenharmony_ci     * @since 12
359561847f8eSopenharmony_ci     */
359661847f8eSopenharmony_ci    getCipherSpec(itemType: CipherSpecItem): string | Uint8Array;
359761847f8eSopenharmony_ci
359861847f8eSopenharmony_ci    /**
359961847f8eSopenharmony_ci     * Indicates the algorithm name of the cipher object.
360061847f8eSopenharmony_ci     *
360161847f8eSopenharmony_ci     * @type { string }
360261847f8eSopenharmony_ci     * @readonly
360361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
360461847f8eSopenharmony_ci     * @since 9
360561847f8eSopenharmony_ci     */
360661847f8eSopenharmony_ci    /**
360761847f8eSopenharmony_ci     * Indicates the algorithm name of the cipher object.
360861847f8eSopenharmony_ci     *
360961847f8eSopenharmony_ci     * @type { string }
361061847f8eSopenharmony_ci     * @readonly
361161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
361261847f8eSopenharmony_ci     * @crossplatform
361361847f8eSopenharmony_ci     * @since 11
361461847f8eSopenharmony_ci     */
361561847f8eSopenharmony_ci    /**
361661847f8eSopenharmony_ci     * Indicates the algorithm name of the cipher object.
361761847f8eSopenharmony_ci     *
361861847f8eSopenharmony_ci     * @type { string }
361961847f8eSopenharmony_ci     * @readonly
362061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
362161847f8eSopenharmony_ci     * @crossplatform
362261847f8eSopenharmony_ci     * @atomicservice
362361847f8eSopenharmony_ci     * @since 12
362461847f8eSopenharmony_ci     */
362561847f8eSopenharmony_ci    readonly algName: string;
362661847f8eSopenharmony_ci  }
362761847f8eSopenharmony_ci
362861847f8eSopenharmony_ci  /**
362961847f8eSopenharmony_ci   * Create a cipher object for encryption and decryption operations according to the given specifications.
363061847f8eSopenharmony_ci   * Two different Cipher objects should be created when using RSA encryption and decryption,
363161847f8eSopenharmony_ci   * even with the same specifications.
363261847f8eSopenharmony_ci   *
363361847f8eSopenharmony_ci   * @param { string } transformation - indicates the description to be transformed to cipher specifications.
363461847f8eSopenharmony_ci   * @returns { Cipher } the cipher object returned by the function.
363561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
363661847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
363761847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
363861847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
363961847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
364061847f8eSopenharmony_ci   * @since 9
364161847f8eSopenharmony_ci   */
364261847f8eSopenharmony_ci  /**
364361847f8eSopenharmony_ci   * Create a cipher object for encryption and decryption operations according to the given specifications.
364461847f8eSopenharmony_ci   * Two different Cipher objects should be created when using RSA encryption and decryption,
364561847f8eSopenharmony_ci   * even with the same specifications.
364661847f8eSopenharmony_ci   *
364761847f8eSopenharmony_ci   * @param { string } transformation - indicates the description to be transformed to cipher specifications.
364861847f8eSopenharmony_ci   * @returns { Cipher } the cipher object returned by the function.
364961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
365061847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
365161847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
365261847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
365361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
365461847f8eSopenharmony_ci   * @crossplatform
365561847f8eSopenharmony_ci   * @since 11
365661847f8eSopenharmony_ci   */
365761847f8eSopenharmony_ci  /**
365861847f8eSopenharmony_ci   * Create a cipher object for encryption and decryption operations according to the given specifications.
365961847f8eSopenharmony_ci   * Two different Cipher objects should be created when using RSA encryption and decryption,
366061847f8eSopenharmony_ci   * even with the same specifications.
366161847f8eSopenharmony_ci   *
366261847f8eSopenharmony_ci   * @param { string } transformation - indicates the description to be transformed to cipher specifications.
366361847f8eSopenharmony_ci   *                                    Multiple parameters need to be concatenated by "|".
366461847f8eSopenharmony_ci   * @returns { Cipher } the cipher object returned by the function.
366561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
366661847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
366761847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
366861847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
366961847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Cipher
367061847f8eSopenharmony_ci   * @crossplatform
367161847f8eSopenharmony_ci   * @atomicservice
367261847f8eSopenharmony_ci   * @since 12
367361847f8eSopenharmony_ci   */
367461847f8eSopenharmony_ci  function createCipher(transformation: string): Cipher;
367561847f8eSopenharmony_ci
367661847f8eSopenharmony_ci  /**
367761847f8eSopenharmony_ci   * Provides the Sign type, which is used for generating signatures.
367861847f8eSopenharmony_ci   *
367961847f8eSopenharmony_ci   * @typedef Sign
368061847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
368161847f8eSopenharmony_ci   * @since 9
368261847f8eSopenharmony_ci   */
368361847f8eSopenharmony_ci  /**
368461847f8eSopenharmony_ci   * Provides the Sign type, which is used for generating signatures.
368561847f8eSopenharmony_ci   *
368661847f8eSopenharmony_ci   * @typedef Sign
368761847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
368861847f8eSopenharmony_ci   * @crossplatform
368961847f8eSopenharmony_ci   * @since 11
369061847f8eSopenharmony_ci   */
369161847f8eSopenharmony_ci  /**
369261847f8eSopenharmony_ci   * Provides the Sign type, which is used for generating signatures.
369361847f8eSopenharmony_ci   *
369461847f8eSopenharmony_ci   * @typedef Sign
369561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Signature
369661847f8eSopenharmony_ci   * @crossplatform
369761847f8eSopenharmony_ci   * @atomicservice
369861847f8eSopenharmony_ci   * @since 12
369961847f8eSopenharmony_ci   */
370061847f8eSopenharmony_ci  interface Sign {
370161847f8eSopenharmony_ci    /**
370261847f8eSopenharmony_ci     * Used to init environment.
370361847f8eSopenharmony_ci     *
370461847f8eSopenharmony_ci     * @param { PriKey } priKey - the private key.
370561847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the call back function return nothing.
370661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
370761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
370861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
370961847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
371061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
371161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
371261847f8eSopenharmony_ci     * @since 9
371361847f8eSopenharmony_ci     */
371461847f8eSopenharmony_ci    /**
371561847f8eSopenharmony_ci     * Used to init environment.
371661847f8eSopenharmony_ci     *
371761847f8eSopenharmony_ci     * @param { PriKey } priKey - the private key.
371861847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the call back function return nothing.
371961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
372061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
372161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
372261847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
372361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
372461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
372561847f8eSopenharmony_ci     * @crossplatform
372661847f8eSopenharmony_ci     * @since 11
372761847f8eSopenharmony_ci     */
372861847f8eSopenharmony_ci    /**
372961847f8eSopenharmony_ci     * Used to init environment.
373061847f8eSopenharmony_ci     *
373161847f8eSopenharmony_ci     * @param { PriKey } priKey - the private key.
373261847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the call back function return nothing.
373361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
373461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
373561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
373661847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
373761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
373861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
373961847f8eSopenharmony_ci     * @crossplatform
374061847f8eSopenharmony_ci     * @atomicservice
374161847f8eSopenharmony_ci     * @since 12
374261847f8eSopenharmony_ci     */
374361847f8eSopenharmony_ci    init(priKey: PriKey, callback: AsyncCallback<void>): void;
374461847f8eSopenharmony_ci
374561847f8eSopenharmony_ci    /**
374661847f8eSopenharmony_ci     * Used to init environment.
374761847f8eSopenharmony_ci     *
374861847f8eSopenharmony_ci     * @param { PriKey } priKey - the private key.
374961847f8eSopenharmony_ci     * @returns { Promise<void> } return nothing.
375061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
375161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
375261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
375361847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
375461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
375561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
375661847f8eSopenharmony_ci     * @since 9
375761847f8eSopenharmony_ci     */
375861847f8eSopenharmony_ci    /**
375961847f8eSopenharmony_ci     * Used to init environment.
376061847f8eSopenharmony_ci     *
376161847f8eSopenharmony_ci     * @param { PriKey } priKey - the private key.
376261847f8eSopenharmony_ci     * @returns { Promise<void> } return nothing.
376361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
376461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
376561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
376661847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
376761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
376861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
376961847f8eSopenharmony_ci     * @crossplatform
377061847f8eSopenharmony_ci     * @since 11
377161847f8eSopenharmony_ci     */
377261847f8eSopenharmony_ci    /**
377361847f8eSopenharmony_ci     * Used to init environment.
377461847f8eSopenharmony_ci     *
377561847f8eSopenharmony_ci     * @param { PriKey } priKey - the private key.
377661847f8eSopenharmony_ci     * @returns { Promise<void> } return nothing.
377761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
377861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
377961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
378061847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
378161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
378261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
378361847f8eSopenharmony_ci     * @crossplatform
378461847f8eSopenharmony_ci     * @atomicservice
378561847f8eSopenharmony_ci     * @since 12
378661847f8eSopenharmony_ci     */
378761847f8eSopenharmony_ci    init(priKey: PriKey): Promise<void>;
378861847f8eSopenharmony_ci
378961847f8eSopenharmony_ci    /**
379061847f8eSopenharmony_ci     * Used to init environment.
379161847f8eSopenharmony_ci     *
379261847f8eSopenharmony_ci     * @param { PriKey } priKey - the private key.
379361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
379461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
379561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
379661847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
379761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
379861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
379961847f8eSopenharmony_ci     * @crossplatform
380061847f8eSopenharmony_ci     * @atomicservice
380161847f8eSopenharmony_ci     * @since 12
380261847f8eSopenharmony_ci     */
380361847f8eSopenharmony_ci    initSync(priKey: PriKey): void;
380461847f8eSopenharmony_ci
380561847f8eSopenharmony_ci    /**
380661847f8eSopenharmony_ci     * Used to append the message need to be signed.
380761847f8eSopenharmony_ci     *
380861847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be signed.
380961847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the call back function return nothing.
381061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
381161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
381261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
381361847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
381461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
381561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
381661847f8eSopenharmony_ci     * @since 9
381761847f8eSopenharmony_ci     */
381861847f8eSopenharmony_ci    /**
381961847f8eSopenharmony_ci     * Used to append the message need to be signed.
382061847f8eSopenharmony_ci     *
382161847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be signed.
382261847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the call back function return nothing.
382361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
382461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
382561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
382661847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
382761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
382861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
382961847f8eSopenharmony_ci     * @crossplatform
383061847f8eSopenharmony_ci     * @since 11
383161847f8eSopenharmony_ci     */
383261847f8eSopenharmony_ci    /**
383361847f8eSopenharmony_ci     * Used to append the message need to be signed.
383461847f8eSopenharmony_ci     *
383561847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be signed.
383661847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the call back function return nothing.
383761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
383861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
383961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
384061847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
384161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
384261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
384361847f8eSopenharmony_ci     * @crossplatform
384461847f8eSopenharmony_ci     * @atomicservice
384561847f8eSopenharmony_ci     * @since 12
384661847f8eSopenharmony_ci     */
384761847f8eSopenharmony_ci    update(data: DataBlob, callback: AsyncCallback<void>): void;
384861847f8eSopenharmony_ci
384961847f8eSopenharmony_ci    /**
385061847f8eSopenharmony_ci     * Used to append the message need to be signed.
385161847f8eSopenharmony_ci     *
385261847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be signed.
385361847f8eSopenharmony_ci     * @returns { Promise<void> } return nothing.
385461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
385561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
385661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
385761847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
385861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
385961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
386061847f8eSopenharmony_ci     * @since 9
386161847f8eSopenharmony_ci     */
386261847f8eSopenharmony_ci    /**
386361847f8eSopenharmony_ci     * Used to append the message need to be signed.
386461847f8eSopenharmony_ci     *
386561847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be signed.
386661847f8eSopenharmony_ci     * @returns { Promise<void> } return nothing.
386761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
386861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
386961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
387061847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
387161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
387261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
387361847f8eSopenharmony_ci     * @crossplatform
387461847f8eSopenharmony_ci     * @since 11
387561847f8eSopenharmony_ci     */
387661847f8eSopenharmony_ci    /**
387761847f8eSopenharmony_ci     * Used to append the message need to be signed.
387861847f8eSopenharmony_ci     *
387961847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be signed.
388061847f8eSopenharmony_ci     * @returns { Promise<void> } return nothing.
388161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
388261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
388361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
388461847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
388561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
388661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
388761847f8eSopenharmony_ci     * @crossplatform
388861847f8eSopenharmony_ci     * @atomicservice
388961847f8eSopenharmony_ci     * @since 12
389061847f8eSopenharmony_ci     */
389161847f8eSopenharmony_ci    update(data: DataBlob): Promise<void>;
389261847f8eSopenharmony_ci
389361847f8eSopenharmony_ci    /**
389461847f8eSopenharmony_ci     * Used to append the message need to be signed.
389561847f8eSopenharmony_ci     *
389661847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be signed.
389761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
389861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
389961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
390061847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
390161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
390261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
390361847f8eSopenharmony_ci     * @crossplatform
390461847f8eSopenharmony_ci     * @atomicservice
390561847f8eSopenharmony_ci     * @since 12
390661847f8eSopenharmony_ci     */
390761847f8eSopenharmony_ci    updateSync(data: DataBlob): void;
390861847f8eSopenharmony_ci
390961847f8eSopenharmony_ci    /**
391061847f8eSopenharmony_ci     * Used to sign message, include the update data.
391161847f8eSopenharmony_ci     *
391261847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be signed.
391361847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - return the signed message.
391461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
391561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
391661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
391761847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
391861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
391961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
392061847f8eSopenharmony_ci     * @since 9
392161847f8eSopenharmony_ci     */
392261847f8eSopenharmony_ci    /**
392361847f8eSopenharmony_ci     * Used to sign message, include the update data.
392461847f8eSopenharmony_ci     *
392561847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be signed.
392661847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - return the signed message.
392761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
392861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
392961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
393061847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
393161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
393261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
393361847f8eSopenharmony_ci     * @crossplatform
393461847f8eSopenharmony_ci     * @since 11
393561847f8eSopenharmony_ci     */
393661847f8eSopenharmony_ci    /**
393761847f8eSopenharmony_ci     * Used to sign message, include the update data.
393861847f8eSopenharmony_ci     *
393961847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be signed.
394061847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - return the signed message.
394161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
394261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
394361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
394461847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
394561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
394661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
394761847f8eSopenharmony_ci     * @crossplatform
394861847f8eSopenharmony_ci     * @atomicservice
394961847f8eSopenharmony_ci     * @since 12
395061847f8eSopenharmony_ci     */
395161847f8eSopenharmony_ci    sign(data: DataBlob, callback: AsyncCallback<DataBlob>): void;
395261847f8eSopenharmony_ci
395361847f8eSopenharmony_ci    /**
395461847f8eSopenharmony_ci     * Used to sign message, include the update data.
395561847f8eSopenharmony_ci     *
395661847f8eSopenharmony_ci     * @param { DataBlob | null } data - the data need to be signed.
395761847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - return the signed message.
395861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
395961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
396061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
396161847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
396261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
396361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
396461847f8eSopenharmony_ci     * @since 10
396561847f8eSopenharmony_ci     */
396661847f8eSopenharmony_ci    /**
396761847f8eSopenharmony_ci     * Used to sign message, include the update data.
396861847f8eSopenharmony_ci     *
396961847f8eSopenharmony_ci     * @param { DataBlob | null } data - the data need to be signed.
397061847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - return the signed message.
397161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
397261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
397361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
397461847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
397561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
397661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
397761847f8eSopenharmony_ci     * @crossplatform
397861847f8eSopenharmony_ci     * @since 11
397961847f8eSopenharmony_ci     */
398061847f8eSopenharmony_ci    /**
398161847f8eSopenharmony_ci     * Used to sign message, include the update data.
398261847f8eSopenharmony_ci     *
398361847f8eSopenharmony_ci     * @param { DataBlob | null } data - the data need to be signed.
398461847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - return the signed message.
398561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
398661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
398761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
398861847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
398961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
399061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
399161847f8eSopenharmony_ci     * @crossplatform
399261847f8eSopenharmony_ci     * @atomicservice
399361847f8eSopenharmony_ci     * @since 12
399461847f8eSopenharmony_ci     */
399561847f8eSopenharmony_ci    sign(data: DataBlob | null, callback: AsyncCallback<DataBlob>): void;
399661847f8eSopenharmony_ci
399761847f8eSopenharmony_ci    /**
399861847f8eSopenharmony_ci     * Used to append the message need to be signed.
399961847f8eSopenharmony_ci     *
400061847f8eSopenharmony_ci     * @param { DataBlob } data - the private key.
400161847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } return the signed message.
400261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
400361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
400461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
400561847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
400661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
400761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
400861847f8eSopenharmony_ci     * @since 9
400961847f8eSopenharmony_ci     */
401061847f8eSopenharmony_ci    /**
401161847f8eSopenharmony_ci     * Used to append the message need to be signed.
401261847f8eSopenharmony_ci     *
401361847f8eSopenharmony_ci     * @param { DataBlob } data - the private key.
401461847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } return the signed message.
401561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
401661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
401761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
401861847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
401961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
402061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
402161847f8eSopenharmony_ci     * @crossplatform
402261847f8eSopenharmony_ci     * @since 11
402361847f8eSopenharmony_ci     */
402461847f8eSopenharmony_ci    /**
402561847f8eSopenharmony_ci     * Used to append the message need to be signed.
402661847f8eSopenharmony_ci     *
402761847f8eSopenharmony_ci     * @param { DataBlob } data - the private key.
402861847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } return the signed message.
402961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
403061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
403161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
403261847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
403361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
403461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
403561847f8eSopenharmony_ci     * @crossplatform
403661847f8eSopenharmony_ci     * @atomicservice
403761847f8eSopenharmony_ci     * @since 12
403861847f8eSopenharmony_ci     */
403961847f8eSopenharmony_ci    sign(data: DataBlob): Promise<DataBlob>;
404061847f8eSopenharmony_ci
404161847f8eSopenharmony_ci    /**
404261847f8eSopenharmony_ci     * Used to append the message need to be signed.
404361847f8eSopenharmony_ci     *
404461847f8eSopenharmony_ci     * @param { DataBlob | null } data - the private key.
404561847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } return the signed message.
404661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
404761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
404861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
404961847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
405061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
405161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
405261847f8eSopenharmony_ci     * @since 10
405361847f8eSopenharmony_ci     */
405461847f8eSopenharmony_ci    /**
405561847f8eSopenharmony_ci     * Used to append the message need to be signed.
405661847f8eSopenharmony_ci     *
405761847f8eSopenharmony_ci     * @param { DataBlob | null } data - the private key.
405861847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } return the signed message.
405961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
406061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
406161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
406261847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
406361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
406461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
406561847f8eSopenharmony_ci     * @crossplatform
406661847f8eSopenharmony_ci     * @since 11
406761847f8eSopenharmony_ci     */
406861847f8eSopenharmony_ci    /**
406961847f8eSopenharmony_ci     * Used to append the message need to be signed.
407061847f8eSopenharmony_ci     *
407161847f8eSopenharmony_ci     * @param { DataBlob | null } data - the private key.
407261847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } return the signed message.
407361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
407461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
407561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
407661847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
407761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
407861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
407961847f8eSopenharmony_ci     * @crossplatform
408061847f8eSopenharmony_ci     * @atomicservice
408161847f8eSopenharmony_ci     * @since 12
408261847f8eSopenharmony_ci     */
408361847f8eSopenharmony_ci    sign(data: DataBlob | null): Promise<DataBlob>;
408461847f8eSopenharmony_ci
408561847f8eSopenharmony_ci    /**
408661847f8eSopenharmony_ci     * Used to append the message need to be signed.
408761847f8eSopenharmony_ci     *
408861847f8eSopenharmony_ci     * @param { DataBlob | null } data - the private key.
408961847f8eSopenharmony_ci     * @returns { DataBlob } return the signed message.
409061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
409161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
409261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
409361847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
409461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
409561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
409661847f8eSopenharmony_ci     * @crossplatform
409761847f8eSopenharmony_ci     * @atomicservice
409861847f8eSopenharmony_ci     * @since 12
409961847f8eSopenharmony_ci     */
410061847f8eSopenharmony_ci    signSync(data: DataBlob | null): DataBlob;
410161847f8eSopenharmony_ci
410261847f8eSopenharmony_ci    /**
410361847f8eSopenharmony_ci     * Set the specified parameter to the sign object.
410461847f8eSopenharmony_ci     * Currently, only the PSS_SALT_LEN parameter in RSA is supported.
410561847f8eSopenharmony_ci     *
410661847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
410761847f8eSopenharmony_ci     * @param { number } itemValue - the value of the specified parameter.
410861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
410961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
411061847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
411161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
411261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
411361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
411461847f8eSopenharmony_ci     * @since 10
411561847f8eSopenharmony_ci     */
411661847f8eSopenharmony_ci    /**
411761847f8eSopenharmony_ci     * Set the specified parameter to the sign object.
411861847f8eSopenharmony_ci     * Currently, only the PSS_SALT_LEN parameter in RSA is supported.
411961847f8eSopenharmony_ci     *
412061847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
412161847f8eSopenharmony_ci     * @param { number } itemValue - the value of the specified parameter.
412261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
412361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
412461847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
412561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
412661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
412761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
412861847f8eSopenharmony_ci     * @crossplatform
412961847f8eSopenharmony_ci     * @since 11
413061847f8eSopenharmony_ci     */
413161847f8eSopenharmony_ci    /**
413261847f8eSopenharmony_ci     * Set the specified parameter to the sign object.
413361847f8eSopenharmony_ci     * Currently, only the PSS_SALT_LEN parameter in RSA is supported.
413461847f8eSopenharmony_ci     *
413561847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
413661847f8eSopenharmony_ci     * @param { number } itemValue - the value of the specified parameter.
413761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
413861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
413961847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
414061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
414161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
414261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
414361847f8eSopenharmony_ci     * @crossplatform
414461847f8eSopenharmony_ci     * @atomicservice
414561847f8eSopenharmony_ci     * @since 12
414661847f8eSopenharmony_ci     */
414761847f8eSopenharmony_ci    setSignSpec(itemType: SignSpecItem, itemValue: number): void;
414861847f8eSopenharmony_ci
414961847f8eSopenharmony_ci    /**
415061847f8eSopenharmony_ci     * Set the specified parameter to the sign object.
415161847f8eSopenharmony_ci     * Currently, only PSS_SALT_LEN in RSA and USER_ID in SM2 are supported.
415261847f8eSopenharmony_ci     *
415361847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
415461847f8eSopenharmony_ci     * @param { number | Uint8Array } itemValue - the value of the specified parameter.
415561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
415661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
415761847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
415861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
415961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
416061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
416161847f8eSopenharmony_ci     * @crossplatform
416261847f8eSopenharmony_ci     * @since 11
416361847f8eSopenharmony_ci     */
416461847f8eSopenharmony_ci    /**
416561847f8eSopenharmony_ci     * Set the specified parameter to the sign object.
416661847f8eSopenharmony_ci     * Currently, only PSS_SALT_LEN in RSA and USER_ID in SM2 are supported.
416761847f8eSopenharmony_ci     *
416861847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
416961847f8eSopenharmony_ci     * @param { number | Uint8Array } itemValue - the value of the specified parameter.
417061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
417161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
417261847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
417361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
417461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
417561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
417661847f8eSopenharmony_ci     * @crossplatform
417761847f8eSopenharmony_ci     * @atomicservice
417861847f8eSopenharmony_ci     * @since 12
417961847f8eSopenharmony_ci     */
418061847f8eSopenharmony_ci    setSignSpec(itemType: SignSpecItem, itemValue: number | Uint8Array): void;
418161847f8eSopenharmony_ci
418261847f8eSopenharmony_ci    /**
418361847f8eSopenharmony_ci     * Get the specified parameter from the sign object.
418461847f8eSopenharmony_ci     * Currently, only PSS parameters in RSA is supported.
418561847f8eSopenharmony_ci     *
418661847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
418761847f8eSopenharmony_ci     * @returns { string | number } the value of the specified parameter.
418861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
418961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
419061847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
419161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
419261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
419361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
419461847f8eSopenharmony_ci     * @since 10
419561847f8eSopenharmony_ci     */
419661847f8eSopenharmony_ci    /**
419761847f8eSopenharmony_ci     * Get the specified parameter from the sign object.
419861847f8eSopenharmony_ci     * Currently, only PSS parameters in RSA is supported.
419961847f8eSopenharmony_ci     *
420061847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
420161847f8eSopenharmony_ci     * @returns { string | number } the value of the specified parameter.
420261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
420361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
420461847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
420561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
420661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
420761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
420861847f8eSopenharmony_ci     * @crossplatform
420961847f8eSopenharmony_ci     * @since 11
421061847f8eSopenharmony_ci     */
421161847f8eSopenharmony_ci    /**
421261847f8eSopenharmony_ci     * Get the specified parameter from the sign object.
421361847f8eSopenharmony_ci     * Currently, only PSS parameters in RSA is supported.
421461847f8eSopenharmony_ci     *
421561847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
421661847f8eSopenharmony_ci     * @returns { string | number } the value of the specified parameter.
421761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
421861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
421961847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
422061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
422161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
422261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
422361847f8eSopenharmony_ci     * @crossplatform
422461847f8eSopenharmony_ci     * @atomicservice
422561847f8eSopenharmony_ci     * @since 12
422661847f8eSopenharmony_ci     */
422761847f8eSopenharmony_ci    getSignSpec(itemType: SignSpecItem): string | number;
422861847f8eSopenharmony_ci
422961847f8eSopenharmony_ci    /**
423061847f8eSopenharmony_ci     * Indicates the algorithm name of the sign object.
423161847f8eSopenharmony_ci     *
423261847f8eSopenharmony_ci     * @type { string }
423361847f8eSopenharmony_ci     * @readonly
423461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
423561847f8eSopenharmony_ci     * @since 9
423661847f8eSopenharmony_ci     */
423761847f8eSopenharmony_ci    /**
423861847f8eSopenharmony_ci     * Indicates the algorithm name of the sign object.
423961847f8eSopenharmony_ci     *
424061847f8eSopenharmony_ci     * @type { string }
424161847f8eSopenharmony_ci     * @readonly
424261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
424361847f8eSopenharmony_ci     * @crossplatform
424461847f8eSopenharmony_ci     * @since 11
424561847f8eSopenharmony_ci     */
424661847f8eSopenharmony_ci    /**
424761847f8eSopenharmony_ci     * Indicates the algorithm name of the sign object.
424861847f8eSopenharmony_ci     *
424961847f8eSopenharmony_ci     * @type { string }
425061847f8eSopenharmony_ci     * @readonly
425161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
425261847f8eSopenharmony_ci     * @crossplatform
425361847f8eSopenharmony_ci     * @atomicservice
425461847f8eSopenharmony_ci     * @since 12
425561847f8eSopenharmony_ci     */
425661847f8eSopenharmony_ci    readonly algName: string;
425761847f8eSopenharmony_ci  }
425861847f8eSopenharmony_ci
425961847f8eSopenharmony_ci  /**
426061847f8eSopenharmony_ci   * Provides the Verify interface, which is used for verifying signatures.
426161847f8eSopenharmony_ci   *
426261847f8eSopenharmony_ci   * @typedef Verify
426361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
426461847f8eSopenharmony_ci   * @since 9
426561847f8eSopenharmony_ci   */
426661847f8eSopenharmony_ci  /**
426761847f8eSopenharmony_ci   * Provides the Verify interface, which is used for verifying signatures.
426861847f8eSopenharmony_ci   *
426961847f8eSopenharmony_ci   * @typedef Verify
427061847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
427161847f8eSopenharmony_ci   * @crossplatform
427261847f8eSopenharmony_ci   * @since 11
427361847f8eSopenharmony_ci   */
427461847f8eSopenharmony_ci  /**
427561847f8eSopenharmony_ci   * Provides the Verify interface, which is used for verifying signatures.
427661847f8eSopenharmony_ci   *
427761847f8eSopenharmony_ci   * @typedef Verify
427861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Signature
427961847f8eSopenharmony_ci   * @crossplatform
428061847f8eSopenharmony_ci   * @atomicservice
428161847f8eSopenharmony_ci   * @since 12
428261847f8eSopenharmony_ci   */
428361847f8eSopenharmony_ci  interface Verify {
428461847f8eSopenharmony_ci    /**
428561847f8eSopenharmony_ci     * Used to init environment.
428661847f8eSopenharmony_ci     *
428761847f8eSopenharmony_ci     * @param { PubKey } pubKey - the public key.
428861847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - return nothing.
428961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
429061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
429161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
429261847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
429361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
429461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
429561847f8eSopenharmony_ci     * @since 9
429661847f8eSopenharmony_ci     */
429761847f8eSopenharmony_ci    /**
429861847f8eSopenharmony_ci     * Used to init environment.
429961847f8eSopenharmony_ci     *
430061847f8eSopenharmony_ci     * @param { PubKey } pubKey - the public key.
430161847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - return nothing.
430261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
430361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
430461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
430561847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
430661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
430761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
430861847f8eSopenharmony_ci     * @crossplatform
430961847f8eSopenharmony_ci     * @since 11
431061847f8eSopenharmony_ci     */
431161847f8eSopenharmony_ci    /**
431261847f8eSopenharmony_ci     * Used to init environment.
431361847f8eSopenharmony_ci     *
431461847f8eSopenharmony_ci     * @param { PubKey } pubKey - the public key.
431561847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - return nothing.
431661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
431761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
431861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
431961847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
432061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
432161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
432261847f8eSopenharmony_ci     * @crossplatform
432361847f8eSopenharmony_ci     * @atomicservice
432461847f8eSopenharmony_ci     * @since 12
432561847f8eSopenharmony_ci     */
432661847f8eSopenharmony_ci    init(pubKey: PubKey, callback: AsyncCallback<void>): void;
432761847f8eSopenharmony_ci
432861847f8eSopenharmony_ci    /**
432961847f8eSopenharmony_ci     * Used to init environment.
433061847f8eSopenharmony_ci     *
433161847f8eSopenharmony_ci     * @param { PubKey } pubKey - the public key.
433261847f8eSopenharmony_ci     * @returns { Promise<void> } return nothing.
433361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
433461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
433561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
433661847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
433761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
433861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
433961847f8eSopenharmony_ci     * @since 9
434061847f8eSopenharmony_ci     */
434161847f8eSopenharmony_ci    /**
434261847f8eSopenharmony_ci     * Used to init environment.
434361847f8eSopenharmony_ci     *
434461847f8eSopenharmony_ci     * @param { PubKey } pubKey - the public key.
434561847f8eSopenharmony_ci     * @returns { Promise<void> } return nothing.
434661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
434761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
434861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
434961847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
435061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
435161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
435261847f8eSopenharmony_ci     * @crossplatform
435361847f8eSopenharmony_ci     * @since 11
435461847f8eSopenharmony_ci     */
435561847f8eSopenharmony_ci    /**
435661847f8eSopenharmony_ci     * Used to init environment.
435761847f8eSopenharmony_ci     *
435861847f8eSopenharmony_ci     * @param { PubKey } pubKey - the public key.
435961847f8eSopenharmony_ci     * @returns { Promise<void> } return nothing.
436061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
436161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
436261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
436361847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
436461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
436561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
436661847f8eSopenharmony_ci     * @crossplatform
436761847f8eSopenharmony_ci     * @atomicservice
436861847f8eSopenharmony_ci     * @since 12
436961847f8eSopenharmony_ci     */
437061847f8eSopenharmony_ci    init(pubKey: PubKey): Promise<void>;
437161847f8eSopenharmony_ci
437261847f8eSopenharmony_ci    /**
437361847f8eSopenharmony_ci     * Used to init environment.
437461847f8eSopenharmony_ci     *
437561847f8eSopenharmony_ci     * @param { PubKey } pubKey - the public key.
437661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
437761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
437861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
437961847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
438061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
438161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
438261847f8eSopenharmony_ci     * @crossplatform
438361847f8eSopenharmony_ci     * @atomicservice
438461847f8eSopenharmony_ci     * @since 12
438561847f8eSopenharmony_ci     */
438661847f8eSopenharmony_ci    initSync(pubKey: PubKey): void;
438761847f8eSopenharmony_ci
438861847f8eSopenharmony_ci    /**
438961847f8eSopenharmony_ci     * Used to append the message need to be verified.
439061847f8eSopenharmony_ci     *
439161847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be verified.
439261847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - return nothing.
439361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
439461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
439561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
439661847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
439761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
439861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
439961847f8eSopenharmony_ci     * @since 9
440061847f8eSopenharmony_ci     */
440161847f8eSopenharmony_ci    /**
440261847f8eSopenharmony_ci     * Used to append the message need to be verified.
440361847f8eSopenharmony_ci     *
440461847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be verified.
440561847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - return nothing.
440661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
440761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
440861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
440961847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
441061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
441161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
441261847f8eSopenharmony_ci     * @crossplatform
441361847f8eSopenharmony_ci     * @since 11
441461847f8eSopenharmony_ci     */
441561847f8eSopenharmony_ci    /**
441661847f8eSopenharmony_ci     * Used to append the message need to be verified.
441761847f8eSopenharmony_ci     *
441861847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be verified.
441961847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - return nothing.
442061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
442161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
442261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
442361847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
442461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
442561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
442661847f8eSopenharmony_ci     * @crossplatform
442761847f8eSopenharmony_ci     * @atomicservice
442861847f8eSopenharmony_ci     * @since 12
442961847f8eSopenharmony_ci     */
443061847f8eSopenharmony_ci    update(data: DataBlob, callback: AsyncCallback<void>): void;
443161847f8eSopenharmony_ci
443261847f8eSopenharmony_ci    /**
443361847f8eSopenharmony_ci     * Used to append the message need to be verified.
443461847f8eSopenharmony_ci     *
443561847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be verified.
443661847f8eSopenharmony_ci     * @returns { Promise<void> } return nothing.
443761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
443861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
443961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
444061847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
444161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
444261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
444361847f8eSopenharmony_ci     * @since 9
444461847f8eSopenharmony_ci     */
444561847f8eSopenharmony_ci    /**
444661847f8eSopenharmony_ci     * Used to append the message need to be verified.
444761847f8eSopenharmony_ci     *
444861847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be verified.
444961847f8eSopenharmony_ci     * @returns { Promise<void> } return nothing.
445061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
445161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
445261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
445361847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
445461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
445561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
445661847f8eSopenharmony_ci     * @crossplatform
445761847f8eSopenharmony_ci     * @since 11
445861847f8eSopenharmony_ci     */
445961847f8eSopenharmony_ci    /**
446061847f8eSopenharmony_ci     * Used to append the message need to be verified.
446161847f8eSopenharmony_ci     *
446261847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be verified.
446361847f8eSopenharmony_ci     * @returns { Promise<void> } return nothing.
446461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
446561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
446661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
446761847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
446861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
446961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
447061847f8eSopenharmony_ci     * @crossplatform
447161847f8eSopenharmony_ci     * @atomicservice
447261847f8eSopenharmony_ci     * @since 12
447361847f8eSopenharmony_ci     */
447461847f8eSopenharmony_ci    update(data: DataBlob): Promise<void>;
447561847f8eSopenharmony_ci
447661847f8eSopenharmony_ci    /**
447761847f8eSopenharmony_ci     * Used to append the message need to be verified.
447861847f8eSopenharmony_ci     *
447961847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be verified.
448061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
448161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
448261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
448361847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
448461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
448561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
448661847f8eSopenharmony_ci     * @crossplatform
448761847f8eSopenharmony_ci     * @atomicservice
448861847f8eSopenharmony_ci     * @since 12
448961847f8eSopenharmony_ci     */
449061847f8eSopenharmony_ci    updateSync(data: DataBlob): void;
449161847f8eSopenharmony_ci
449261847f8eSopenharmony_ci    /**
449361847f8eSopenharmony_ci     * Used to verify message, include the update data.
449461847f8eSopenharmony_ci     *
449561847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be verified.
449661847f8eSopenharmony_ci     * @param { DataBlob } signatureData - the signature data.
449761847f8eSopenharmony_ci     * @param { AsyncCallback<boolean> } callback - return the verify result.
449861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
449961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
450061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
450161847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
450261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
450361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
450461847f8eSopenharmony_ci     * @since 9
450561847f8eSopenharmony_ci     */
450661847f8eSopenharmony_ci    /**
450761847f8eSopenharmony_ci     * Used to verify message, include the update data.
450861847f8eSopenharmony_ci     *
450961847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be verified.
451061847f8eSopenharmony_ci     * @param { DataBlob } signatureData - the signature data.
451161847f8eSopenharmony_ci     * @param { AsyncCallback<boolean> } callback - return the verify result.
451261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
451361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
451461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
451561847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
451661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
451761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
451861847f8eSopenharmony_ci     * @crossplatform
451961847f8eSopenharmony_ci     * @since 11
452061847f8eSopenharmony_ci     */
452161847f8eSopenharmony_ci    /**
452261847f8eSopenharmony_ci     * Used to verify message, include the update data.
452361847f8eSopenharmony_ci     *
452461847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be verified.
452561847f8eSopenharmony_ci     * @param { DataBlob } signatureData - the signature data.
452661847f8eSopenharmony_ci     * @param { AsyncCallback<boolean> } callback - return the verify result.
452761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
452861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
452961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
453061847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
453161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
453261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
453361847f8eSopenharmony_ci     * @crossplatform
453461847f8eSopenharmony_ci     * @atomicservice
453561847f8eSopenharmony_ci     * @since 12
453661847f8eSopenharmony_ci     */
453761847f8eSopenharmony_ci    verify(data: DataBlob, signatureData: DataBlob, callback: AsyncCallback<boolean>): void;
453861847f8eSopenharmony_ci
453961847f8eSopenharmony_ci    /**
454061847f8eSopenharmony_ci     * Used to verify message, include the update data.
454161847f8eSopenharmony_ci     *
454261847f8eSopenharmony_ci     * @param { DataBlob | null } data - the data need to be verified.
454361847f8eSopenharmony_ci     * @param { DataBlob } signatureData - the signature data.
454461847f8eSopenharmony_ci     * @param { AsyncCallback<boolean> } callback - return the verify result.
454561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
454661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
454761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
454861847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
454961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
455061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
455161847f8eSopenharmony_ci     * @since 10
455261847f8eSopenharmony_ci     */
455361847f8eSopenharmony_ci    /**
455461847f8eSopenharmony_ci     * Used to verify message, include the update data.
455561847f8eSopenharmony_ci     *
455661847f8eSopenharmony_ci     * @param { DataBlob | null } data - the data need to be verified.
455761847f8eSopenharmony_ci     * @param { DataBlob } signatureData - the signature data.
455861847f8eSopenharmony_ci     * @param { AsyncCallback<boolean> } callback - return the verify result.
455961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
456061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
456161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
456261847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
456361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
456461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
456561847f8eSopenharmony_ci     * @crossplatform
456661847f8eSopenharmony_ci     * @since 11
456761847f8eSopenharmony_ci     */
456861847f8eSopenharmony_ci    /**
456961847f8eSopenharmony_ci     * Used to verify message, include the update data.
457061847f8eSopenharmony_ci     *
457161847f8eSopenharmony_ci     * @param { DataBlob | null } data - the data need to be verified.
457261847f8eSopenharmony_ci     * @param { DataBlob } signatureData - the signature data.
457361847f8eSopenharmony_ci     * @param { AsyncCallback<boolean> } callback - return the verify result.
457461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
457561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
457661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
457761847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
457861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
457961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
458061847f8eSopenharmony_ci     * @crossplatform
458161847f8eSopenharmony_ci     * @atomicservice
458261847f8eSopenharmony_ci     * @since 12
458361847f8eSopenharmony_ci     */
458461847f8eSopenharmony_ci    verify(data: DataBlob | null, signatureData: DataBlob, callback: AsyncCallback<boolean>): void;
458561847f8eSopenharmony_ci
458661847f8eSopenharmony_ci    /**
458761847f8eSopenharmony_ci     * Used to verify message, include the update data.
458861847f8eSopenharmony_ci     *
458961847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be verified.
459061847f8eSopenharmony_ci     * @param { DataBlob } signatureData - the signature data.
459161847f8eSopenharmony_ci     * @returns { Promise<boolean> } return the verify result.
459261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
459361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
459461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
459561847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
459661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
459761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
459861847f8eSopenharmony_ci     * @since 9
459961847f8eSopenharmony_ci     */
460061847f8eSopenharmony_ci    /**
460161847f8eSopenharmony_ci     * Used to verify message, include the update data.
460261847f8eSopenharmony_ci     *
460361847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be verified.
460461847f8eSopenharmony_ci     * @param { DataBlob } signatureData - the signature data.
460561847f8eSopenharmony_ci     * @returns { Promise<boolean> } return the verify result.
460661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
460761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
460861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
460961847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
461061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
461161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
461261847f8eSopenharmony_ci     * @crossplatform
461361847f8eSopenharmony_ci     * @since 11
461461847f8eSopenharmony_ci     */
461561847f8eSopenharmony_ci    /**
461661847f8eSopenharmony_ci     * Used to verify message, include the update data.
461761847f8eSopenharmony_ci     *
461861847f8eSopenharmony_ci     * @param { DataBlob } data - the data need to be verified.
461961847f8eSopenharmony_ci     * @param { DataBlob } signatureData - the signature data.
462061847f8eSopenharmony_ci     * @returns { Promise<boolean> } return the verify result.
462161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
462261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
462361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
462461847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
462561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
462661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
462761847f8eSopenharmony_ci     * @crossplatform
462861847f8eSopenharmony_ci     * @atomicservice
462961847f8eSopenharmony_ci     * @since 12
463061847f8eSopenharmony_ci     */
463161847f8eSopenharmony_ci    verify(data: DataBlob, signatureData: DataBlob): Promise<boolean>;
463261847f8eSopenharmony_ci
463361847f8eSopenharmony_ci    /**
463461847f8eSopenharmony_ci     * Used to verify message, include the update data.
463561847f8eSopenharmony_ci     *
463661847f8eSopenharmony_ci     * @param { DataBlob | null } data - the data need to be verified.
463761847f8eSopenharmony_ci     * @param { DataBlob } signatureData - the signature data.
463861847f8eSopenharmony_ci     * @returns { Promise<boolean> } return the verify result.
463961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
464061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
464161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
464261847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
464361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
464461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
464561847f8eSopenharmony_ci     * @since 10
464661847f8eSopenharmony_ci     */
464761847f8eSopenharmony_ci    /**
464861847f8eSopenharmony_ci     * Used to verify message, include the update data.
464961847f8eSopenharmony_ci     *
465061847f8eSopenharmony_ci     * @param { DataBlob | null } data - the data need to be verified.
465161847f8eSopenharmony_ci     * @param { DataBlob } signatureData - the signature data.
465261847f8eSopenharmony_ci     * @returns { Promise<boolean> } return the verify result.
465361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
465461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
465561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
465661847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
465761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
465861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
465961847f8eSopenharmony_ci     * @crossplatform
466061847f8eSopenharmony_ci     * @since 11
466161847f8eSopenharmony_ci     */
466261847f8eSopenharmony_ci    /**
466361847f8eSopenharmony_ci     * Used to verify message, include the update data.
466461847f8eSopenharmony_ci     *
466561847f8eSopenharmony_ci     * @param { DataBlob | null } data - the data need to be verified.
466661847f8eSopenharmony_ci     * @param { DataBlob } signatureData - the signature data.
466761847f8eSopenharmony_ci     * @returns { Promise<boolean> } return the verify result.
466861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
466961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
467061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
467161847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
467261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
467361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
467461847f8eSopenharmony_ci     * @crossplatform
467561847f8eSopenharmony_ci     * @atomicservice
467661847f8eSopenharmony_ci     * @since 12
467761847f8eSopenharmony_ci     */
467861847f8eSopenharmony_ci    verify(data: DataBlob | null, signatureData: DataBlob): Promise<boolean>;
467961847f8eSopenharmony_ci
468061847f8eSopenharmony_ci    /**
468161847f8eSopenharmony_ci     * Used to verify message, include the update data.
468261847f8eSopenharmony_ci     *
468361847f8eSopenharmony_ci     * @param { DataBlob | null } data - the data need to be verified.
468461847f8eSopenharmony_ci     * @param { DataBlob } signatureData - the signature data.
468561847f8eSopenharmony_ci     * @returns { boolean } return the verify result.
468661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
468761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
468861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
468961847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
469061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
469161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
469261847f8eSopenharmony_ci     * @crossplatform
469361847f8eSopenharmony_ci     * @atomicservice
469461847f8eSopenharmony_ci     * @since 12
469561847f8eSopenharmony_ci     */
469661847f8eSopenharmony_ci    verifySync(data: DataBlob | null, signatureData: DataBlob): boolean;
469761847f8eSopenharmony_ci
469861847f8eSopenharmony_ci    /**
469961847f8eSopenharmony_ci     * Used to recover signed data.
470061847f8eSopenharmony_ci     * Currently, only RSA is supported.
470161847f8eSopenharmony_ci     *
470261847f8eSopenharmony_ci     * @param { DataBlob } signatureData - the signature data.
470361847f8eSopenharmony_ci     * @returns { Promise<DataBlob | null> } the promise used to return the recovered data.
470461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
470561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
470661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
470761847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
470861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
470961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
471061847f8eSopenharmony_ci     * @crossplatform
471161847f8eSopenharmony_ci     * @atomicservice
471261847f8eSopenharmony_ci     * @since 12
471361847f8eSopenharmony_ci     */
471461847f8eSopenharmony_ci    recover(signatureData: DataBlob): Promise<DataBlob | null>;
471561847f8eSopenharmony_ci
471661847f8eSopenharmony_ci    /**
471761847f8eSopenharmony_ci     * Used to recover signed data.
471861847f8eSopenharmony_ci     * Currently, only RSA is supported.
471961847f8eSopenharmony_ci     *
472061847f8eSopenharmony_ci     * @param { DataBlob } signatureData - the signature data.
472161847f8eSopenharmony_ci     * @returns { DataBlob | null } return the recovered data.
472261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
472361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
472461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
472561847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
472661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
472761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
472861847f8eSopenharmony_ci     * @crossplatform
472961847f8eSopenharmony_ci     * @atomicservice
473061847f8eSopenharmony_ci     * @since 12
473161847f8eSopenharmony_ci     */
473261847f8eSopenharmony_ci    recoverSync(signatureData: DataBlob): DataBlob | null;
473361847f8eSopenharmony_ci
473461847f8eSopenharmony_ci    /**
473561847f8eSopenharmony_ci     * Set the specified parameter to the verify object.
473661847f8eSopenharmony_ci     * Currently, only the PSS_SALT_LEN parameter in RSA is supported.
473761847f8eSopenharmony_ci     *
473861847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
473961847f8eSopenharmony_ci     * @param { number } itemValue - the value of the specified parameter.
474061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
474161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
474261847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
474361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
474461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
474561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
474661847f8eSopenharmony_ci     * @since 10
474761847f8eSopenharmony_ci     */
474861847f8eSopenharmony_ci    /**
474961847f8eSopenharmony_ci     * Set the specified parameter to the verify object.
475061847f8eSopenharmony_ci     * Currently, only the PSS_SALT_LEN parameter in RSA is supported.
475161847f8eSopenharmony_ci     *
475261847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
475361847f8eSopenharmony_ci     * @param { number } itemValue - the value of the specified parameter.
475461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
475561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
475661847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
475761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
475861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
475961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
476061847f8eSopenharmony_ci     * @crossplatform
476161847f8eSopenharmony_ci     * @since 11
476261847f8eSopenharmony_ci     */
476361847f8eSopenharmony_ci    /**
476461847f8eSopenharmony_ci     * Set the specified parameter to the verify object.
476561847f8eSopenharmony_ci     * Currently, only the PSS_SALT_LEN parameter in RSA is supported.
476661847f8eSopenharmony_ci     *
476761847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
476861847f8eSopenharmony_ci     * @param { number } itemValue - the value of the specified parameter.
476961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
477061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
477161847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
477261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
477361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
477461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
477561847f8eSopenharmony_ci     * @crossplatform
477661847f8eSopenharmony_ci     * @atomicservice
477761847f8eSopenharmony_ci     * @since 12
477861847f8eSopenharmony_ci     */
477961847f8eSopenharmony_ci    setVerifySpec(itemType: SignSpecItem, itemValue: number): void;
478061847f8eSopenharmony_ci
478161847f8eSopenharmony_ci    /**
478261847f8eSopenharmony_ci     * Set the specified parameter to the verify object.
478361847f8eSopenharmony_ci     * Currently, only PSS_SALT_LEN in RSA and USER_ID in SM2 are supported.
478461847f8eSopenharmony_ci     *
478561847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
478661847f8eSopenharmony_ci     * @param { number | Uint8Array } itemValue - the value of the specified parameter.
478761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
478861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
478961847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
479061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
479161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
479261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
479361847f8eSopenharmony_ci     * @crossplatform
479461847f8eSopenharmony_ci     * @since 11
479561847f8eSopenharmony_ci     */
479661847f8eSopenharmony_ci    /**
479761847f8eSopenharmony_ci     * Set the specified parameter to the verify object.
479861847f8eSopenharmony_ci     * Currently, only PSS_SALT_LEN in RSA and USER_ID in SM2 are supported.
479961847f8eSopenharmony_ci     *
480061847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
480161847f8eSopenharmony_ci     * @param { number | Uint8Array } itemValue - the value of the specified parameter.
480261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
480361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
480461847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
480561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
480661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
480761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
480861847f8eSopenharmony_ci     * @crossplatform
480961847f8eSopenharmony_ci     * @atomicservice
481061847f8eSopenharmony_ci     * @since 12
481161847f8eSopenharmony_ci     */
481261847f8eSopenharmony_ci    setVerifySpec(itemType: SignSpecItem, itemValue: number | Uint8Array): void;
481361847f8eSopenharmony_ci
481461847f8eSopenharmony_ci    /**
481561847f8eSopenharmony_ci     * Get the specified parameter from the verify object.
481661847f8eSopenharmony_ci     * Currently, only PSS parameters in RSA is supported.
481761847f8eSopenharmony_ci     *
481861847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
481961847f8eSopenharmony_ci     * @returns { string | number } the value of the specified parameter.
482061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
482161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
482261847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
482361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
482461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
482561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
482661847f8eSopenharmony_ci     * @since 10
482761847f8eSopenharmony_ci     */
482861847f8eSopenharmony_ci    /**
482961847f8eSopenharmony_ci     * Get the specified parameter from the verify object.
483061847f8eSopenharmony_ci     * Currently, only PSS parameters in RSA is supported.
483161847f8eSopenharmony_ci     *
483261847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
483361847f8eSopenharmony_ci     * @returns { string | number } the value of the specified parameter.
483461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
483561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
483661847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
483761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
483861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
483961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
484061847f8eSopenharmony_ci     * @crossplatform
484161847f8eSopenharmony_ci     * @since 11
484261847f8eSopenharmony_ci     */
484361847f8eSopenharmony_ci    /**
484461847f8eSopenharmony_ci     * Get the specified parameter from the verify object.
484561847f8eSopenharmony_ci     * Currently, only PSS parameters in RSA is supported.
484661847f8eSopenharmony_ci     *
484761847f8eSopenharmony_ci     * @param { SignSpecItem } itemType - indicates the specified parameter type.
484861847f8eSopenharmony_ci     * @returns { string | number } the value of the specified parameter.
484961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
485061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
485161847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
485261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
485361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
485461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
485561847f8eSopenharmony_ci     * @crossplatform
485661847f8eSopenharmony_ci     * @atomicservice
485761847f8eSopenharmony_ci     * @since 12
485861847f8eSopenharmony_ci     */
485961847f8eSopenharmony_ci    getVerifySpec(itemType: SignSpecItem): string | number;
486061847f8eSopenharmony_ci
486161847f8eSopenharmony_ci    /**
486261847f8eSopenharmony_ci     * Indicates the algorithm name of the verify object.
486361847f8eSopenharmony_ci     *
486461847f8eSopenharmony_ci     * @type { string }
486561847f8eSopenharmony_ci     * @readonly
486661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
486761847f8eSopenharmony_ci     * @since 9
486861847f8eSopenharmony_ci     */
486961847f8eSopenharmony_ci    /**
487061847f8eSopenharmony_ci     * Indicates the algorithm name of the verify object.
487161847f8eSopenharmony_ci     *
487261847f8eSopenharmony_ci     * @type { string }
487361847f8eSopenharmony_ci     * @readonly
487461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
487561847f8eSopenharmony_ci     * @crossplatform
487661847f8eSopenharmony_ci     * @since 11
487761847f8eSopenharmony_ci     */
487861847f8eSopenharmony_ci    /**
487961847f8eSopenharmony_ci     * Indicates the algorithm name of the verify object.
488061847f8eSopenharmony_ci     *
488161847f8eSopenharmony_ci     * @type { string }
488261847f8eSopenharmony_ci     * @readonly
488361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Signature
488461847f8eSopenharmony_ci     * @crossplatform
488561847f8eSopenharmony_ci     * @atomicservice
488661847f8eSopenharmony_ci     * @since 12
488761847f8eSopenharmony_ci     */
488861847f8eSopenharmony_ci    readonly algName: string;
488961847f8eSopenharmony_ci  }
489061847f8eSopenharmony_ci
489161847f8eSopenharmony_ci  /**
489261847f8eSopenharmony_ci   * Create a sign object for generating signatures.
489361847f8eSopenharmony_ci   *
489461847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name and params.
489561847f8eSopenharmony_ci   * @returns { Sign } the sign class.
489661847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
489761847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
489861847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
489961847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
490061847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
490161847f8eSopenharmony_ci   * @since 9
490261847f8eSopenharmony_ci   */
490361847f8eSopenharmony_ci  /**
490461847f8eSopenharmony_ci   * Create a sign object for generating signatures.
490561847f8eSopenharmony_ci   *
490661847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name and params.
490761847f8eSopenharmony_ci   * @returns { Sign } the sign class.
490861847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
490961847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
491061847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
491161847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
491261847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
491361847f8eSopenharmony_ci   * @crossplatform
491461847f8eSopenharmony_ci   * @since 11
491561847f8eSopenharmony_ci   */
491661847f8eSopenharmony_ci  /**
491761847f8eSopenharmony_ci   * Create a sign object for generating signatures.
491861847f8eSopenharmony_ci   *
491961847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name and params. Multiple parameters need to be concatenated by "|".
492061847f8eSopenharmony_ci   * @returns { Sign } the sign class.
492161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
492261847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
492361847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
492461847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
492561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Signature
492661847f8eSopenharmony_ci   * @crossplatform
492761847f8eSopenharmony_ci   * @atomicservice
492861847f8eSopenharmony_ci   * @since 12
492961847f8eSopenharmony_ci   */
493061847f8eSopenharmony_ci  function createSign(algName: string): Sign;
493161847f8eSopenharmony_ci
493261847f8eSopenharmony_ci  /**
493361847f8eSopenharmony_ci   * Create a verify object for verifying signatures.
493461847f8eSopenharmony_ci   *
493561847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name and the parameters.
493661847f8eSopenharmony_ci   * @returns { Verify } the verify class.
493761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
493861847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
493961847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
494061847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
494161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
494261847f8eSopenharmony_ci   * @since 9
494361847f8eSopenharmony_ci   */
494461847f8eSopenharmony_ci  /**
494561847f8eSopenharmony_ci   * Create a verify object for verifying signatures.
494661847f8eSopenharmony_ci   *
494761847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name and the parameters.
494861847f8eSopenharmony_ci   * @returns { Verify } the verify class.
494961847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
495061847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
495161847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
495261847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
495361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
495461847f8eSopenharmony_ci   * @crossplatform
495561847f8eSopenharmony_ci   * @since 11
495661847f8eSopenharmony_ci   */
495761847f8eSopenharmony_ci  /**
495861847f8eSopenharmony_ci   * Create a verify object for verifying signatures.
495961847f8eSopenharmony_ci   *
496061847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name and the parameters. Multiple parameters need to be concatenated by "|".
496161847f8eSopenharmony_ci   * @returns { Verify } the verify class.
496261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
496361847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
496461847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
496561847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
496661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Signature
496761847f8eSopenharmony_ci   * @crossplatform
496861847f8eSopenharmony_ci   * @atomicservice
496961847f8eSopenharmony_ci   * @since 12
497061847f8eSopenharmony_ci   */
497161847f8eSopenharmony_ci  function createVerify(algName: string): Verify;
497261847f8eSopenharmony_ci
497361847f8eSopenharmony_ci  /**
497461847f8eSopenharmony_ci   * Provides key agreement function.
497561847f8eSopenharmony_ci   *
497661847f8eSopenharmony_ci   * @typedef KeyAgreement
497761847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
497861847f8eSopenharmony_ci   * @since 9
497961847f8eSopenharmony_ci   */
498061847f8eSopenharmony_ci  /**
498161847f8eSopenharmony_ci   * Provides key agreement function.
498261847f8eSopenharmony_ci   *
498361847f8eSopenharmony_ci   * @typedef KeyAgreement
498461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
498561847f8eSopenharmony_ci   * @crossplatform
498661847f8eSopenharmony_ci   * @since 11
498761847f8eSopenharmony_ci   */
498861847f8eSopenharmony_ci  /**
498961847f8eSopenharmony_ci   * Provides key agreement function.
499061847f8eSopenharmony_ci   *
499161847f8eSopenharmony_ci   * @typedef KeyAgreement
499261847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.KeyAgreement
499361847f8eSopenharmony_ci   * @crossplatform
499461847f8eSopenharmony_ci   * @atomicservice
499561847f8eSopenharmony_ci   * @since 12
499661847f8eSopenharmony_ci   */
499761847f8eSopenharmony_ci  interface KeyAgreement {
499861847f8eSopenharmony_ci    /**
499961847f8eSopenharmony_ci     * Used to generate secret.
500061847f8eSopenharmony_ci     *
500161847f8eSopenharmony_ci     * @param { PriKey } priKey - the private key.
500261847f8eSopenharmony_ci     * @param { PubKey } pubKey - the public key.
500361847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - return the secret.
500461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
500561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
500661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
500761847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
500861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
500961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
501061847f8eSopenharmony_ci     * @since 9
501161847f8eSopenharmony_ci     */
501261847f8eSopenharmony_ci    /**
501361847f8eSopenharmony_ci     * Used to generate secret.
501461847f8eSopenharmony_ci     *
501561847f8eSopenharmony_ci     * @param { PriKey } priKey - the private key.
501661847f8eSopenharmony_ci     * @param { PubKey } pubKey - the public key.
501761847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - return the secret.
501861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
501961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
502061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
502161847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
502261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
502361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
502461847f8eSopenharmony_ci     * @crossplatform
502561847f8eSopenharmony_ci     * @since 11
502661847f8eSopenharmony_ci     */
502761847f8eSopenharmony_ci    /**
502861847f8eSopenharmony_ci     * Used to generate secret.
502961847f8eSopenharmony_ci     *
503061847f8eSopenharmony_ci     * @param { PriKey } priKey - the private key.
503161847f8eSopenharmony_ci     * @param { PubKey } pubKey - the public key.
503261847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - return the secret.
503361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
503461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
503561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
503661847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
503761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
503861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.KeyAgreement
503961847f8eSopenharmony_ci     * @crossplatform
504061847f8eSopenharmony_ci     * @atomicservice
504161847f8eSopenharmony_ci     * @since 12
504261847f8eSopenharmony_ci     */
504361847f8eSopenharmony_ci    generateSecret(priKey: PriKey, pubKey: PubKey, callback: AsyncCallback<DataBlob>): void;
504461847f8eSopenharmony_ci
504561847f8eSopenharmony_ci    /**
504661847f8eSopenharmony_ci     * Used to generate secret.
504761847f8eSopenharmony_ci     *
504861847f8eSopenharmony_ci     * @param { PriKey } priKey - the private key.
504961847f8eSopenharmony_ci     * @param { PubKey } pubKey - the public key.
505061847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise used to return secret.
505161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
505261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
505361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
505461847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
505561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
505661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
505761847f8eSopenharmony_ci     * @since 9
505861847f8eSopenharmony_ci     */
505961847f8eSopenharmony_ci    /**
506061847f8eSopenharmony_ci     * Used to generate secret.
506161847f8eSopenharmony_ci     *
506261847f8eSopenharmony_ci     * @param { PriKey } priKey - the private key.
506361847f8eSopenharmony_ci     * @param { PubKey } pubKey - the public key.
506461847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise used to return secret.
506561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
506661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
506761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
506861847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
506961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
507061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
507161847f8eSopenharmony_ci     * @crossplatform
507261847f8eSopenharmony_ci     * @since 11
507361847f8eSopenharmony_ci     */
507461847f8eSopenharmony_ci    /**
507561847f8eSopenharmony_ci     * Used to generate secret.
507661847f8eSopenharmony_ci     *
507761847f8eSopenharmony_ci     * @param { PriKey } priKey - the private key.
507861847f8eSopenharmony_ci     * @param { PubKey } pubKey - the public key.
507961847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise used to return secret.
508061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
508161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
508261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
508361847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
508461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
508561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.KeyAgreement
508661847f8eSopenharmony_ci     * @crossplatform
508761847f8eSopenharmony_ci     * @atomicservice
508861847f8eSopenharmony_ci     * @since 12
508961847f8eSopenharmony_ci     */
509061847f8eSopenharmony_ci    generateSecret(priKey: PriKey, pubKey: PubKey): Promise<DataBlob>;
509161847f8eSopenharmony_ci
509261847f8eSopenharmony_ci    /**
509361847f8eSopenharmony_ci     * Used to generate secret.
509461847f8eSopenharmony_ci     *
509561847f8eSopenharmony_ci     * @param { PriKey } priKey - the private key.
509661847f8eSopenharmony_ci     * @param { PubKey } pubKey - the public key.
509761847f8eSopenharmony_ci     * @returns { DataBlob } the promise used to return secret.
509861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
509961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
510061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
510161847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
510261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
510361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.KeyAgreement
510461847f8eSopenharmony_ci     * @crossplatform
510561847f8eSopenharmony_ci     * @atomicservice
510661847f8eSopenharmony_ci     * @since 12
510761847f8eSopenharmony_ci     */
510861847f8eSopenharmony_ci    generateSecretSync(priKey: PriKey, pubKey: PubKey): DataBlob;
510961847f8eSopenharmony_ci
511061847f8eSopenharmony_ci    /**
511161847f8eSopenharmony_ci     * Indicates the algorithm name.
511261847f8eSopenharmony_ci     *
511361847f8eSopenharmony_ci     * @type { string }
511461847f8eSopenharmony_ci     * @readonly
511561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
511661847f8eSopenharmony_ci     * @since 9
511761847f8eSopenharmony_ci     */
511861847f8eSopenharmony_ci    /**
511961847f8eSopenharmony_ci     * Indicates the algorithm name.
512061847f8eSopenharmony_ci     *
512161847f8eSopenharmony_ci     * @type { string }
512261847f8eSopenharmony_ci     * @readonly
512361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
512461847f8eSopenharmony_ci     * @crossplatform
512561847f8eSopenharmony_ci     * @since 11
512661847f8eSopenharmony_ci     */
512761847f8eSopenharmony_ci    /**
512861847f8eSopenharmony_ci     * Indicates the algorithm name.
512961847f8eSopenharmony_ci     *
513061847f8eSopenharmony_ci     * @type { string }
513161847f8eSopenharmony_ci     * @readonly
513261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.KeyAgreement
513361847f8eSopenharmony_ci     * @crossplatform
513461847f8eSopenharmony_ci     * @atomicservice
513561847f8eSopenharmony_ci     * @since 12
513661847f8eSopenharmony_ci     */
513761847f8eSopenharmony_ci    readonly algName: string;
513861847f8eSopenharmony_ci  }
513961847f8eSopenharmony_ci
514061847f8eSopenharmony_ci  /**
514161847f8eSopenharmony_ci   * Create a key agreement object.
514261847f8eSopenharmony_ci   *
514361847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name and params.
514461847f8eSopenharmony_ci   * @returns { KeyAgreement } the key agreement object.
514561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
514661847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
514761847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
514861847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
514961847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
515061847f8eSopenharmony_ci   * @since 9
515161847f8eSopenharmony_ci   */
515261847f8eSopenharmony_ci  /**
515361847f8eSopenharmony_ci   * Create a key agreement object.
515461847f8eSopenharmony_ci   *
515561847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name and params.
515661847f8eSopenharmony_ci   * @returns { KeyAgreement } the key agreement object.
515761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
515861847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
515961847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
516061847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
516161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
516261847f8eSopenharmony_ci   * @crossplatform
516361847f8eSopenharmony_ci   * @since 11
516461847f8eSopenharmony_ci   */
516561847f8eSopenharmony_ci  /**
516661847f8eSopenharmony_ci   * Create a key agreement object.
516761847f8eSopenharmony_ci   *
516861847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name and params. Multiple parameters need to be concatenated by "|".
516961847f8eSopenharmony_ci   * @returns { KeyAgreement } the key agreement object.
517061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
517161847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
517261847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
517361847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
517461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.KeyAgreement
517561847f8eSopenharmony_ci   * @crossplatform
517661847f8eSopenharmony_ci   * @atomicservice
517761847f8eSopenharmony_ci   * @since 12
517861847f8eSopenharmony_ci   */
517961847f8eSopenharmony_ci  function createKeyAgreement(algName: string): KeyAgreement;
518061847f8eSopenharmony_ci
518161847f8eSopenharmony_ci  /**
518261847f8eSopenharmony_ci   * Enum for algorithm specified parameters.
518361847f8eSopenharmony_ci   *
518461847f8eSopenharmony_ci   * @enum { number }
518561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
518661847f8eSopenharmony_ci   * @since 10
518761847f8eSopenharmony_ci   */
518861847f8eSopenharmony_ci  /**
518961847f8eSopenharmony_ci   * Enum for algorithm specified parameters.
519061847f8eSopenharmony_ci   *
519161847f8eSopenharmony_ci   * @enum { number }
519261847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
519361847f8eSopenharmony_ci   * @crossplatform
519461847f8eSopenharmony_ci   * @since 11
519561847f8eSopenharmony_ci   */
519661847f8eSopenharmony_ci  /**
519761847f8eSopenharmony_ci   * Enum for algorithm specified parameters.
519861847f8eSopenharmony_ci   *
519961847f8eSopenharmony_ci   * @enum { number }
520061847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
520161847f8eSopenharmony_ci   * @crossplatform
520261847f8eSopenharmony_ci   * @atomicservice
520361847f8eSopenharmony_ci   * @since 12
520461847f8eSopenharmony_ci   */
520561847f8eSopenharmony_ci  enum AsyKeySpecItem {
520661847f8eSopenharmony_ci    /**
520761847f8eSopenharmony_ci     * Indicates the DSA prime p.
520861847f8eSopenharmony_ci     *
520961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
521061847f8eSopenharmony_ci     * @since 10
521161847f8eSopenharmony_ci     */
521261847f8eSopenharmony_ci    /**
521361847f8eSopenharmony_ci     * Indicates the DSA prime p.
521461847f8eSopenharmony_ci     *
521561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
521661847f8eSopenharmony_ci     * @crossplatform
521761847f8eSopenharmony_ci     * @since 11
521861847f8eSopenharmony_ci     */
521961847f8eSopenharmony_ci    /**
522061847f8eSopenharmony_ci     * Indicates the DSA prime p.
522161847f8eSopenharmony_ci     *
522261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
522361847f8eSopenharmony_ci     * @crossplatform
522461847f8eSopenharmony_ci     * @atomicservice
522561847f8eSopenharmony_ci     * @since 12
522661847f8eSopenharmony_ci     */
522761847f8eSopenharmony_ci    DSA_P_BN = 101,
522861847f8eSopenharmony_ci
522961847f8eSopenharmony_ci    /**
523061847f8eSopenharmony_ci     * Indicates the DSA sub-prime q.
523161847f8eSopenharmony_ci     *
523261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
523361847f8eSopenharmony_ci     * @since 10
523461847f8eSopenharmony_ci     */
523561847f8eSopenharmony_ci    /**
523661847f8eSopenharmony_ci     * Indicates the DSA sub-prime q.
523761847f8eSopenharmony_ci     *
523861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
523961847f8eSopenharmony_ci     * @crossplatform
524061847f8eSopenharmony_ci     * @since 11
524161847f8eSopenharmony_ci     */
524261847f8eSopenharmony_ci    /**
524361847f8eSopenharmony_ci     * Indicates the DSA sub-prime q.
524461847f8eSopenharmony_ci     *
524561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
524661847f8eSopenharmony_ci     * @crossplatform
524761847f8eSopenharmony_ci     * @atomicservice
524861847f8eSopenharmony_ci     * @since 12
524961847f8eSopenharmony_ci     */
525061847f8eSopenharmony_ci    DSA_Q_BN = 102,
525161847f8eSopenharmony_ci
525261847f8eSopenharmony_ci    /**
525361847f8eSopenharmony_ci     * Indicates the DSA base g.
525461847f8eSopenharmony_ci     *
525561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
525661847f8eSopenharmony_ci     * @since 10
525761847f8eSopenharmony_ci     */
525861847f8eSopenharmony_ci    /**
525961847f8eSopenharmony_ci     * Indicates the DSA base g.
526061847f8eSopenharmony_ci     *
526161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
526261847f8eSopenharmony_ci     * @crossplatform
526361847f8eSopenharmony_ci     * @since 11
526461847f8eSopenharmony_ci     */
526561847f8eSopenharmony_ci    /**
526661847f8eSopenharmony_ci     * Indicates the DSA base g.
526761847f8eSopenharmony_ci     *
526861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
526961847f8eSopenharmony_ci     * @crossplatform
527061847f8eSopenharmony_ci     * @atomicservice
527161847f8eSopenharmony_ci     * @since 12
527261847f8eSopenharmony_ci     */
527361847f8eSopenharmony_ci    DSA_G_BN = 103,
527461847f8eSopenharmony_ci
527561847f8eSopenharmony_ci    /**
527661847f8eSopenharmony_ci     * Indicates the DSA private key.
527761847f8eSopenharmony_ci     *
527861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
527961847f8eSopenharmony_ci     * @since 10
528061847f8eSopenharmony_ci     */
528161847f8eSopenharmony_ci    /**
528261847f8eSopenharmony_ci     * Indicates the DSA private key.
528361847f8eSopenharmony_ci     *
528461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
528561847f8eSopenharmony_ci     * @crossplatform
528661847f8eSopenharmony_ci     * @since 11
528761847f8eSopenharmony_ci     */
528861847f8eSopenharmony_ci    /**
528961847f8eSopenharmony_ci     * Indicates the DSA private key.
529061847f8eSopenharmony_ci     *
529161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
529261847f8eSopenharmony_ci     * @crossplatform
529361847f8eSopenharmony_ci     * @atomicservice
529461847f8eSopenharmony_ci     * @since 12
529561847f8eSopenharmony_ci     */
529661847f8eSopenharmony_ci    DSA_SK_BN = 104,
529761847f8eSopenharmony_ci
529861847f8eSopenharmony_ci    /**
529961847f8eSopenharmony_ci     * Indicates the DSA public key.
530061847f8eSopenharmony_ci     *
530161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
530261847f8eSopenharmony_ci     * @since 10
530361847f8eSopenharmony_ci     */
530461847f8eSopenharmony_ci    /**
530561847f8eSopenharmony_ci     * Indicates the DSA public key.
530661847f8eSopenharmony_ci     *
530761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
530861847f8eSopenharmony_ci     * @crossplatform
530961847f8eSopenharmony_ci     * @since 11
531061847f8eSopenharmony_ci     */
531161847f8eSopenharmony_ci    /**
531261847f8eSopenharmony_ci     * Indicates the DSA public key.
531361847f8eSopenharmony_ci     *
531461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
531561847f8eSopenharmony_ci     * @crossplatform
531661847f8eSopenharmony_ci     * @atomicservice
531761847f8eSopenharmony_ci     * @since 12
531861847f8eSopenharmony_ci     */
531961847f8eSopenharmony_ci    DSA_PK_BN = 105,
532061847f8eSopenharmony_ci
532161847f8eSopenharmony_ci    /**
532261847f8eSopenharmony_ci     * Indicates the prime p of an elliptic curve (EC) prime finite field.
532361847f8eSopenharmony_ci     *
532461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
532561847f8eSopenharmony_ci     * @since 10
532661847f8eSopenharmony_ci     */
532761847f8eSopenharmony_ci    /**
532861847f8eSopenharmony_ci     * Indicates the prime p of an elliptic curve (EC) prime finite field.
532961847f8eSopenharmony_ci     *
533061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
533161847f8eSopenharmony_ci     * @crossplatform
533261847f8eSopenharmony_ci     * @since 11
533361847f8eSopenharmony_ci     */
533461847f8eSopenharmony_ci    /**
533561847f8eSopenharmony_ci     * Indicates the prime p of an elliptic curve (EC) prime finite field.
533661847f8eSopenharmony_ci     *
533761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
533861847f8eSopenharmony_ci     * @crossplatform
533961847f8eSopenharmony_ci     * @atomicservice
534061847f8eSopenharmony_ci     * @since 12
534161847f8eSopenharmony_ci     */
534261847f8eSopenharmony_ci    ECC_FP_P_BN = 201,
534361847f8eSopenharmony_ci
534461847f8eSopenharmony_ci    /**
534561847f8eSopenharmony_ci     * Indicates the first coefficient a of this elliptic curve.
534661847f8eSopenharmony_ci     *
534761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
534861847f8eSopenharmony_ci     * @since 10
534961847f8eSopenharmony_ci     */
535061847f8eSopenharmony_ci    /**
535161847f8eSopenharmony_ci     * Indicates the first coefficient a of this elliptic curve.
535261847f8eSopenharmony_ci     *
535361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
535461847f8eSopenharmony_ci     * @crossplatform
535561847f8eSopenharmony_ci     * @since 11
535661847f8eSopenharmony_ci     */
535761847f8eSopenharmony_ci    /**
535861847f8eSopenharmony_ci     * Indicates the first coefficient a of this elliptic curve.
535961847f8eSopenharmony_ci     *
536061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
536161847f8eSopenharmony_ci     * @crossplatform
536261847f8eSopenharmony_ci     * @atomicservice
536361847f8eSopenharmony_ci     * @since 12
536461847f8eSopenharmony_ci     */
536561847f8eSopenharmony_ci    ECC_A_BN = 202,
536661847f8eSopenharmony_ci
536761847f8eSopenharmony_ci    /**
536861847f8eSopenharmony_ci     * Indicates the second coefficient b of this elliptic curve.
536961847f8eSopenharmony_ci     *
537061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
537161847f8eSopenharmony_ci     * @since 10
537261847f8eSopenharmony_ci     */
537361847f8eSopenharmony_ci    /**
537461847f8eSopenharmony_ci     * Indicates the second coefficient b of this elliptic curve.
537561847f8eSopenharmony_ci     *
537661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
537761847f8eSopenharmony_ci     * @crossplatform
537861847f8eSopenharmony_ci     * @since 11
537961847f8eSopenharmony_ci     */
538061847f8eSopenharmony_ci    /**
538161847f8eSopenharmony_ci     * Indicates the second coefficient b of this elliptic curve.
538261847f8eSopenharmony_ci     *
538361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
538461847f8eSopenharmony_ci     * @crossplatform
538561847f8eSopenharmony_ci     * @atomicservice
538661847f8eSopenharmony_ci     * @since 12
538761847f8eSopenharmony_ci     */
538861847f8eSopenharmony_ci    ECC_B_BN = 203,
538961847f8eSopenharmony_ci
539061847f8eSopenharmony_ci    /**
539161847f8eSopenharmony_ci     * Indicates the affine x-coordinate of base point g.
539261847f8eSopenharmony_ci     *
539361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
539461847f8eSopenharmony_ci     * @since 10
539561847f8eSopenharmony_ci     */
539661847f8eSopenharmony_ci    /**
539761847f8eSopenharmony_ci     * Indicates the affine x-coordinate of base point g.
539861847f8eSopenharmony_ci     *
539961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
540061847f8eSopenharmony_ci     * @crossplatform
540161847f8eSopenharmony_ci     * @since 11
540261847f8eSopenharmony_ci     */
540361847f8eSopenharmony_ci    /**
540461847f8eSopenharmony_ci     * Indicates the affine x-coordinate of base point g.
540561847f8eSopenharmony_ci     *
540661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
540761847f8eSopenharmony_ci     * @crossplatform
540861847f8eSopenharmony_ci     * @atomicservice
540961847f8eSopenharmony_ci     * @since 12
541061847f8eSopenharmony_ci     */
541161847f8eSopenharmony_ci    ECC_G_X_BN = 204,
541261847f8eSopenharmony_ci
541361847f8eSopenharmony_ci    /**
541461847f8eSopenharmony_ci     * Indicates the affine y-coordinate of base point g.
541561847f8eSopenharmony_ci     *
541661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
541761847f8eSopenharmony_ci     * @since 10
541861847f8eSopenharmony_ci     */
541961847f8eSopenharmony_ci    /**
542061847f8eSopenharmony_ci     * Indicates the affine y-coordinate of base point g.
542161847f8eSopenharmony_ci     *
542261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
542361847f8eSopenharmony_ci     * @crossplatform
542461847f8eSopenharmony_ci     * @since 11
542561847f8eSopenharmony_ci     */
542661847f8eSopenharmony_ci    /**
542761847f8eSopenharmony_ci     * Indicates the affine y-coordinate of base point g.
542861847f8eSopenharmony_ci     *
542961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
543061847f8eSopenharmony_ci     * @crossplatform
543161847f8eSopenharmony_ci     * @atomicservice
543261847f8eSopenharmony_ci     * @since 12
543361847f8eSopenharmony_ci     */
543461847f8eSopenharmony_ci    ECC_G_Y_BN = 205,
543561847f8eSopenharmony_ci
543661847f8eSopenharmony_ci    /**
543761847f8eSopenharmony_ci     * Indicates the order of the base point g.
543861847f8eSopenharmony_ci     *
543961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
544061847f8eSopenharmony_ci     * @since 10
544161847f8eSopenharmony_ci     */
544261847f8eSopenharmony_ci    /**
544361847f8eSopenharmony_ci     * Indicates the order of the base point g.
544461847f8eSopenharmony_ci     *
544561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
544661847f8eSopenharmony_ci     * @crossplatform
544761847f8eSopenharmony_ci     * @since 11
544861847f8eSopenharmony_ci     */
544961847f8eSopenharmony_ci    /**
545061847f8eSopenharmony_ci     * Indicates the order of the base point g.
545161847f8eSopenharmony_ci     *
545261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
545361847f8eSopenharmony_ci     * @crossplatform
545461847f8eSopenharmony_ci     * @atomicservice
545561847f8eSopenharmony_ci     * @since 12
545661847f8eSopenharmony_ci     */
545761847f8eSopenharmony_ci    ECC_N_BN = 206,
545861847f8eSopenharmony_ci
545961847f8eSopenharmony_ci    /**
546061847f8eSopenharmony_ci     * Indicates the cofactor of the elliptic curve.
546161847f8eSopenharmony_ci     *
546261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
546361847f8eSopenharmony_ci     * @since 10
546461847f8eSopenharmony_ci     */
546561847f8eSopenharmony_ci    /**
546661847f8eSopenharmony_ci     * Indicates the cofactor of the elliptic curve.
546761847f8eSopenharmony_ci     *
546861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
546961847f8eSopenharmony_ci     * @crossplatform
547061847f8eSopenharmony_ci     * @since 11
547161847f8eSopenharmony_ci     */
547261847f8eSopenharmony_ci    /**
547361847f8eSopenharmony_ci     * Indicates the cofactor of the elliptic curve.
547461847f8eSopenharmony_ci     *
547561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
547661847f8eSopenharmony_ci     * @crossplatform
547761847f8eSopenharmony_ci     * @atomicservice
547861847f8eSopenharmony_ci     * @since 12
547961847f8eSopenharmony_ci     */
548061847f8eSopenharmony_ci    ECC_H_NUM = 207,
548161847f8eSopenharmony_ci
548261847f8eSopenharmony_ci    /**
548361847f8eSopenharmony_ci     * Indicates the private value of the ECC private key.
548461847f8eSopenharmony_ci     *
548561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
548661847f8eSopenharmony_ci     * @since 10
548761847f8eSopenharmony_ci     */
548861847f8eSopenharmony_ci    /**
548961847f8eSopenharmony_ci     * Indicates the private value of the ECC private key.
549061847f8eSopenharmony_ci     *
549161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
549261847f8eSopenharmony_ci     * @crossplatform
549361847f8eSopenharmony_ci     * @since 11
549461847f8eSopenharmony_ci     */
549561847f8eSopenharmony_ci    /**
549661847f8eSopenharmony_ci     * Indicates the private value of the ECC private key.
549761847f8eSopenharmony_ci     *
549861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
549961847f8eSopenharmony_ci     * @crossplatform
550061847f8eSopenharmony_ci     * @atomicservice
550161847f8eSopenharmony_ci     * @since 12
550261847f8eSopenharmony_ci     */
550361847f8eSopenharmony_ci    ECC_SK_BN = 208,
550461847f8eSopenharmony_ci
550561847f8eSopenharmony_ci    /**
550661847f8eSopenharmony_ci     * Indicates the affine x-coordinate of a point, which is the public point of an ECC public key.
550761847f8eSopenharmony_ci     *
550861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
550961847f8eSopenharmony_ci     * @since 10
551061847f8eSopenharmony_ci     */
551161847f8eSopenharmony_ci    /**
551261847f8eSopenharmony_ci     * Indicates the affine x-coordinate of a point, which is the public point of an ECC public key.
551361847f8eSopenharmony_ci     *
551461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
551561847f8eSopenharmony_ci     * @crossplatform
551661847f8eSopenharmony_ci     * @since 11
551761847f8eSopenharmony_ci     */
551861847f8eSopenharmony_ci    /**
551961847f8eSopenharmony_ci     * Indicates the affine x-coordinate of a point, which is the public point of an ECC public key.
552061847f8eSopenharmony_ci     *
552161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
552261847f8eSopenharmony_ci     * @crossplatform
552361847f8eSopenharmony_ci     * @atomicservice
552461847f8eSopenharmony_ci     * @since 12
552561847f8eSopenharmony_ci     */
552661847f8eSopenharmony_ci    ECC_PK_X_BN = 209,
552761847f8eSopenharmony_ci
552861847f8eSopenharmony_ci    /**
552961847f8eSopenharmony_ci     * Indicates the affine y-coordinate of a point, which is the public point of an ECC public key.
553061847f8eSopenharmony_ci     *
553161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
553261847f8eSopenharmony_ci     * @since 10
553361847f8eSopenharmony_ci     */
553461847f8eSopenharmony_ci    /**
553561847f8eSopenharmony_ci     * Indicates the affine y-coordinate of a point, which is the public point of an ECC public key.
553661847f8eSopenharmony_ci     *
553761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
553861847f8eSopenharmony_ci     * @crossplatform
553961847f8eSopenharmony_ci     * @since 11
554061847f8eSopenharmony_ci     */
554161847f8eSopenharmony_ci    /**
554261847f8eSopenharmony_ci     * Indicates the affine y-coordinate of a point, which is the public point of an ECC public key.
554361847f8eSopenharmony_ci     *
554461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
554561847f8eSopenharmony_ci     * @crossplatform
554661847f8eSopenharmony_ci     * @atomicservice
554761847f8eSopenharmony_ci     * @since 12
554861847f8eSopenharmony_ci     */
554961847f8eSopenharmony_ci    ECC_PK_Y_BN = 210,
555061847f8eSopenharmony_ci
555161847f8eSopenharmony_ci    /**
555261847f8eSopenharmony_ci     * Indicates an elliptic curve finite field type.
555361847f8eSopenharmony_ci     *
555461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
555561847f8eSopenharmony_ci     * @since 10
555661847f8eSopenharmony_ci     */
555761847f8eSopenharmony_ci    /**
555861847f8eSopenharmony_ci     * Indicates an elliptic curve finite field type.
555961847f8eSopenharmony_ci     *
556061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
556161847f8eSopenharmony_ci     * @crossplatform
556261847f8eSopenharmony_ci     * @since 11
556361847f8eSopenharmony_ci     */
556461847f8eSopenharmony_ci    /**
556561847f8eSopenharmony_ci     * Indicates an elliptic curve finite field type.
556661847f8eSopenharmony_ci     *
556761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
556861847f8eSopenharmony_ci     * @crossplatform
556961847f8eSopenharmony_ci     * @atomicservice
557061847f8eSopenharmony_ci     * @since 12
557161847f8eSopenharmony_ci     */
557261847f8eSopenharmony_ci    ECC_FIELD_TYPE_STR = 211,
557361847f8eSopenharmony_ci
557461847f8eSopenharmony_ci    /**
557561847f8eSopenharmony_ci     * Indicates the field size in bits.
557661847f8eSopenharmony_ci     * For Fp field (an elliptic curve prime finite field with prime p), the field size is the size of prime p.
557761847f8eSopenharmony_ci     *
557861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
557961847f8eSopenharmony_ci     * @since 10
558061847f8eSopenharmony_ci     */
558161847f8eSopenharmony_ci    /**
558261847f8eSopenharmony_ci     * Indicates the field size in bits.
558361847f8eSopenharmony_ci     * For Fp field (an elliptic curve prime finite field with prime p), the field size is the size of prime p.
558461847f8eSopenharmony_ci     *
558561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
558661847f8eSopenharmony_ci     * @crossplatform
558761847f8eSopenharmony_ci     * @since 11
558861847f8eSopenharmony_ci     */
558961847f8eSopenharmony_ci    /**
559061847f8eSopenharmony_ci     * Indicates the field size in bits.
559161847f8eSopenharmony_ci     * For Fp field (an elliptic curve prime finite field with prime p), the field size is the size of prime p.
559261847f8eSopenharmony_ci     *
559361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
559461847f8eSopenharmony_ci     * @crossplatform
559561847f8eSopenharmony_ci     * @atomicservice
559661847f8eSopenharmony_ci     * @since 12
559761847f8eSopenharmony_ci     */
559861847f8eSopenharmony_ci    ECC_FIELD_SIZE_NUM = 212,
559961847f8eSopenharmony_ci
560061847f8eSopenharmony_ci    /**
560161847f8eSopenharmony_ci     * Indicates the curve name according to SECG (Standards for Efficient Cryptography Group).
560261847f8eSopenharmony_ci     *
560361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
560461847f8eSopenharmony_ci     * @since 10
560561847f8eSopenharmony_ci     */
560661847f8eSopenharmony_ci    /**
560761847f8eSopenharmony_ci     * Indicates the curve name according to SECG (Standards for Efficient Cryptography Group).
560861847f8eSopenharmony_ci     *
560961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
561061847f8eSopenharmony_ci     * @crossplatform
561161847f8eSopenharmony_ci     * @since 11
561261847f8eSopenharmony_ci     */
561361847f8eSopenharmony_ci    /**
561461847f8eSopenharmony_ci     * Indicates the curve name according to SECG (Standards for Efficient Cryptography Group).
561561847f8eSopenharmony_ci     *
561661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
561761847f8eSopenharmony_ci     * @crossplatform
561861847f8eSopenharmony_ci     * @atomicservice
561961847f8eSopenharmony_ci     * @since 12
562061847f8eSopenharmony_ci     */
562161847f8eSopenharmony_ci    ECC_CURVE_NAME_STR = 213,
562261847f8eSopenharmony_ci
562361847f8eSopenharmony_ci    /**
562461847f8eSopenharmony_ci     * Indicates the modulus n of RSA algorithm.
562561847f8eSopenharmony_ci     *
562661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
562761847f8eSopenharmony_ci     * @since 10
562861847f8eSopenharmony_ci     */
562961847f8eSopenharmony_ci    /**
563061847f8eSopenharmony_ci     * Indicates the modulus n of RSA algorithm.
563161847f8eSopenharmony_ci     *
563261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
563361847f8eSopenharmony_ci     * @crossplatform
563461847f8eSopenharmony_ci     * @since 11
563561847f8eSopenharmony_ci     */
563661847f8eSopenharmony_ci    /**
563761847f8eSopenharmony_ci     * Indicates the modulus n of RSA algorithm.
563861847f8eSopenharmony_ci     *
563961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
564061847f8eSopenharmony_ci     * @crossplatform
564161847f8eSopenharmony_ci     * @atomicservice
564261847f8eSopenharmony_ci     * @since 12
564361847f8eSopenharmony_ci     */
564461847f8eSopenharmony_ci    RSA_N_BN = 301,
564561847f8eSopenharmony_ci
564661847f8eSopenharmony_ci    /**
564761847f8eSopenharmony_ci     * Indicates the private exponent d of RSA algorithm.
564861847f8eSopenharmony_ci     *
564961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
565061847f8eSopenharmony_ci     * @since 10
565161847f8eSopenharmony_ci     */
565261847f8eSopenharmony_ci    /**
565361847f8eSopenharmony_ci     * Indicates the private exponent d of RSA algorithm.
565461847f8eSopenharmony_ci     *
565561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
565661847f8eSopenharmony_ci     * @crossplatform
565761847f8eSopenharmony_ci     * @since 11
565861847f8eSopenharmony_ci     */
565961847f8eSopenharmony_ci    /**
566061847f8eSopenharmony_ci     * Indicates the private exponent d of RSA algorithm.
566161847f8eSopenharmony_ci     *
566261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
566361847f8eSopenharmony_ci     * @crossplatform
566461847f8eSopenharmony_ci     * @atomicservice
566561847f8eSopenharmony_ci     * @since 12
566661847f8eSopenharmony_ci     */
566761847f8eSopenharmony_ci    RSA_SK_BN = 302,
566861847f8eSopenharmony_ci
566961847f8eSopenharmony_ci    /**
567061847f8eSopenharmony_ci     * Indicates the public exponent e of RSA algorithm.
567161847f8eSopenharmony_ci     *
567261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
567361847f8eSopenharmony_ci     * @since 10
567461847f8eSopenharmony_ci     */
567561847f8eSopenharmony_ci    /**
567661847f8eSopenharmony_ci     * Indicates the public exponent e of RSA algorithm.
567761847f8eSopenharmony_ci     *
567861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
567961847f8eSopenharmony_ci     * @crossplatform
568061847f8eSopenharmony_ci     * @since 11
568161847f8eSopenharmony_ci     */
568261847f8eSopenharmony_ci    /**
568361847f8eSopenharmony_ci     * Indicates the public exponent e of RSA algorithm.
568461847f8eSopenharmony_ci     *
568561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
568661847f8eSopenharmony_ci     * @crossplatform
568761847f8eSopenharmony_ci     * @atomicservice
568861847f8eSopenharmony_ci     * @since 12
568961847f8eSopenharmony_ci     */
569061847f8eSopenharmony_ci    RSA_PK_BN = 303,
569161847f8eSopenharmony_ci
569261847f8eSopenharmony_ci    /**
569361847f8eSopenharmony_ci     * Indicates the prime p of DH algorithm.
569461847f8eSopenharmony_ci     *
569561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
569661847f8eSopenharmony_ci     * @crossplatform
569761847f8eSopenharmony_ci     * @since 11
569861847f8eSopenharmony_ci     */
569961847f8eSopenharmony_ci    /**
570061847f8eSopenharmony_ci     * Indicates the prime p of DH algorithm.
570161847f8eSopenharmony_ci     *
570261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
570361847f8eSopenharmony_ci     * @crossplatform
570461847f8eSopenharmony_ci     * @atomicservice
570561847f8eSopenharmony_ci     * @since 12
570661847f8eSopenharmony_ci     */
570761847f8eSopenharmony_ci    DH_P_BN = 401,
570861847f8eSopenharmony_ci
570961847f8eSopenharmony_ci    /**
571061847f8eSopenharmony_ci     * Indicates the generator g of DH algorithm.
571161847f8eSopenharmony_ci     *
571261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
571361847f8eSopenharmony_ci     * @crossplatform
571461847f8eSopenharmony_ci     * @since 11
571561847f8eSopenharmony_ci     */
571661847f8eSopenharmony_ci    /**
571761847f8eSopenharmony_ci     * Indicates the generator g of DH algorithm.
571861847f8eSopenharmony_ci     *
571961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
572061847f8eSopenharmony_ci     * @crossplatform
572161847f8eSopenharmony_ci     * @atomicservice
572261847f8eSopenharmony_ci     * @since 12
572361847f8eSopenharmony_ci     */
572461847f8eSopenharmony_ci    DH_G_BN = 402,
572561847f8eSopenharmony_ci
572661847f8eSopenharmony_ci    /**
572761847f8eSopenharmony_ci     * Indicates the number of bits of the private key length used in the DH algorithm.
572861847f8eSopenharmony_ci     *
572961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
573061847f8eSopenharmony_ci     * @crossplatform
573161847f8eSopenharmony_ci     * @since 11
573261847f8eSopenharmony_ci     */
573361847f8eSopenharmony_ci    /**
573461847f8eSopenharmony_ci     * Indicates the number of bits of the private key length used in the DH algorithm.
573561847f8eSopenharmony_ci     *
573661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
573761847f8eSopenharmony_ci     * @crossplatform
573861847f8eSopenharmony_ci     * @atomicservice
573961847f8eSopenharmony_ci     * @since 12
574061847f8eSopenharmony_ci     */
574161847f8eSopenharmony_ci    DH_L_NUM = 403,
574261847f8eSopenharmony_ci
574361847f8eSopenharmony_ci    /**
574461847f8eSopenharmony_ci     * Indicates the private value of the DH private key.
574561847f8eSopenharmony_ci     *
574661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
574761847f8eSopenharmony_ci     * @crossplatform
574861847f8eSopenharmony_ci     * @since 11
574961847f8eSopenharmony_ci     */
575061847f8eSopenharmony_ci    /**
575161847f8eSopenharmony_ci     * Indicates the private value of the DH private key.
575261847f8eSopenharmony_ci     *
575361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
575461847f8eSopenharmony_ci     * @crossplatform
575561847f8eSopenharmony_ci     * @atomicservice
575661847f8eSopenharmony_ci     * @since 12
575761847f8eSopenharmony_ci     */
575861847f8eSopenharmony_ci    DH_SK_BN = 404,
575961847f8eSopenharmony_ci
576061847f8eSopenharmony_ci    /**
576161847f8eSopenharmony_ci     * Indicates the public value of the DH public key.
576261847f8eSopenharmony_ci     *
576361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
576461847f8eSopenharmony_ci     * @crossplatform
576561847f8eSopenharmony_ci     * @since 11
576661847f8eSopenharmony_ci     */
576761847f8eSopenharmony_ci    /**
576861847f8eSopenharmony_ci     * Indicates the public value of the DH public key.
576961847f8eSopenharmony_ci     *
577061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
577161847f8eSopenharmony_ci     * @crossplatform
577261847f8eSopenharmony_ci     * @atomicservice
577361847f8eSopenharmony_ci     * @since 12
577461847f8eSopenharmony_ci     */
577561847f8eSopenharmony_ci    DH_PK_BN = 405,
577661847f8eSopenharmony_ci
577761847f8eSopenharmony_ci    /**
577861847f8eSopenharmony_ci     * Indicates the private value of the ED25519 private key.
577961847f8eSopenharmony_ci     *
578061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
578161847f8eSopenharmony_ci     * @crossplatform
578261847f8eSopenharmony_ci     * @since 11
578361847f8eSopenharmony_ci     */
578461847f8eSopenharmony_ci    /**
578561847f8eSopenharmony_ci     * Indicates the private value of the ED25519 private key.
578661847f8eSopenharmony_ci     *
578761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
578861847f8eSopenharmony_ci     * @crossplatform
578961847f8eSopenharmony_ci     * @atomicservice
579061847f8eSopenharmony_ci     * @since 12
579161847f8eSopenharmony_ci     */
579261847f8eSopenharmony_ci    ED25519_SK_BN = 501,
579361847f8eSopenharmony_ci
579461847f8eSopenharmony_ci    /**
579561847f8eSopenharmony_ci     * Indicates the public value of the ED25519 public key.
579661847f8eSopenharmony_ci     *
579761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
579861847f8eSopenharmony_ci     * @crossplatform
579961847f8eSopenharmony_ci     * @since 11
580061847f8eSopenharmony_ci     */
580161847f8eSopenharmony_ci    /**
580261847f8eSopenharmony_ci     * Indicates the public value of the ED25519 public key.
580361847f8eSopenharmony_ci     *
580461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
580561847f8eSopenharmony_ci     * @crossplatform
580661847f8eSopenharmony_ci     * @atomicservice
580761847f8eSopenharmony_ci     * @since 12
580861847f8eSopenharmony_ci     */
580961847f8eSopenharmony_ci    ED25519_PK_BN = 502,
581061847f8eSopenharmony_ci
581161847f8eSopenharmony_ci    /**
581261847f8eSopenharmony_ci     * Indicates the private value of the X25519 private key.
581361847f8eSopenharmony_ci     *
581461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
581561847f8eSopenharmony_ci     * @crossplatform
581661847f8eSopenharmony_ci     * @since 11
581761847f8eSopenharmony_ci     */
581861847f8eSopenharmony_ci    /**
581961847f8eSopenharmony_ci     * Indicates the private value of the X25519 private key.
582061847f8eSopenharmony_ci     *
582161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
582261847f8eSopenharmony_ci     * @crossplatform
582361847f8eSopenharmony_ci     * @atomicservice
582461847f8eSopenharmony_ci     * @since 12
582561847f8eSopenharmony_ci     */
582661847f8eSopenharmony_ci    X25519_SK_BN = 601,
582761847f8eSopenharmony_ci
582861847f8eSopenharmony_ci    /**
582961847f8eSopenharmony_ci     * Indicates the public value of the X25519 public key.
583061847f8eSopenharmony_ci     *
583161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
583261847f8eSopenharmony_ci     * @crossplatform
583361847f8eSopenharmony_ci     * @since 11
583461847f8eSopenharmony_ci     */
583561847f8eSopenharmony_ci    /**
583661847f8eSopenharmony_ci     * Indicates the public value of the X25519 public key.
583761847f8eSopenharmony_ci     *
583861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
583961847f8eSopenharmony_ci     * @crossplatform
584061847f8eSopenharmony_ci     * @atomicservice
584161847f8eSopenharmony_ci     * @since 12
584261847f8eSopenharmony_ci     */
584361847f8eSopenharmony_ci    X25519_PK_BN = 602
584461847f8eSopenharmony_ci  }
584561847f8eSopenharmony_ci
584661847f8eSopenharmony_ci  /**
584761847f8eSopenharmony_ci   * Enum for algorithm specified parameters type.
584861847f8eSopenharmony_ci   *
584961847f8eSopenharmony_ci   * @enum { number }
585061847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
585161847f8eSopenharmony_ci   * @since 10
585261847f8eSopenharmony_ci   */
585361847f8eSopenharmony_ci  /**
585461847f8eSopenharmony_ci   * Enum for algorithm specified parameters type.
585561847f8eSopenharmony_ci   *
585661847f8eSopenharmony_ci   * @enum { number }
585761847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
585861847f8eSopenharmony_ci   * @crossplatform
585961847f8eSopenharmony_ci   * @since 11
586061847f8eSopenharmony_ci   */
586161847f8eSopenharmony_ci  /**
586261847f8eSopenharmony_ci   * Enum for algorithm specified parameters type.
586361847f8eSopenharmony_ci   *
586461847f8eSopenharmony_ci   * @enum { number }
586561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
586661847f8eSopenharmony_ci   * @crossplatform
586761847f8eSopenharmony_ci   * @atomicservice
586861847f8eSopenharmony_ci   * @since 12
586961847f8eSopenharmony_ci   */
587061847f8eSopenharmony_ci  enum AsyKeySpecType {
587161847f8eSopenharmony_ci    /**
587261847f8eSopenharmony_ci     * Indicates the common specified parameters.
587361847f8eSopenharmony_ci     *
587461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
587561847f8eSopenharmony_ci     * @since 10
587661847f8eSopenharmony_ci     */
587761847f8eSopenharmony_ci    /**
587861847f8eSopenharmony_ci     * Indicates the common specified parameters.
587961847f8eSopenharmony_ci     *
588061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
588161847f8eSopenharmony_ci     * @crossplatform
588261847f8eSopenharmony_ci     * @since 11
588361847f8eSopenharmony_ci     */
588461847f8eSopenharmony_ci    /**
588561847f8eSopenharmony_ci     * Indicates the common specified parameters.
588661847f8eSopenharmony_ci     *
588761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
588861847f8eSopenharmony_ci     * @crossplatform
588961847f8eSopenharmony_ci     * @atomicservice
589061847f8eSopenharmony_ci     * @since 12
589161847f8eSopenharmony_ci     */
589261847f8eSopenharmony_ci    COMMON_PARAMS_SPEC = 0,
589361847f8eSopenharmony_ci
589461847f8eSopenharmony_ci    /**
589561847f8eSopenharmony_ci     * Indicates the specified parameters of private key.
589661847f8eSopenharmony_ci     *
589761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
589861847f8eSopenharmony_ci     * @since 10
589961847f8eSopenharmony_ci     */
590061847f8eSopenharmony_ci    /**
590161847f8eSopenharmony_ci     * Indicates the specified parameters of private key.
590261847f8eSopenharmony_ci     *
590361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
590461847f8eSopenharmony_ci     * @crossplatform
590561847f8eSopenharmony_ci     * @since 11
590661847f8eSopenharmony_ci     */
590761847f8eSopenharmony_ci    /**
590861847f8eSopenharmony_ci     * Indicates the specified parameters of private key.
590961847f8eSopenharmony_ci     *
591061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
591161847f8eSopenharmony_ci     * @crossplatform
591261847f8eSopenharmony_ci     * @atomicservice
591361847f8eSopenharmony_ci     * @since 12
591461847f8eSopenharmony_ci     */
591561847f8eSopenharmony_ci    PRIVATE_KEY_SPEC = 1,
591661847f8eSopenharmony_ci
591761847f8eSopenharmony_ci    /**
591861847f8eSopenharmony_ci     * Indicates the specified parameters of public key.
591961847f8eSopenharmony_ci     *
592061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
592161847f8eSopenharmony_ci     * @since 10
592261847f8eSopenharmony_ci     */
592361847f8eSopenharmony_ci    /**
592461847f8eSopenharmony_ci     * Indicates the specified parameters of public key.
592561847f8eSopenharmony_ci     *
592661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
592761847f8eSopenharmony_ci     * @crossplatform
592861847f8eSopenharmony_ci     * @since 11
592961847f8eSopenharmony_ci     */
593061847f8eSopenharmony_ci    /**
593161847f8eSopenharmony_ci     * Indicates the specified parameters of public key.
593261847f8eSopenharmony_ci     *
593361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
593461847f8eSopenharmony_ci     * @crossplatform
593561847f8eSopenharmony_ci     * @atomicservice
593661847f8eSopenharmony_ci     * @since 12
593761847f8eSopenharmony_ci     */
593861847f8eSopenharmony_ci    PUBLIC_KEY_SPEC = 2,
593961847f8eSopenharmony_ci
594061847f8eSopenharmony_ci    /**
594161847f8eSopenharmony_ci     * Indicates the specified parameters of keypair.
594261847f8eSopenharmony_ci     *
594361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
594461847f8eSopenharmony_ci     * @since 10
594561847f8eSopenharmony_ci     */
594661847f8eSopenharmony_ci    /**
594761847f8eSopenharmony_ci     * Indicates the specified parameters of keypair.
594861847f8eSopenharmony_ci     *
594961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
595061847f8eSopenharmony_ci     * @crossplatform
595161847f8eSopenharmony_ci     * @since 11
595261847f8eSopenharmony_ci     */
595361847f8eSopenharmony_ci    /**
595461847f8eSopenharmony_ci     * Indicates the specified parameters of keypair.
595561847f8eSopenharmony_ci     *
595661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
595761847f8eSopenharmony_ci     * @crossplatform
595861847f8eSopenharmony_ci     * @atomicservice
595961847f8eSopenharmony_ci     * @since 12
596061847f8eSopenharmony_ci     */
596161847f8eSopenharmony_ci    KEY_PAIR_SPEC = 3
596261847f8eSopenharmony_ci  }
596361847f8eSopenharmony_ci
596461847f8eSopenharmony_ci  /**
596561847f8eSopenharmony_ci   * Provides a base interface for specifying asymmetric key parameters.
596661847f8eSopenharmony_ci   *
596761847f8eSopenharmony_ci   * @typedef AsyKeySpec
596861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
596961847f8eSopenharmony_ci   * @since 10
597061847f8eSopenharmony_ci   */
597161847f8eSopenharmony_ci  /**
597261847f8eSopenharmony_ci   * Provides a base interface for specifying asymmetric key parameters.
597361847f8eSopenharmony_ci   *
597461847f8eSopenharmony_ci   * @typedef AsyKeySpec
597561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
597661847f8eSopenharmony_ci   * @crossplatform
597761847f8eSopenharmony_ci   * @since 11
597861847f8eSopenharmony_ci   */
597961847f8eSopenharmony_ci  /**
598061847f8eSopenharmony_ci   * Provides a base interface for specifying asymmetric key parameters.
598161847f8eSopenharmony_ci   *
598261847f8eSopenharmony_ci   * @typedef AsyKeySpec
598361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
598461847f8eSopenharmony_ci   * @crossplatform
598561847f8eSopenharmony_ci   * @atomicservice
598661847f8eSopenharmony_ci   * @since 12
598761847f8eSopenharmony_ci   */
598861847f8eSopenharmony_ci  interface AsyKeySpec {
598961847f8eSopenharmony_ci    /**
599061847f8eSopenharmony_ci     * Indicates the algorithm name of the asymmetric key object.
599161847f8eSopenharmony_ci     *
599261847f8eSopenharmony_ci     * @type { string }
599361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
599461847f8eSopenharmony_ci     * @since 10
599561847f8eSopenharmony_ci     */
599661847f8eSopenharmony_ci    /**
599761847f8eSopenharmony_ci     * Indicates the algorithm name of the asymmetric key object.
599861847f8eSopenharmony_ci     *
599961847f8eSopenharmony_ci     * @type { string }
600061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
600161847f8eSopenharmony_ci     * @crossplatform
600261847f8eSopenharmony_ci     * @since 11
600361847f8eSopenharmony_ci     */
600461847f8eSopenharmony_ci    /**
600561847f8eSopenharmony_ci     * Indicates the algorithm name of the asymmetric key object.
600661847f8eSopenharmony_ci     *
600761847f8eSopenharmony_ci     * @type { string }
600861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
600961847f8eSopenharmony_ci     * @crossplatform
601061847f8eSopenharmony_ci     * @atomicservice
601161847f8eSopenharmony_ci     * @since 12
601261847f8eSopenharmony_ci     */
601361847f8eSopenharmony_ci    algName: string;
601461847f8eSopenharmony_ci
601561847f8eSopenharmony_ci    /**
601661847f8eSopenharmony_ci     * Indicates the type of the specified parameters.
601761847f8eSopenharmony_ci     *
601861847f8eSopenharmony_ci     * @type { AsyKeySpecType }
601961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
602061847f8eSopenharmony_ci     * @since 10
602161847f8eSopenharmony_ci     */
602261847f8eSopenharmony_ci    /**
602361847f8eSopenharmony_ci     * Indicates the type of the specified parameters.
602461847f8eSopenharmony_ci     *
602561847f8eSopenharmony_ci     * @type { AsyKeySpecType }
602661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
602761847f8eSopenharmony_ci     * @crossplatform
602861847f8eSopenharmony_ci     * @since 11
602961847f8eSopenharmony_ci     */
603061847f8eSopenharmony_ci    /**
603161847f8eSopenharmony_ci     * Indicates the type of the specified parameters.
603261847f8eSopenharmony_ci     *
603361847f8eSopenharmony_ci     * @type { AsyKeySpecType }
603461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
603561847f8eSopenharmony_ci     * @crossplatform
603661847f8eSopenharmony_ci     * @atomicservice
603761847f8eSopenharmony_ci     * @since 12
603861847f8eSopenharmony_ci     */
603961847f8eSopenharmony_ci    specType: AsyKeySpecType;
604061847f8eSopenharmony_ci  }
604161847f8eSopenharmony_ci
604261847f8eSopenharmony_ci  /**
604361847f8eSopenharmony_ci   * Specifies the set of parameters used in the DSA algorithm.
604461847f8eSopenharmony_ci   *
604561847f8eSopenharmony_ci   * @typedef DSACommonParamsSpec
604661847f8eSopenharmony_ci   * @extends AsyKeySpec
604761847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
604861847f8eSopenharmony_ci   * @since 10
604961847f8eSopenharmony_ci   */
605061847f8eSopenharmony_ci  /**
605161847f8eSopenharmony_ci   * Specifies the set of parameters used in the DSA algorithm.
605261847f8eSopenharmony_ci   *
605361847f8eSopenharmony_ci   * @typedef DSACommonParamsSpec
605461847f8eSopenharmony_ci   * @extends AsyKeySpec
605561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
605661847f8eSopenharmony_ci   * @crossplatform
605761847f8eSopenharmony_ci   * @since 11
605861847f8eSopenharmony_ci   */
605961847f8eSopenharmony_ci  /**
606061847f8eSopenharmony_ci   * Specifies the set of parameters used in the DSA algorithm.
606161847f8eSopenharmony_ci   *
606261847f8eSopenharmony_ci   * @typedef DSACommonParamsSpec
606361847f8eSopenharmony_ci   * @extends AsyKeySpec
606461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
606561847f8eSopenharmony_ci   * @crossplatform
606661847f8eSopenharmony_ci   * @atomicservice
606761847f8eSopenharmony_ci   * @since 12
606861847f8eSopenharmony_ci   */
606961847f8eSopenharmony_ci  interface DSACommonParamsSpec extends AsyKeySpec {
607061847f8eSopenharmony_ci    /**
607161847f8eSopenharmony_ci     * Indicates the DSA prime p.
607261847f8eSopenharmony_ci     *
607361847f8eSopenharmony_ci     * @type { bigint }
607461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
607561847f8eSopenharmony_ci     * @since 10
607661847f8eSopenharmony_ci     */
607761847f8eSopenharmony_ci    /**
607861847f8eSopenharmony_ci     * Indicates the DSA prime p.
607961847f8eSopenharmony_ci     *
608061847f8eSopenharmony_ci     * @type { bigint }
608161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
608261847f8eSopenharmony_ci     * @crossplatform
608361847f8eSopenharmony_ci     * @since 11
608461847f8eSopenharmony_ci     */
608561847f8eSopenharmony_ci    /**
608661847f8eSopenharmony_ci     * Indicates the DSA prime p.
608761847f8eSopenharmony_ci     *
608861847f8eSopenharmony_ci     * @type { bigint }
608961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
609061847f8eSopenharmony_ci     * @crossplatform
609161847f8eSopenharmony_ci     * @atomicservice
609261847f8eSopenharmony_ci     * @since 12
609361847f8eSopenharmony_ci     */
609461847f8eSopenharmony_ci    p: bigint;
609561847f8eSopenharmony_ci
609661847f8eSopenharmony_ci    /**
609761847f8eSopenharmony_ci     * Indicates the DSA sub-prime q.
609861847f8eSopenharmony_ci     *
609961847f8eSopenharmony_ci     * @type { bigint }
610061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
610161847f8eSopenharmony_ci     * @since 10
610261847f8eSopenharmony_ci     */
610361847f8eSopenharmony_ci    /**
610461847f8eSopenharmony_ci     * Indicates the DSA sub-prime q.
610561847f8eSopenharmony_ci     *
610661847f8eSopenharmony_ci     * @type { bigint }
610761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
610861847f8eSopenharmony_ci     * @crossplatform
610961847f8eSopenharmony_ci     * @since 11
611061847f8eSopenharmony_ci     */
611161847f8eSopenharmony_ci    /**
611261847f8eSopenharmony_ci     * Indicates the DSA sub-prime q.
611361847f8eSopenharmony_ci     *
611461847f8eSopenharmony_ci     * @type { bigint }
611561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
611661847f8eSopenharmony_ci     * @crossplatform
611761847f8eSopenharmony_ci     * @atomicservice
611861847f8eSopenharmony_ci     * @since 12
611961847f8eSopenharmony_ci     */
612061847f8eSopenharmony_ci    q: bigint;
612161847f8eSopenharmony_ci
612261847f8eSopenharmony_ci    /**
612361847f8eSopenharmony_ci     * Indicates the DSA base g.
612461847f8eSopenharmony_ci     *
612561847f8eSopenharmony_ci     * @type { bigint }
612661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
612761847f8eSopenharmony_ci     * @since 10
612861847f8eSopenharmony_ci     */
612961847f8eSopenharmony_ci    /**
613061847f8eSopenharmony_ci     * Indicates the DSA base g.
613161847f8eSopenharmony_ci     *
613261847f8eSopenharmony_ci     * @type { bigint }
613361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
613461847f8eSopenharmony_ci     * @crossplatform
613561847f8eSopenharmony_ci     * @since 11
613661847f8eSopenharmony_ci     */
613761847f8eSopenharmony_ci    /**
613861847f8eSopenharmony_ci     * Indicates the DSA base g.
613961847f8eSopenharmony_ci     *
614061847f8eSopenharmony_ci     * @type { bigint }
614161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
614261847f8eSopenharmony_ci     * @crossplatform
614361847f8eSopenharmony_ci     * @atomicservice
614461847f8eSopenharmony_ci     * @since 12
614561847f8eSopenharmony_ci     */
614661847f8eSopenharmony_ci    g: bigint;
614761847f8eSopenharmony_ci  }
614861847f8eSopenharmony_ci
614961847f8eSopenharmony_ci  /**
615061847f8eSopenharmony_ci   * Specifies the DSA public key with its associated parameters.
615161847f8eSopenharmony_ci   *
615261847f8eSopenharmony_ci   * @typedef DSAPubKeySpec
615361847f8eSopenharmony_ci   * @extends AsyKeySpec
615461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
615561847f8eSopenharmony_ci   * @since 10
615661847f8eSopenharmony_ci   */
615761847f8eSopenharmony_ci  /**
615861847f8eSopenharmony_ci   * Specifies the DSA public key with its associated parameters.
615961847f8eSopenharmony_ci   *
616061847f8eSopenharmony_ci   * @typedef DSAPubKeySpec
616161847f8eSopenharmony_ci   * @extends AsyKeySpec
616261847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
616361847f8eSopenharmony_ci   * @crossplatform
616461847f8eSopenharmony_ci   * @since 11
616561847f8eSopenharmony_ci   */
616661847f8eSopenharmony_ci  /**
616761847f8eSopenharmony_ci   * Specifies the DSA public key with its associated parameters.
616861847f8eSopenharmony_ci   *
616961847f8eSopenharmony_ci   * @typedef DSAPubKeySpec
617061847f8eSopenharmony_ci   * @extends AsyKeySpec
617161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
617261847f8eSopenharmony_ci   * @crossplatform
617361847f8eSopenharmony_ci   * @atomicservice
617461847f8eSopenharmony_ci   * @since 12
617561847f8eSopenharmony_ci   */
617661847f8eSopenharmony_ci  interface DSAPubKeySpec extends AsyKeySpec {
617761847f8eSopenharmony_ci    /**
617861847f8eSopenharmony_ci     * Indicates the DSA common parameters.
617961847f8eSopenharmony_ci     *
618061847f8eSopenharmony_ci     * @type { DSACommonParamsSpec }
618161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
618261847f8eSopenharmony_ci     * @since 10
618361847f8eSopenharmony_ci     */
618461847f8eSopenharmony_ci    /**
618561847f8eSopenharmony_ci     * Indicates the DSA common parameters.
618661847f8eSopenharmony_ci     *
618761847f8eSopenharmony_ci     * @type { DSACommonParamsSpec }
618861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
618961847f8eSopenharmony_ci     * @crossplatform
619061847f8eSopenharmony_ci     * @since 11
619161847f8eSopenharmony_ci     */
619261847f8eSopenharmony_ci    /**
619361847f8eSopenharmony_ci     * Indicates the DSA common parameters.
619461847f8eSopenharmony_ci     *
619561847f8eSopenharmony_ci     * @type { DSACommonParamsSpec }
619661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
619761847f8eSopenharmony_ci     * @crossplatform
619861847f8eSopenharmony_ci     * @atomicservice
619961847f8eSopenharmony_ci     * @since 12
620061847f8eSopenharmony_ci     */
620161847f8eSopenharmony_ci    params: DSACommonParamsSpec;
620261847f8eSopenharmony_ci
620361847f8eSopenharmony_ci    /**
620461847f8eSopenharmony_ci     * Indicates the DSA public key.
620561847f8eSopenharmony_ci     *
620661847f8eSopenharmony_ci     * @type { bigint }
620761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
620861847f8eSopenharmony_ci     * @since 10
620961847f8eSopenharmony_ci     */
621061847f8eSopenharmony_ci    /**
621161847f8eSopenharmony_ci     * Indicates the DSA public key.
621261847f8eSopenharmony_ci     *
621361847f8eSopenharmony_ci     * @type { bigint }
621461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
621561847f8eSopenharmony_ci     * @crossplatform
621661847f8eSopenharmony_ci     * @since 11
621761847f8eSopenharmony_ci     */
621861847f8eSopenharmony_ci    /**
621961847f8eSopenharmony_ci     * Indicates the DSA public key.
622061847f8eSopenharmony_ci     *
622161847f8eSopenharmony_ci     * @type { bigint }
622261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
622361847f8eSopenharmony_ci     * @crossplatform
622461847f8eSopenharmony_ci     * @atomicservice
622561847f8eSopenharmony_ci     * @since 12
622661847f8eSopenharmony_ci     */
622761847f8eSopenharmony_ci    pk: bigint;
622861847f8eSopenharmony_ci  }
622961847f8eSopenharmony_ci
623061847f8eSopenharmony_ci  /**
623161847f8eSopenharmony_ci   * Specifies the DSA keypair with its associated parameters.
623261847f8eSopenharmony_ci   *
623361847f8eSopenharmony_ci   * @typedef DSAKeyPairSpec
623461847f8eSopenharmony_ci   * @extends AsyKeySpec
623561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
623661847f8eSopenharmony_ci   * @since 10
623761847f8eSopenharmony_ci   */
623861847f8eSopenharmony_ci  /**
623961847f8eSopenharmony_ci   * Specifies the DSA keypair with its associated parameters.
624061847f8eSopenharmony_ci   *
624161847f8eSopenharmony_ci   * @typedef DSAKeyPairSpec
624261847f8eSopenharmony_ci   * @extends AsyKeySpec
624361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
624461847f8eSopenharmony_ci   * @crossplatform
624561847f8eSopenharmony_ci   * @since 11
624661847f8eSopenharmony_ci   */
624761847f8eSopenharmony_ci  /**
624861847f8eSopenharmony_ci   * Specifies the DSA keypair with its associated parameters.
624961847f8eSopenharmony_ci   *
625061847f8eSopenharmony_ci   * @typedef DSAKeyPairSpec
625161847f8eSopenharmony_ci   * @extends AsyKeySpec
625261847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
625361847f8eSopenharmony_ci   * @crossplatform
625461847f8eSopenharmony_ci   * @atomicservice
625561847f8eSopenharmony_ci   * @since 12
625661847f8eSopenharmony_ci   */
625761847f8eSopenharmony_ci  interface DSAKeyPairSpec extends AsyKeySpec {
625861847f8eSopenharmony_ci    /**
625961847f8eSopenharmony_ci     * Indicates the DSA common parameters.
626061847f8eSopenharmony_ci     *
626161847f8eSopenharmony_ci     * @type { DSACommonParamsSpec }
626261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
626361847f8eSopenharmony_ci     * @since 10
626461847f8eSopenharmony_ci     */
626561847f8eSopenharmony_ci    /**
626661847f8eSopenharmony_ci     * Indicates the DSA common parameters.
626761847f8eSopenharmony_ci     *
626861847f8eSopenharmony_ci     * @type { DSACommonParamsSpec }
626961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
627061847f8eSopenharmony_ci     * @crossplatform
627161847f8eSopenharmony_ci     * @since 11
627261847f8eSopenharmony_ci     */
627361847f8eSopenharmony_ci    /**
627461847f8eSopenharmony_ci     * Indicates the DSA common parameters.
627561847f8eSopenharmony_ci     *
627661847f8eSopenharmony_ci     * @type { DSACommonParamsSpec }
627761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
627861847f8eSopenharmony_ci     * @crossplatform
627961847f8eSopenharmony_ci     * @atomicservice
628061847f8eSopenharmony_ci     * @since 12
628161847f8eSopenharmony_ci     */
628261847f8eSopenharmony_ci    params: DSACommonParamsSpec;
628361847f8eSopenharmony_ci
628461847f8eSopenharmony_ci    /**
628561847f8eSopenharmony_ci     * Indicates the DSA private key.
628661847f8eSopenharmony_ci     *
628761847f8eSopenharmony_ci     * @type { bigint }
628861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
628961847f8eSopenharmony_ci     * @since 10
629061847f8eSopenharmony_ci     */
629161847f8eSopenharmony_ci    /**
629261847f8eSopenharmony_ci     * Indicates the DSA private key.
629361847f8eSopenharmony_ci     *
629461847f8eSopenharmony_ci     * @type { bigint }
629561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
629661847f8eSopenharmony_ci     * @crossplatform
629761847f8eSopenharmony_ci     * @since 11
629861847f8eSopenharmony_ci     */
629961847f8eSopenharmony_ci    /**
630061847f8eSopenharmony_ci     * Indicates the DSA private key.
630161847f8eSopenharmony_ci     *
630261847f8eSopenharmony_ci     * @type { bigint }
630361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
630461847f8eSopenharmony_ci     * @crossplatform
630561847f8eSopenharmony_ci     * @atomicservice
630661847f8eSopenharmony_ci     * @since 12
630761847f8eSopenharmony_ci     */
630861847f8eSopenharmony_ci    sk: bigint;
630961847f8eSopenharmony_ci
631061847f8eSopenharmony_ci    /**
631161847f8eSopenharmony_ci     * Indicates the DSA public key.
631261847f8eSopenharmony_ci     *
631361847f8eSopenharmony_ci     * @type { bigint }
631461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
631561847f8eSopenharmony_ci     * @since 10
631661847f8eSopenharmony_ci     */
631761847f8eSopenharmony_ci    /**
631861847f8eSopenharmony_ci     * Indicates the DSA public key.
631961847f8eSopenharmony_ci     *
632061847f8eSopenharmony_ci     * @type { bigint }
632161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
632261847f8eSopenharmony_ci     * @crossplatform
632361847f8eSopenharmony_ci     * @since 11
632461847f8eSopenharmony_ci     */
632561847f8eSopenharmony_ci    /**
632661847f8eSopenharmony_ci     * Indicates the DSA public key.
632761847f8eSopenharmony_ci     *
632861847f8eSopenharmony_ci     * @type { bigint }
632961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
633061847f8eSopenharmony_ci     * @crossplatform
633161847f8eSopenharmony_ci     * @atomicservice
633261847f8eSopenharmony_ci     * @since 12
633361847f8eSopenharmony_ci     */
633461847f8eSopenharmony_ci    pk: bigint;
633561847f8eSopenharmony_ci  }
633661847f8eSopenharmony_ci
633761847f8eSopenharmony_ci  /**
633861847f8eSopenharmony_ci   * Specifies an elliptic curve finite field.
633961847f8eSopenharmony_ci   *
634061847f8eSopenharmony_ci   * @typedef ECField
634161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
634261847f8eSopenharmony_ci   * @since 10
634361847f8eSopenharmony_ci   */
634461847f8eSopenharmony_ci  /**
634561847f8eSopenharmony_ci   * Specifies an elliptic curve finite field.
634661847f8eSopenharmony_ci   *
634761847f8eSopenharmony_ci   * @typedef ECField
634861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
634961847f8eSopenharmony_ci   * @crossplatform
635061847f8eSopenharmony_ci   * @since 11
635161847f8eSopenharmony_ci   */
635261847f8eSopenharmony_ci  /**
635361847f8eSopenharmony_ci   * Specifies an elliptic curve finite field.
635461847f8eSopenharmony_ci   *
635561847f8eSopenharmony_ci   * @typedef ECField
635661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
635761847f8eSopenharmony_ci   * @crossplatform
635861847f8eSopenharmony_ci   * @atomicservice
635961847f8eSopenharmony_ci   * @since 12
636061847f8eSopenharmony_ci   */
636161847f8eSopenharmony_ci  interface ECField {
636261847f8eSopenharmony_ci    /**
636361847f8eSopenharmony_ci     * Indicates the type of an elliptic curve finite field.
636461847f8eSopenharmony_ci     * Currently, only Fp (elliptic curve prime finite field) is supported.
636561847f8eSopenharmony_ci     *
636661847f8eSopenharmony_ci     * @type { string }
636761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
636861847f8eSopenharmony_ci     * @since 10
636961847f8eSopenharmony_ci     */
637061847f8eSopenharmony_ci    /**
637161847f8eSopenharmony_ci     * Indicates the type of an elliptic curve finite field.
637261847f8eSopenharmony_ci     * Currently, only Fp (elliptic curve prime finite field) is supported.
637361847f8eSopenharmony_ci     *
637461847f8eSopenharmony_ci     * @type { string }
637561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
637661847f8eSopenharmony_ci     * @crossplatform
637761847f8eSopenharmony_ci     * @since 11
637861847f8eSopenharmony_ci     */
637961847f8eSopenharmony_ci    /**
638061847f8eSopenharmony_ci     * Indicates the type of an elliptic curve finite field.
638161847f8eSopenharmony_ci     * Currently, only Fp (elliptic curve prime finite field) is supported.
638261847f8eSopenharmony_ci     *
638361847f8eSopenharmony_ci     * @type { string }
638461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
638561847f8eSopenharmony_ci     * @crossplatform
638661847f8eSopenharmony_ci     * @atomicservice
638761847f8eSopenharmony_ci     * @since 12
638861847f8eSopenharmony_ci     */
638961847f8eSopenharmony_ci    fieldType: string;
639061847f8eSopenharmony_ci  }
639161847f8eSopenharmony_ci
639261847f8eSopenharmony_ci  /**
639361847f8eSopenharmony_ci   * Specifies an elliptic curve finite field with the prime p.
639461847f8eSopenharmony_ci   *
639561847f8eSopenharmony_ci   * @typedef ECFieldFp
639661847f8eSopenharmony_ci   * @extends ECField
639761847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
639861847f8eSopenharmony_ci   * @since 10
639961847f8eSopenharmony_ci   */
640061847f8eSopenharmony_ci  /**
640161847f8eSopenharmony_ci   * Specifies an elliptic curve finite field with the prime p.
640261847f8eSopenharmony_ci   *
640361847f8eSopenharmony_ci   * @typedef ECFieldFp
640461847f8eSopenharmony_ci   * @extends ECField
640561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
640661847f8eSopenharmony_ci   * @crossplatform
640761847f8eSopenharmony_ci   * @since 11
640861847f8eSopenharmony_ci   */
640961847f8eSopenharmony_ci  /**
641061847f8eSopenharmony_ci   * Specifies an elliptic curve finite field with the prime p.
641161847f8eSopenharmony_ci   *
641261847f8eSopenharmony_ci   * @typedef ECFieldFp
641361847f8eSopenharmony_ci   * @extends ECField
641461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
641561847f8eSopenharmony_ci   * @crossplatform
641661847f8eSopenharmony_ci   * @atomicservice
641761847f8eSopenharmony_ci   * @since 12
641861847f8eSopenharmony_ci   */
641961847f8eSopenharmony_ci  interface ECFieldFp extends ECField {
642061847f8eSopenharmony_ci    /**
642161847f8eSopenharmony_ci     * Indicates the prime p.
642261847f8eSopenharmony_ci     *
642361847f8eSopenharmony_ci     * @type { bigint }
642461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
642561847f8eSopenharmony_ci     * @since 10
642661847f8eSopenharmony_ci     */
642761847f8eSopenharmony_ci    /**
642861847f8eSopenharmony_ci     * Indicates the prime p.
642961847f8eSopenharmony_ci     *
643061847f8eSopenharmony_ci     * @type { bigint }
643161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
643261847f8eSopenharmony_ci     * @crossplatform
643361847f8eSopenharmony_ci     * @since 11
643461847f8eSopenharmony_ci     */
643561847f8eSopenharmony_ci    /**
643661847f8eSopenharmony_ci     * Indicates the prime p.
643761847f8eSopenharmony_ci     *
643861847f8eSopenharmony_ci     * @type { bigint }
643961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
644061847f8eSopenharmony_ci     * @crossplatform
644161847f8eSopenharmony_ci     * @atomicservice
644261847f8eSopenharmony_ci     * @since 12
644361847f8eSopenharmony_ci     */
644461847f8eSopenharmony_ci    p: bigint;
644561847f8eSopenharmony_ci  }
644661847f8eSopenharmony_ci
644761847f8eSopenharmony_ci  /**
644861847f8eSopenharmony_ci   * Represents a point on an elliptic curve in affine coordinates.
644961847f8eSopenharmony_ci   *
645061847f8eSopenharmony_ci   * @typedef Point
645161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
645261847f8eSopenharmony_ci   * @since 10
645361847f8eSopenharmony_ci   */
645461847f8eSopenharmony_ci  /**
645561847f8eSopenharmony_ci   * Represents a point on an elliptic curve in affine coordinates.
645661847f8eSopenharmony_ci   *
645761847f8eSopenharmony_ci   * @typedef Point
645861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
645961847f8eSopenharmony_ci   * @crossplatform
646061847f8eSopenharmony_ci   * @since 11
646161847f8eSopenharmony_ci   */
646261847f8eSopenharmony_ci  /**
646361847f8eSopenharmony_ci   * Represents a point on an elliptic curve in affine coordinates.
646461847f8eSopenharmony_ci   *
646561847f8eSopenharmony_ci   * @typedef Point
646661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
646761847f8eSopenharmony_ci   * @crossplatform
646861847f8eSopenharmony_ci   * @atomicservice
646961847f8eSopenharmony_ci   * @since 12
647061847f8eSopenharmony_ci   */
647161847f8eSopenharmony_ci  interface Point {
647261847f8eSopenharmony_ci    /**
647361847f8eSopenharmony_ci     * Indicates the affine x-coordinate.
647461847f8eSopenharmony_ci     *
647561847f8eSopenharmony_ci     * @type { bigint }
647661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
647761847f8eSopenharmony_ci     * @since 10
647861847f8eSopenharmony_ci     */
647961847f8eSopenharmony_ci    /**
648061847f8eSopenharmony_ci     * Indicates the affine x-coordinate.
648161847f8eSopenharmony_ci     *
648261847f8eSopenharmony_ci     * @type { bigint }
648361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
648461847f8eSopenharmony_ci     * @crossplatform
648561847f8eSopenharmony_ci     * @since 11
648661847f8eSopenharmony_ci     */
648761847f8eSopenharmony_ci    /**
648861847f8eSopenharmony_ci     * Indicates the affine x-coordinate.
648961847f8eSopenharmony_ci     *
649061847f8eSopenharmony_ci     * @type { bigint }
649161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
649261847f8eSopenharmony_ci     * @crossplatform
649361847f8eSopenharmony_ci     * @atomicservice
649461847f8eSopenharmony_ci     * @since 12
649561847f8eSopenharmony_ci     */
649661847f8eSopenharmony_ci    x: bigint;
649761847f8eSopenharmony_ci
649861847f8eSopenharmony_ci    /**
649961847f8eSopenharmony_ci     * Indicates the affine y-coordinate.
650061847f8eSopenharmony_ci     *
650161847f8eSopenharmony_ci     * @type { bigint }
650261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
650361847f8eSopenharmony_ci     * @since 10
650461847f8eSopenharmony_ci     */
650561847f8eSopenharmony_ci    /**
650661847f8eSopenharmony_ci     * Indicates the affine y-coordinate.
650761847f8eSopenharmony_ci     *
650861847f8eSopenharmony_ci     * @type { bigint }
650961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
651061847f8eSopenharmony_ci     * @crossplatform
651161847f8eSopenharmony_ci     * @since 11
651261847f8eSopenharmony_ci     */
651361847f8eSopenharmony_ci    /**
651461847f8eSopenharmony_ci     * Indicates the affine y-coordinate.
651561847f8eSopenharmony_ci     *
651661847f8eSopenharmony_ci     * @type { bigint }
651761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey 
651861847f8eSopenharmony_ci     * @crossplatform
651961847f8eSopenharmony_ci     * @atomicservice
652061847f8eSopenharmony_ci     * @since 12
652161847f8eSopenharmony_ci     */
652261847f8eSopenharmony_ci    y: bigint;
652361847f8eSopenharmony_ci  }
652461847f8eSopenharmony_ci
652561847f8eSopenharmony_ci  /**
652661847f8eSopenharmony_ci   * Specifies the set of common parameters used in the ECC algorithm.
652761847f8eSopenharmony_ci   *
652861847f8eSopenharmony_ci   * @typedef ECCCommonParamsSpec
652961847f8eSopenharmony_ci   * @extends AsyKeySpec
653061847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
653161847f8eSopenharmony_ci   * @since 10
653261847f8eSopenharmony_ci   */
653361847f8eSopenharmony_ci  /**
653461847f8eSopenharmony_ci   * Specifies the set of common parameters used in the ECC algorithm.
653561847f8eSopenharmony_ci   *
653661847f8eSopenharmony_ci   * @typedef ECCCommonParamsSpec
653761847f8eSopenharmony_ci   * @extends AsyKeySpec
653861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
653961847f8eSopenharmony_ci   * @crossplatform
654061847f8eSopenharmony_ci   * @since 11
654161847f8eSopenharmony_ci   */
654261847f8eSopenharmony_ci  /**
654361847f8eSopenharmony_ci   * Specifies the set of common parameters used in the ECC algorithm.
654461847f8eSopenharmony_ci   *
654561847f8eSopenharmony_ci   * @typedef ECCCommonParamsSpec
654661847f8eSopenharmony_ci   * @extends AsyKeySpec
654761847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
654861847f8eSopenharmony_ci   * @crossplatform
654961847f8eSopenharmony_ci   * @atomicservice
655061847f8eSopenharmony_ci   * @since 12
655161847f8eSopenharmony_ci   */
655261847f8eSopenharmony_ci  interface ECCCommonParamsSpec extends AsyKeySpec {
655361847f8eSopenharmony_ci    /**
655461847f8eSopenharmony_ci     * Indicates an elliptic curve finite field.
655561847f8eSopenharmony_ci     *
655661847f8eSopenharmony_ci     * @type { ECField }
655761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
655861847f8eSopenharmony_ci     * @since 10
655961847f8eSopenharmony_ci     */
656061847f8eSopenharmony_ci    /**
656161847f8eSopenharmony_ci     * Indicates an elliptic curve finite field.
656261847f8eSopenharmony_ci     *
656361847f8eSopenharmony_ci     * @type { ECField }
656461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
656561847f8eSopenharmony_ci     * @crossplatform
656661847f8eSopenharmony_ci     * @since 11
656761847f8eSopenharmony_ci     */
656861847f8eSopenharmony_ci    /**
656961847f8eSopenharmony_ci     * Indicates an elliptic curve finite field.
657061847f8eSopenharmony_ci     *
657161847f8eSopenharmony_ci     * @type { ECField }
657261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
657361847f8eSopenharmony_ci     * @crossplatform
657461847f8eSopenharmony_ci     * @atomicservice
657561847f8eSopenharmony_ci     * @since 12
657661847f8eSopenharmony_ci     */
657761847f8eSopenharmony_ci    field: ECField;
657861847f8eSopenharmony_ci
657961847f8eSopenharmony_ci    /**
658061847f8eSopenharmony_ci     * Indicates the first coefficient a of the elliptic curve.
658161847f8eSopenharmony_ci     *
658261847f8eSopenharmony_ci     * @type { bigint }
658361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
658461847f8eSopenharmony_ci     * @since 10
658561847f8eSopenharmony_ci     */
658661847f8eSopenharmony_ci    /**
658761847f8eSopenharmony_ci     * Indicates the first coefficient a of the elliptic curve.
658861847f8eSopenharmony_ci     *
658961847f8eSopenharmony_ci     * @type { bigint }
659061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
659161847f8eSopenharmony_ci     * @crossplatform
659261847f8eSopenharmony_ci     * @since 11
659361847f8eSopenharmony_ci     */
659461847f8eSopenharmony_ci    /**
659561847f8eSopenharmony_ci     * Indicates the first coefficient a of the elliptic curve.
659661847f8eSopenharmony_ci     *
659761847f8eSopenharmony_ci     * @type { bigint }
659861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
659961847f8eSopenharmony_ci     * @crossplatform
660061847f8eSopenharmony_ci     * @atomicservice
660161847f8eSopenharmony_ci     * @since 12
660261847f8eSopenharmony_ci     */
660361847f8eSopenharmony_ci    a: bigint;
660461847f8eSopenharmony_ci
660561847f8eSopenharmony_ci    /**
660661847f8eSopenharmony_ci     * Indicates the second coefficient b of the elliptic curve.
660761847f8eSopenharmony_ci     *
660861847f8eSopenharmony_ci     * @type { bigint }
660961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
661061847f8eSopenharmony_ci     * @since 10
661161847f8eSopenharmony_ci     */
661261847f8eSopenharmony_ci    /**
661361847f8eSopenharmony_ci     * Indicates the second coefficient b of the elliptic curve.
661461847f8eSopenharmony_ci     *
661561847f8eSopenharmony_ci     * @type { bigint }
661661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
661761847f8eSopenharmony_ci     * @crossplatform
661861847f8eSopenharmony_ci     * @since 11
661961847f8eSopenharmony_ci     */
662061847f8eSopenharmony_ci    /**
662161847f8eSopenharmony_ci     * Indicates the second coefficient b of the elliptic curve.
662261847f8eSopenharmony_ci     *
662361847f8eSopenharmony_ci     * @type { bigint }
662461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
662561847f8eSopenharmony_ci     * @crossplatform
662661847f8eSopenharmony_ci     * @atomicservice
662761847f8eSopenharmony_ci     * @since 12
662861847f8eSopenharmony_ci     */
662961847f8eSopenharmony_ci    b: bigint;
663061847f8eSopenharmony_ci
663161847f8eSopenharmony_ci    /**
663261847f8eSopenharmony_ci     * Indicates the base point g.
663361847f8eSopenharmony_ci     *
663461847f8eSopenharmony_ci     * @type { Point }
663561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
663661847f8eSopenharmony_ci     * @since 10
663761847f8eSopenharmony_ci     */
663861847f8eSopenharmony_ci    /**
663961847f8eSopenharmony_ci     * Indicates the base point g.
664061847f8eSopenharmony_ci     *
664161847f8eSopenharmony_ci     * @type { Point }
664261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
664361847f8eSopenharmony_ci     * @crossplatform
664461847f8eSopenharmony_ci     * @since 11
664561847f8eSopenharmony_ci     */
664661847f8eSopenharmony_ci    /**
664761847f8eSopenharmony_ci     * Indicates the base point g.
664861847f8eSopenharmony_ci     *
664961847f8eSopenharmony_ci     * @type { Point }
665061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
665161847f8eSopenharmony_ci     * @crossplatform
665261847f8eSopenharmony_ci     * @atomicservice
665361847f8eSopenharmony_ci     * @since 12
665461847f8eSopenharmony_ci     */
665561847f8eSopenharmony_ci    g: Point;
665661847f8eSopenharmony_ci
665761847f8eSopenharmony_ci    /**
665861847f8eSopenharmony_ci     * Indicates the order of the base point g.
665961847f8eSopenharmony_ci     *
666061847f8eSopenharmony_ci     * @type { bigint }
666161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
666261847f8eSopenharmony_ci     * @since 10
666361847f8eSopenharmony_ci     */
666461847f8eSopenharmony_ci    /**
666561847f8eSopenharmony_ci     * Indicates the order of the base point g.
666661847f8eSopenharmony_ci     *
666761847f8eSopenharmony_ci     * @type { bigint }
666861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
666961847f8eSopenharmony_ci     * @crossplatform
667061847f8eSopenharmony_ci     * @since 11
667161847f8eSopenharmony_ci     */
667261847f8eSopenharmony_ci    /**
667361847f8eSopenharmony_ci     * Indicates the order of the base point g.
667461847f8eSopenharmony_ci     *
667561847f8eSopenharmony_ci     * @type { bigint }
667661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
667761847f8eSopenharmony_ci     * @crossplatform
667861847f8eSopenharmony_ci     * @atomicservice
667961847f8eSopenharmony_ci     * @since 12
668061847f8eSopenharmony_ci     */
668161847f8eSopenharmony_ci    n: bigint;
668261847f8eSopenharmony_ci
668361847f8eSopenharmony_ci    /**
668461847f8eSopenharmony_ci     * Indicates the cofactor h.
668561847f8eSopenharmony_ci     *
668661847f8eSopenharmony_ci     * @type { number }
668761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
668861847f8eSopenharmony_ci     * @since 10
668961847f8eSopenharmony_ci     */
669061847f8eSopenharmony_ci    /**
669161847f8eSopenharmony_ci     * Indicates the cofactor h.
669261847f8eSopenharmony_ci     *
669361847f8eSopenharmony_ci     * @type { number }
669461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
669561847f8eSopenharmony_ci     * @crossplatform
669661847f8eSopenharmony_ci     * @since 11
669761847f8eSopenharmony_ci     */
669861847f8eSopenharmony_ci    /**
669961847f8eSopenharmony_ci     * Indicates the cofactor h.
670061847f8eSopenharmony_ci     *
670161847f8eSopenharmony_ci     * @type { number }
670261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
670361847f8eSopenharmony_ci     * @crossplatform
670461847f8eSopenharmony_ci     * @atomicservice
670561847f8eSopenharmony_ci     * @since 12
670661847f8eSopenharmony_ci     */
670761847f8eSopenharmony_ci    h: number;
670861847f8eSopenharmony_ci  }
670961847f8eSopenharmony_ci
671061847f8eSopenharmony_ci  /**
671161847f8eSopenharmony_ci   * Specifies the ECC private key with its associated parameters.
671261847f8eSopenharmony_ci   *
671361847f8eSopenharmony_ci   * @typedef ECCPriKeySpec
671461847f8eSopenharmony_ci   * @extends AsyKeySpec
671561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
671661847f8eSopenharmony_ci   * @since 10
671761847f8eSopenharmony_ci   */
671861847f8eSopenharmony_ci  /**
671961847f8eSopenharmony_ci   * Specifies the ECC private key with its associated parameters.
672061847f8eSopenharmony_ci   *
672161847f8eSopenharmony_ci   * @typedef ECCPriKeySpec
672261847f8eSopenharmony_ci   * @extends AsyKeySpec
672361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
672461847f8eSopenharmony_ci   * @crossplatform
672561847f8eSopenharmony_ci   * @since 11
672661847f8eSopenharmony_ci   */
672761847f8eSopenharmony_ci  /**
672861847f8eSopenharmony_ci   * Specifies the ECC private key with its associated parameters.
672961847f8eSopenharmony_ci   *
673061847f8eSopenharmony_ci   * @typedef ECCPriKeySpec
673161847f8eSopenharmony_ci   * @extends AsyKeySpec
673261847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
673361847f8eSopenharmony_ci   * @crossplatform
673461847f8eSopenharmony_ci   * @atomicservice
673561847f8eSopenharmony_ci   * @since 12
673661847f8eSopenharmony_ci   */
673761847f8eSopenharmony_ci  interface ECCPriKeySpec extends AsyKeySpec {
673861847f8eSopenharmony_ci    /**
673961847f8eSopenharmony_ci     * Indicates the ECC common parameters.
674061847f8eSopenharmony_ci     *
674161847f8eSopenharmony_ci     * @type { ECCCommonParamsSpec }
674261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
674361847f8eSopenharmony_ci     * @since 10
674461847f8eSopenharmony_ci     */
674561847f8eSopenharmony_ci    /**
674661847f8eSopenharmony_ci     * Indicates the ECC common parameters.
674761847f8eSopenharmony_ci     *
674861847f8eSopenharmony_ci     * @type { ECCCommonParamsSpec }
674961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
675061847f8eSopenharmony_ci     * @crossplatform
675161847f8eSopenharmony_ci     * @since 11
675261847f8eSopenharmony_ci     */
675361847f8eSopenharmony_ci    /**
675461847f8eSopenharmony_ci     * Indicates the ECC common parameters.
675561847f8eSopenharmony_ci     *
675661847f8eSopenharmony_ci     * @type { ECCCommonParamsSpec }
675761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
675861847f8eSopenharmony_ci     * @crossplatform
675961847f8eSopenharmony_ci     * @atomicservice
676061847f8eSopenharmony_ci     * @since 12
676161847f8eSopenharmony_ci     */
676261847f8eSopenharmony_ci    params: ECCCommonParamsSpec;
676361847f8eSopenharmony_ci
676461847f8eSopenharmony_ci    /**
676561847f8eSopenharmony_ci     * Indicates the private value of the ECC private key.
676661847f8eSopenharmony_ci     *
676761847f8eSopenharmony_ci     * @type { bigint }
676861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
676961847f8eSopenharmony_ci     * @since 10
677061847f8eSopenharmony_ci     */
677161847f8eSopenharmony_ci    /**
677261847f8eSopenharmony_ci     * Indicates the private value of the ECC private key.
677361847f8eSopenharmony_ci     *
677461847f8eSopenharmony_ci     * @type { bigint }
677561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
677661847f8eSopenharmony_ci     * @crossplatform
677761847f8eSopenharmony_ci     * @since 11
677861847f8eSopenharmony_ci     */
677961847f8eSopenharmony_ci    /**
678061847f8eSopenharmony_ci     * Indicates the private value of the ECC private key.
678161847f8eSopenharmony_ci     *
678261847f8eSopenharmony_ci     * @type { bigint }
678361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
678461847f8eSopenharmony_ci     * @crossplatform
678561847f8eSopenharmony_ci     * @atomicservice
678661847f8eSopenharmony_ci     * @since 12
678761847f8eSopenharmony_ci     */
678861847f8eSopenharmony_ci    sk: bigint;
678961847f8eSopenharmony_ci  }
679061847f8eSopenharmony_ci
679161847f8eSopenharmony_ci  /**
679261847f8eSopenharmony_ci   * Specifies the ECC public key with its associated parameters.
679361847f8eSopenharmony_ci   *
679461847f8eSopenharmony_ci   * @typedef ECCPubKeySpec
679561847f8eSopenharmony_ci   * @extends AsyKeySpec
679661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
679761847f8eSopenharmony_ci   * @since 10
679861847f8eSopenharmony_ci   */
679961847f8eSopenharmony_ci  /**
680061847f8eSopenharmony_ci   * Specifies the ECC public key with its associated parameters.
680161847f8eSopenharmony_ci   *
680261847f8eSopenharmony_ci   * @typedef ECCPubKeySpec
680361847f8eSopenharmony_ci   * @extends AsyKeySpec
680461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
680561847f8eSopenharmony_ci   * @crossplatform
680661847f8eSopenharmony_ci   * @since 11
680761847f8eSopenharmony_ci   */
680861847f8eSopenharmony_ci  /**
680961847f8eSopenharmony_ci   * Specifies the ECC public key with its associated parameters.
681061847f8eSopenharmony_ci   *
681161847f8eSopenharmony_ci   * @typedef ECCPubKeySpec
681261847f8eSopenharmony_ci   * @extends AsyKeySpec
681361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
681461847f8eSopenharmony_ci   * @crossplatform
681561847f8eSopenharmony_ci   * @atomicservice
681661847f8eSopenharmony_ci   * @since 12
681761847f8eSopenharmony_ci   */
681861847f8eSopenharmony_ci  interface ECCPubKeySpec extends AsyKeySpec {
681961847f8eSopenharmony_ci    /**
682061847f8eSopenharmony_ci     * Indicates the ECC common parameters.
682161847f8eSopenharmony_ci     *
682261847f8eSopenharmony_ci     * @type { ECCCommonParamsSpec }
682361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
682461847f8eSopenharmony_ci     * @since 10
682561847f8eSopenharmony_ci     */
682661847f8eSopenharmony_ci    /**
682761847f8eSopenharmony_ci     * Indicates the ECC common parameters.
682861847f8eSopenharmony_ci     *
682961847f8eSopenharmony_ci     * @type { ECCCommonParamsSpec }
683061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
683161847f8eSopenharmony_ci     * @crossplatform
683261847f8eSopenharmony_ci     * @since 11
683361847f8eSopenharmony_ci     */
683461847f8eSopenharmony_ci    /**
683561847f8eSopenharmony_ci     * Indicates the ECC common parameters.
683661847f8eSopenharmony_ci     *
683761847f8eSopenharmony_ci     * @type { ECCCommonParamsSpec }
683861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
683961847f8eSopenharmony_ci     * @crossplatform
684061847f8eSopenharmony_ci     * @atomicservice
684161847f8eSopenharmony_ci     * @since 12
684261847f8eSopenharmony_ci     */
684361847f8eSopenharmony_ci    params: ECCCommonParamsSpec;
684461847f8eSopenharmony_ci
684561847f8eSopenharmony_ci    /**
684661847f8eSopenharmony_ci     * Indicates the public point of the ECC public key.
684761847f8eSopenharmony_ci     *
684861847f8eSopenharmony_ci     * @type { Point }
684961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
685061847f8eSopenharmony_ci     * @since 10
685161847f8eSopenharmony_ci     */
685261847f8eSopenharmony_ci    /**
685361847f8eSopenharmony_ci     * Indicates the public point of the ECC public key.
685461847f8eSopenharmony_ci     *
685561847f8eSopenharmony_ci     * @type { Point }
685661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
685761847f8eSopenharmony_ci     * @crossplatform
685861847f8eSopenharmony_ci     * @since 11
685961847f8eSopenharmony_ci     */
686061847f8eSopenharmony_ci    /**
686161847f8eSopenharmony_ci     * Indicates the public point of the ECC public key.
686261847f8eSopenharmony_ci     *
686361847f8eSopenharmony_ci     * @type { Point }
686461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
686561847f8eSopenharmony_ci     * @crossplatform
686661847f8eSopenharmony_ci     * @atomicservice
686761847f8eSopenharmony_ci     * @since 12
686861847f8eSopenharmony_ci     */
686961847f8eSopenharmony_ci    pk: Point;
687061847f8eSopenharmony_ci  }
687161847f8eSopenharmony_ci
687261847f8eSopenharmony_ci  /**
687361847f8eSopenharmony_ci   * Specifies the ECC keypair with its associated parameters.
687461847f8eSopenharmony_ci   *
687561847f8eSopenharmony_ci   * @typedef ECCKeyPairSpec
687661847f8eSopenharmony_ci   * @extends AsyKeySpec
687761847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
687861847f8eSopenharmony_ci   * @since 10
687961847f8eSopenharmony_ci   */
688061847f8eSopenharmony_ci  /**
688161847f8eSopenharmony_ci   * Specifies the ECC keypair with its associated parameters.
688261847f8eSopenharmony_ci   *
688361847f8eSopenharmony_ci   * @typedef ECCKeyPairSpec
688461847f8eSopenharmony_ci   * @extends AsyKeySpec
688561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
688661847f8eSopenharmony_ci   * @crossplatform
688761847f8eSopenharmony_ci   * @since 11
688861847f8eSopenharmony_ci   */
688961847f8eSopenharmony_ci  /**
689061847f8eSopenharmony_ci   * Specifies the ECC keypair with its associated parameters.
689161847f8eSopenharmony_ci   *
689261847f8eSopenharmony_ci   * @typedef ECCKeyPairSpec
689361847f8eSopenharmony_ci   * @extends AsyKeySpec
689461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
689561847f8eSopenharmony_ci   * @crossplatform
689661847f8eSopenharmony_ci   * @atomicservice
689761847f8eSopenharmony_ci   * @since 12
689861847f8eSopenharmony_ci   */
689961847f8eSopenharmony_ci  interface ECCKeyPairSpec extends AsyKeySpec {
690061847f8eSopenharmony_ci    /**
690161847f8eSopenharmony_ci     * Indicates the ECC common parameters.
690261847f8eSopenharmony_ci     *
690361847f8eSopenharmony_ci     * @type { ECCCommonParamsSpec }
690461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
690561847f8eSopenharmony_ci     * @since 10
690661847f8eSopenharmony_ci     */
690761847f8eSopenharmony_ci    /**
690861847f8eSopenharmony_ci     * Indicates the ECC common parameters.
690961847f8eSopenharmony_ci     *
691061847f8eSopenharmony_ci     * @type { ECCCommonParamsSpec }
691161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
691261847f8eSopenharmony_ci     * @crossplatform
691361847f8eSopenharmony_ci     * @since 11
691461847f8eSopenharmony_ci     */
691561847f8eSopenharmony_ci    /**
691661847f8eSopenharmony_ci     * Indicates the ECC common parameters.
691761847f8eSopenharmony_ci     *
691861847f8eSopenharmony_ci     * @type { ECCCommonParamsSpec }
691961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
692061847f8eSopenharmony_ci     * @crossplatform
692161847f8eSopenharmony_ci     * @atomicservice
692261847f8eSopenharmony_ci     * @since 12
692361847f8eSopenharmony_ci     */
692461847f8eSopenharmony_ci    params: ECCCommonParamsSpec;
692561847f8eSopenharmony_ci
692661847f8eSopenharmony_ci    /**
692761847f8eSopenharmony_ci     * Indicates the private value of the ECC private key.
692861847f8eSopenharmony_ci     *
692961847f8eSopenharmony_ci     * @type { bigint }
693061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
693161847f8eSopenharmony_ci     * @since 10
693261847f8eSopenharmony_ci     */
693361847f8eSopenharmony_ci    /**
693461847f8eSopenharmony_ci     * Indicates the private value of the ECC private key.
693561847f8eSopenharmony_ci     *
693661847f8eSopenharmony_ci     * @type { bigint }
693761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
693861847f8eSopenharmony_ci     * @crossplatform
693961847f8eSopenharmony_ci     * @since 11
694061847f8eSopenharmony_ci     */
694161847f8eSopenharmony_ci    /**
694261847f8eSopenharmony_ci     * Indicates the private value of the ECC private key.
694361847f8eSopenharmony_ci     *
694461847f8eSopenharmony_ci     * @type { bigint }
694561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
694661847f8eSopenharmony_ci     * @crossplatform
694761847f8eSopenharmony_ci     * @atomicservice
694861847f8eSopenharmony_ci     * @since 12
694961847f8eSopenharmony_ci     */
695061847f8eSopenharmony_ci    sk: bigint;
695161847f8eSopenharmony_ci
695261847f8eSopenharmony_ci    /**
695361847f8eSopenharmony_ci     * Indicates the public point of the ECC public key.
695461847f8eSopenharmony_ci     *
695561847f8eSopenharmony_ci     * @type { Point }
695661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
695761847f8eSopenharmony_ci     * @since 10
695861847f8eSopenharmony_ci     */
695961847f8eSopenharmony_ci    /**
696061847f8eSopenharmony_ci     * Indicates the public point of the ECC public key.
696161847f8eSopenharmony_ci     *
696261847f8eSopenharmony_ci     * @type { Point }
696361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
696461847f8eSopenharmony_ci     * @crossplatform
696561847f8eSopenharmony_ci     * @since 11
696661847f8eSopenharmony_ci     */
696761847f8eSopenharmony_ci    /**
696861847f8eSopenharmony_ci     * Indicates the public point of the ECC public key.
696961847f8eSopenharmony_ci     *
697061847f8eSopenharmony_ci     * @type { Point }
697161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
697261847f8eSopenharmony_ci     * @crossplatform
697361847f8eSopenharmony_ci     * @atomicservice
697461847f8eSopenharmony_ci     * @since 12
697561847f8eSopenharmony_ci     */
697661847f8eSopenharmony_ci    pk: Point;
697761847f8eSopenharmony_ci  }
697861847f8eSopenharmony_ci
697961847f8eSopenharmony_ci  /**
698061847f8eSopenharmony_ci   * Key utilities for ECC Algorithm.
698161847f8eSopenharmony_ci   *
698261847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
698361847f8eSopenharmony_ci   * @crossplatform
698461847f8eSopenharmony_ci   * @since 11
698561847f8eSopenharmony_ci   */
698661847f8eSopenharmony_ci  /**
698761847f8eSopenharmony_ci   * Key utilities for ECC Algorithm.
698861847f8eSopenharmony_ci   *
698961847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
699061847f8eSopenharmony_ci   * @crossplatform
699161847f8eSopenharmony_ci   * @atomicservice
699261847f8eSopenharmony_ci   * @since 12
699361847f8eSopenharmony_ci   */
699461847f8eSopenharmony_ci  class ECCKeyUtil {
699561847f8eSopenharmony_ci    /**
699661847f8eSopenharmony_ci     * Create the common parameter set based on the curve name.
699761847f8eSopenharmony_ci     *
699861847f8eSopenharmony_ci     * @param { string } curveName - indicates curve name according to the ECC elliptic curve.
699961847f8eSopenharmony_ci     * @returns { ECCCommonParamsSpec } the ECC common params spec obj.
700061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
700161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
700261847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
700361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
700461847f8eSopenharmony_ci     * @static
700561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
700661847f8eSopenharmony_ci     * @crossplatform
700761847f8eSopenharmony_ci     * @since 11
700861847f8eSopenharmony_ci     */
700961847f8eSopenharmony_ci    /**
701061847f8eSopenharmony_ci     * Create the common parameter set based on the curve name.
701161847f8eSopenharmony_ci     *
701261847f8eSopenharmony_ci     * @param { string } curveName - indicates curve name according to the ECC elliptic curve.
701361847f8eSopenharmony_ci     * @returns { ECCCommonParamsSpec } the ECC common params spec obj.
701461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
701561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
701661847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
701761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
701861847f8eSopenharmony_ci     * @static
701961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
702061847f8eSopenharmony_ci     * @crossplatform
702161847f8eSopenharmony_ci     * @atomicservice
702261847f8eSopenharmony_ci     * @since 12
702361847f8eSopenharmony_ci     */
702461847f8eSopenharmony_ci    static genECCCommonParamsSpec(curveName: string): ECCCommonParamsSpec;
702561847f8eSopenharmony_ci
702661847f8eSopenharmony_ci    /**
702761847f8eSopenharmony_ci     * Used to convert the encoded point data to a point object, according to the ECC curve name.
702861847f8eSopenharmony_ci     *
702961847f8eSopenharmony_ci     * @param { string } curveName - indicates curve name according to the ECC elliptic curve.
703061847f8eSopenharmony_ci     * @param { Uint8Array } encodedPoint - the encoded ECC point data.
703161847f8eSopenharmony_ci     * @returns { Point } the ECC point object.
703261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
703361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
703461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
703561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
703661847f8eSopenharmony_ci     * @static
703761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
703861847f8eSopenharmony_ci     * @crossplatform
703961847f8eSopenharmony_ci     * @atomicservice
704061847f8eSopenharmony_ci     * @since 12
704161847f8eSopenharmony_ci     */
704261847f8eSopenharmony_ci    static convertPoint(curveName: string, encodedPoint: Uint8Array): Point;
704361847f8eSopenharmony_ci
704461847f8eSopenharmony_ci    /**
704561847f8eSopenharmony_ci     * Used to get the encoded point data from a point object, according to the ECC curve name.
704661847f8eSopenharmony_ci     *
704761847f8eSopenharmony_ci     * @param { string } curveName - indicates curve name according to the ECC elliptic curve.
704861847f8eSopenharmony_ci     * @param { Point } point - the ECC point object.
704961847f8eSopenharmony_ci     * @param { string } format - indicates the format of the encoded point data.
705061847f8eSopenharmony_ci     * @returns { Uint8Array } the encoded point data.
705161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
705261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
705361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
705461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
705561847f8eSopenharmony_ci     * @static
705661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
705761847f8eSopenharmony_ci     * @crossplatform
705861847f8eSopenharmony_ci     * @atomicservice
705961847f8eSopenharmony_ci     * @since 12
706061847f8eSopenharmony_ci     */
706161847f8eSopenharmony_ci    static getEncodedPoint(curveName: string, point: Point, format: string): Uint8Array;
706261847f8eSopenharmony_ci  }
706361847f8eSopenharmony_ci
706461847f8eSopenharmony_ci  /**
706561847f8eSopenharmony_ci   * Specifies the set of common parameters used in the DH algorithm.
706661847f8eSopenharmony_ci   *
706761847f8eSopenharmony_ci   * @typedef DHCommonParamsSpec
706861847f8eSopenharmony_ci   * @extends AsyKeySpec
706961847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
707061847f8eSopenharmony_ci   * @crossplatform
707161847f8eSopenharmony_ci   * @since 11
707261847f8eSopenharmony_ci   */
707361847f8eSopenharmony_ci  /**
707461847f8eSopenharmony_ci   * Specifies the set of common parameters used in the DH algorithm.
707561847f8eSopenharmony_ci   *
707661847f8eSopenharmony_ci   * @typedef DHCommonParamsSpec
707761847f8eSopenharmony_ci   * @extends AsyKeySpec
707861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
707961847f8eSopenharmony_ci   * @crossplatform
708061847f8eSopenharmony_ci   * @atomicservice
708161847f8eSopenharmony_ci   * @since 12
708261847f8eSopenharmony_ci   */
708361847f8eSopenharmony_ci  interface DHCommonParamsSpec extends AsyKeySpec {
708461847f8eSopenharmony_ci    /**
708561847f8eSopenharmony_ci     * Indicates the prime p.
708661847f8eSopenharmony_ci     *
708761847f8eSopenharmony_ci     * @type { bigint }
708861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
708961847f8eSopenharmony_ci     * @crossplatform
709061847f8eSopenharmony_ci     * @since 11
709161847f8eSopenharmony_ci     */
709261847f8eSopenharmony_ci    /**
709361847f8eSopenharmony_ci     * Indicates the prime p.
709461847f8eSopenharmony_ci     *
709561847f8eSopenharmony_ci     * @type { bigint }
709661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
709761847f8eSopenharmony_ci     * @crossplatform
709861847f8eSopenharmony_ci     * @atomicservice
709961847f8eSopenharmony_ci     * @since 12
710061847f8eSopenharmony_ci     */
710161847f8eSopenharmony_ci    p: bigint;
710261847f8eSopenharmony_ci
710361847f8eSopenharmony_ci    /**
710461847f8eSopenharmony_ci     * Indicates the generator g.
710561847f8eSopenharmony_ci     *
710661847f8eSopenharmony_ci     * @type { bigint }
710761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
710861847f8eSopenharmony_ci     * @crossplatform
710961847f8eSopenharmony_ci     * @since 11
711061847f8eSopenharmony_ci     */
711161847f8eSopenharmony_ci    /**
711261847f8eSopenharmony_ci     * Indicates the generator g.
711361847f8eSopenharmony_ci     *
711461847f8eSopenharmony_ci     * @type { bigint }
711561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
711661847f8eSopenharmony_ci     * @crossplatform
711761847f8eSopenharmony_ci     * @atomicservice
711861847f8eSopenharmony_ci     * @since 12
711961847f8eSopenharmony_ci     */
712061847f8eSopenharmony_ci    g: bigint;
712161847f8eSopenharmony_ci
712261847f8eSopenharmony_ci    /**
712361847f8eSopenharmony_ci     * Indicates the byte length of the private key.
712461847f8eSopenharmony_ci     *
712561847f8eSopenharmony_ci     * @type { number }
712661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
712761847f8eSopenharmony_ci     * @crossplatform
712861847f8eSopenharmony_ci     * @since 11
712961847f8eSopenharmony_ci     */
713061847f8eSopenharmony_ci    /**
713161847f8eSopenharmony_ci     * Indicates the byte length of the private key.
713261847f8eSopenharmony_ci     *
713361847f8eSopenharmony_ci     * @type { number }
713461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
713561847f8eSopenharmony_ci     * @crossplatform
713661847f8eSopenharmony_ci     * @atomicservice
713761847f8eSopenharmony_ci     * @since 12
713861847f8eSopenharmony_ci     */
713961847f8eSopenharmony_ci    l: number;
714061847f8eSopenharmony_ci  }
714161847f8eSopenharmony_ci
714261847f8eSopenharmony_ci  /**
714361847f8eSopenharmony_ci   * Specifies the DH private key with its associated parameters.
714461847f8eSopenharmony_ci   *
714561847f8eSopenharmony_ci   * @typedef DHPriKeySpec
714661847f8eSopenharmony_ci   * @extends AsyKeySpec
714761847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
714861847f8eSopenharmony_ci   * @crossplatform
714961847f8eSopenharmony_ci   * @since 11
715061847f8eSopenharmony_ci   */
715161847f8eSopenharmony_ci  /**
715261847f8eSopenharmony_ci   * Specifies the DH private key with its associated parameters.
715361847f8eSopenharmony_ci   *
715461847f8eSopenharmony_ci   * @typedef DHPriKeySpec
715561847f8eSopenharmony_ci   * @extends AsyKeySpec
715661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
715761847f8eSopenharmony_ci   * @crossplatform
715861847f8eSopenharmony_ci   * @atomicservice
715961847f8eSopenharmony_ci   * @since 12
716061847f8eSopenharmony_ci   */
716161847f8eSopenharmony_ci  interface DHPriKeySpec extends AsyKeySpec {
716261847f8eSopenharmony_ci    /**
716361847f8eSopenharmony_ci     * Indicates the DH common parameters.
716461847f8eSopenharmony_ci     *
716561847f8eSopenharmony_ci     * @type { DHCommonParamsSpec }
716661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
716761847f8eSopenharmony_ci     * @crossplatform
716861847f8eSopenharmony_ci     * @since 11
716961847f8eSopenharmony_ci     */
717061847f8eSopenharmony_ci    /**
717161847f8eSopenharmony_ci     * Indicates the DH common parameters.
717261847f8eSopenharmony_ci     *
717361847f8eSopenharmony_ci     * @type { DHCommonParamsSpec }
717461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
717561847f8eSopenharmony_ci     * @crossplatform
717661847f8eSopenharmony_ci     * @atomicservice
717761847f8eSopenharmony_ci     * @since 12
717861847f8eSopenharmony_ci     */
717961847f8eSopenharmony_ci    params: DHCommonParamsSpec;
718061847f8eSopenharmony_ci
718161847f8eSopenharmony_ci    /**
718261847f8eSopenharmony_ci     * Indicates the private value of the DH private key.
718361847f8eSopenharmony_ci     *
718461847f8eSopenharmony_ci     * @type { bigint }
718561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
718661847f8eSopenharmony_ci     * @crossplatform
718761847f8eSopenharmony_ci     * @since 11
718861847f8eSopenharmony_ci     */
718961847f8eSopenharmony_ci    /**
719061847f8eSopenharmony_ci     * Indicates the private value of the DH private key.
719161847f8eSopenharmony_ci     *
719261847f8eSopenharmony_ci     * @type { bigint }
719361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
719461847f8eSopenharmony_ci     * @crossplatform
719561847f8eSopenharmony_ci     * @atomicservice
719661847f8eSopenharmony_ci     * @since 12
719761847f8eSopenharmony_ci     */
719861847f8eSopenharmony_ci    sk: bigint;
719961847f8eSopenharmony_ci  }
720061847f8eSopenharmony_ci
720161847f8eSopenharmony_ci  /**
720261847f8eSopenharmony_ci   * Specifies the DH public key with its associated parameters.
720361847f8eSopenharmony_ci   *
720461847f8eSopenharmony_ci   * @typedef DHPubKeySpec
720561847f8eSopenharmony_ci   * @extends AsyKeySpec
720661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
720761847f8eSopenharmony_ci   * @crossplatform
720861847f8eSopenharmony_ci   * @since 11
720961847f8eSopenharmony_ci   */
721061847f8eSopenharmony_ci  /**
721161847f8eSopenharmony_ci   * Specifies the DH public key with its associated parameters.
721261847f8eSopenharmony_ci   *
721361847f8eSopenharmony_ci   * @typedef DHPubKeySpec
721461847f8eSopenharmony_ci   * @extends AsyKeySpec
721561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
721661847f8eSopenharmony_ci   * @crossplatform
721761847f8eSopenharmony_ci   * @atomicservice
721861847f8eSopenharmony_ci   * @since 12
721961847f8eSopenharmony_ci   */
722061847f8eSopenharmony_ci  interface DHPubKeySpec extends AsyKeySpec {
722161847f8eSopenharmony_ci    /**
722261847f8eSopenharmony_ci     * Indicates the DH common parameters.
722361847f8eSopenharmony_ci     *
722461847f8eSopenharmony_ci     * @type { DHCommonParamsSpec }
722561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
722661847f8eSopenharmony_ci     * @crossplatform
722761847f8eSopenharmony_ci     * @since 11
722861847f8eSopenharmony_ci     */
722961847f8eSopenharmony_ci    /**
723061847f8eSopenharmony_ci     * Indicates the DH common parameters.
723161847f8eSopenharmony_ci     *
723261847f8eSopenharmony_ci     * @type { DHCommonParamsSpec }
723361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
723461847f8eSopenharmony_ci     * @crossplatform
723561847f8eSopenharmony_ci     * @atomicservice
723661847f8eSopenharmony_ci     * @since 12
723761847f8eSopenharmony_ci     */
723861847f8eSopenharmony_ci    params: DHCommonParamsSpec;
723961847f8eSopenharmony_ci
724061847f8eSopenharmony_ci    /**
724161847f8eSopenharmony_ci     * Indicates the public value of the DH public key.
724261847f8eSopenharmony_ci     *
724361847f8eSopenharmony_ci     * @type { bigint }
724461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
724561847f8eSopenharmony_ci     * @crossplatform
724661847f8eSopenharmony_ci     * @since 11
724761847f8eSopenharmony_ci     */
724861847f8eSopenharmony_ci    /**
724961847f8eSopenharmony_ci     * Indicates the public value of the DH public key.
725061847f8eSopenharmony_ci     *
725161847f8eSopenharmony_ci     * @type { bigint }
725261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
725361847f8eSopenharmony_ci     * @crossplatform
725461847f8eSopenharmony_ci     * @atomicservice
725561847f8eSopenharmony_ci     * @since 12
725661847f8eSopenharmony_ci     */
725761847f8eSopenharmony_ci    pk: bigint;
725861847f8eSopenharmony_ci  }
725961847f8eSopenharmony_ci
726061847f8eSopenharmony_ci  /**
726161847f8eSopenharmony_ci   * Specifies the DH keypair with its associated parameters.
726261847f8eSopenharmony_ci   *
726361847f8eSopenharmony_ci   * @typedef DHKeyPairSpec
726461847f8eSopenharmony_ci   * @extends AsyKeySpec
726561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
726661847f8eSopenharmony_ci   * @crossplatform
726761847f8eSopenharmony_ci   * @since 11
726861847f8eSopenharmony_ci   */
726961847f8eSopenharmony_ci  /**
727061847f8eSopenharmony_ci   * Specifies the DH keypair with its associated parameters.
727161847f8eSopenharmony_ci   *
727261847f8eSopenharmony_ci   * @typedef DHKeyPairSpec
727361847f8eSopenharmony_ci   * @extends AsyKeySpec
727461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
727561847f8eSopenharmony_ci   * @crossplatform
727661847f8eSopenharmony_ci   * @atomicservice
727761847f8eSopenharmony_ci   * @since 12
727861847f8eSopenharmony_ci   */
727961847f8eSopenharmony_ci  interface DHKeyPairSpec extends AsyKeySpec {
728061847f8eSopenharmony_ci    /**
728161847f8eSopenharmony_ci     * Indicates the DH common parameters.
728261847f8eSopenharmony_ci     *
728361847f8eSopenharmony_ci     * @type { DHCommonParamsSpec }
728461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
728561847f8eSopenharmony_ci     * @crossplatform
728661847f8eSopenharmony_ci     * @since 11
728761847f8eSopenharmony_ci     */
728861847f8eSopenharmony_ci    /**
728961847f8eSopenharmony_ci     * Indicates the DH common parameters.
729061847f8eSopenharmony_ci     *
729161847f8eSopenharmony_ci     * @type { DHCommonParamsSpec }
729261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
729361847f8eSopenharmony_ci     * @crossplatform
729461847f8eSopenharmony_ci     * @atomicservice
729561847f8eSopenharmony_ci     * @since 12
729661847f8eSopenharmony_ci     */
729761847f8eSopenharmony_ci    params: DHCommonParamsSpec;
729861847f8eSopenharmony_ci
729961847f8eSopenharmony_ci    /**
730061847f8eSopenharmony_ci     * Indicates the private value of the DH private key.
730161847f8eSopenharmony_ci     *
730261847f8eSopenharmony_ci     * @type { bigint }
730361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
730461847f8eSopenharmony_ci     * @crossplatform
730561847f8eSopenharmony_ci     * @since 11
730661847f8eSopenharmony_ci     */
730761847f8eSopenharmony_ci    /**
730861847f8eSopenharmony_ci     * Indicates the private value of the DH private key.
730961847f8eSopenharmony_ci     *
731061847f8eSopenharmony_ci     * @type { bigint }
731161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
731261847f8eSopenharmony_ci     * @crossplatform
731361847f8eSopenharmony_ci     * @atomicservice
731461847f8eSopenharmony_ci     * @since 12
731561847f8eSopenharmony_ci     */
731661847f8eSopenharmony_ci    sk: bigint;
731761847f8eSopenharmony_ci
731861847f8eSopenharmony_ci    /**
731961847f8eSopenharmony_ci     * Indicates the public value of the DH public key.
732061847f8eSopenharmony_ci     *
732161847f8eSopenharmony_ci     * @type { bigint }
732261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
732361847f8eSopenharmony_ci     * @crossplatform
732461847f8eSopenharmony_ci     * @since 11
732561847f8eSopenharmony_ci     */
732661847f8eSopenharmony_ci    /**
732761847f8eSopenharmony_ci     * Indicates the public value of the DH public key.
732861847f8eSopenharmony_ci     *
732961847f8eSopenharmony_ci     * @type { bigint }
733061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
733161847f8eSopenharmony_ci     * @crossplatform
733261847f8eSopenharmony_ci     * @atomicservice
733361847f8eSopenharmony_ci     * @since 12
733461847f8eSopenharmony_ci     */
733561847f8eSopenharmony_ci    pk: bigint;
733661847f8eSopenharmony_ci  }
733761847f8eSopenharmony_ci
733861847f8eSopenharmony_ci  /**
733961847f8eSopenharmony_ci   * Key utilities for DH Algorithm.
734061847f8eSopenharmony_ci   *
734161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
734261847f8eSopenharmony_ci   * @crossplatform
734361847f8eSopenharmony_ci   * @since 11
734461847f8eSopenharmony_ci   */
734561847f8eSopenharmony_ci  /**
734661847f8eSopenharmony_ci   * Key utilities for DH Algorithm.
734761847f8eSopenharmony_ci   *
734861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
734961847f8eSopenharmony_ci   * @crossplatform
735061847f8eSopenharmony_ci   * @atomicservice
735161847f8eSopenharmony_ci   * @since 12
735261847f8eSopenharmony_ci   */
735361847f8eSopenharmony_ci  class DHKeyUtil {
735461847f8eSopenharmony_ci    /**
735561847f8eSopenharmony_ci     * Create the common parameter set.
735661847f8eSopenharmony_ci     *
735761847f8eSopenharmony_ci     * @param { number } pLen - indicates the byte length of the prime p.
735861847f8eSopenharmony_ci     * @param { number } [skLen] - indicates the byte length of the private key.
735961847f8eSopenharmony_ci     * @returns { DHCommonParamsSpec } the DH common params spec obj.
736061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
736161847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
736261847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
736361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
736461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
736561847f8eSopenharmony_ci     * @static
736661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
736761847f8eSopenharmony_ci     * @crossplatform
736861847f8eSopenharmony_ci     * @since 11
736961847f8eSopenharmony_ci     */
737061847f8eSopenharmony_ci    /**
737161847f8eSopenharmony_ci     * Create the common parameter set.
737261847f8eSopenharmony_ci     *
737361847f8eSopenharmony_ci     * @param { number } pLen - indicates the byte length of the prime p.
737461847f8eSopenharmony_ci     * @param { number } [skLen] - indicates the byte length of the private key.
737561847f8eSopenharmony_ci     * @returns { DHCommonParamsSpec } the DH common params spec obj.
737661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
737761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
737861847f8eSopenharmony_ci     * @throws { BusinessError } 801 - this operation is not supported.
737961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
738061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
738161847f8eSopenharmony_ci     * @static
738261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
738361847f8eSopenharmony_ci     * @crossplatform
738461847f8eSopenharmony_ci     * @atomicservice
738561847f8eSopenharmony_ci     * @since 12
738661847f8eSopenharmony_ci     */
738761847f8eSopenharmony_ci    static genDHCommonParamsSpec(pLen: number, skLen?: number): DHCommonParamsSpec;
738861847f8eSopenharmony_ci  }
738961847f8eSopenharmony_ci
739061847f8eSopenharmony_ci  /**
739161847f8eSopenharmony_ci   * Specifies the ED25519 private key with its associated parameters.
739261847f8eSopenharmony_ci   *
739361847f8eSopenharmony_ci   * @typedef ED25519PriKeySpec
739461847f8eSopenharmony_ci   * @extends AsyKeySpec
739561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
739661847f8eSopenharmony_ci   * @crossplatform
739761847f8eSopenharmony_ci   * @since 11
739861847f8eSopenharmony_ci   */
739961847f8eSopenharmony_ci  /**
740061847f8eSopenharmony_ci   * Specifies the ED25519 private key with its associated parameters.
740161847f8eSopenharmony_ci   *
740261847f8eSopenharmony_ci   * @typedef ED25519PriKeySpec
740361847f8eSopenharmony_ci   * @extends AsyKeySpec
740461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
740561847f8eSopenharmony_ci   * @crossplatform
740661847f8eSopenharmony_ci   * @atomicservice
740761847f8eSopenharmony_ci   * @since 12
740861847f8eSopenharmony_ci   */
740961847f8eSopenharmony_ci  interface ED25519PriKeySpec extends AsyKeySpec {
741061847f8eSopenharmony_ci    /**
741161847f8eSopenharmony_ci     * Indicates the private value of the ED25519 private key.
741261847f8eSopenharmony_ci     *
741361847f8eSopenharmony_ci     * @type { bigint }
741461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
741561847f8eSopenharmony_ci     * @crossplatform
741661847f8eSopenharmony_ci     * @since 11
741761847f8eSopenharmony_ci     */
741861847f8eSopenharmony_ci    /**
741961847f8eSopenharmony_ci     * Indicates the private value of the ED25519 private key.
742061847f8eSopenharmony_ci     *
742161847f8eSopenharmony_ci     * @type { bigint }
742261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
742361847f8eSopenharmony_ci     * @crossplatform
742461847f8eSopenharmony_ci     * @atomicservice
742561847f8eSopenharmony_ci     * @since 12
742661847f8eSopenharmony_ci     */
742761847f8eSopenharmony_ci    sk: bigint;
742861847f8eSopenharmony_ci  }
742961847f8eSopenharmony_ci
743061847f8eSopenharmony_ci  /**
743161847f8eSopenharmony_ci   * Specifies the ED25519 public key with its associated parameters.
743261847f8eSopenharmony_ci   *
743361847f8eSopenharmony_ci   * @typedef ED25519PubKeySpec
743461847f8eSopenharmony_ci   * @extends AsyKeySpec
743561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
743661847f8eSopenharmony_ci   * @crossplatform
743761847f8eSopenharmony_ci   * @since 11
743861847f8eSopenharmony_ci   */
743961847f8eSopenharmony_ci  /**
744061847f8eSopenharmony_ci   * Specifies the ED25519 public key with its associated parameters.
744161847f8eSopenharmony_ci   *
744261847f8eSopenharmony_ci   * @typedef ED25519PubKeySpec
744361847f8eSopenharmony_ci   * @extends AsyKeySpec
744461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
744561847f8eSopenharmony_ci   * @crossplatform
744661847f8eSopenharmony_ci   * @atomicservice
744761847f8eSopenharmony_ci   * @since 12
744861847f8eSopenharmony_ci   */
744961847f8eSopenharmony_ci  interface ED25519PubKeySpec extends AsyKeySpec {
745061847f8eSopenharmony_ci    /**
745161847f8eSopenharmony_ci     * Indicates the public value of the ED25519 public key.
745261847f8eSopenharmony_ci     *
745361847f8eSopenharmony_ci     * @type { bigint }
745461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
745561847f8eSopenharmony_ci     * @crossplatform
745661847f8eSopenharmony_ci     * @since 11
745761847f8eSopenharmony_ci     */
745861847f8eSopenharmony_ci    /**
745961847f8eSopenharmony_ci     * Indicates the public value of the ED25519 public key.
746061847f8eSopenharmony_ci     *
746161847f8eSopenharmony_ci     * @type { bigint }
746261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
746361847f8eSopenharmony_ci     * @crossplatform
746461847f8eSopenharmony_ci     * @atomicservice
746561847f8eSopenharmony_ci     * @since 12
746661847f8eSopenharmony_ci     */
746761847f8eSopenharmony_ci    pk: bigint;
746861847f8eSopenharmony_ci  }
746961847f8eSopenharmony_ci
747061847f8eSopenharmony_ci  /**
747161847f8eSopenharmony_ci   * Specifies the ED25519 keypair with its associated parameters.
747261847f8eSopenharmony_ci   *
747361847f8eSopenharmony_ci   * @typedef ED25519KeyPairSpec
747461847f8eSopenharmony_ci   * @extends AsyKeySpec
747561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
747661847f8eSopenharmony_ci   * @crossplatform
747761847f8eSopenharmony_ci   * @since 11
747861847f8eSopenharmony_ci   */
747961847f8eSopenharmony_ci  /**
748061847f8eSopenharmony_ci   * Specifies the ED25519 keypair with its associated parameters.
748161847f8eSopenharmony_ci   *
748261847f8eSopenharmony_ci   * @typedef ED25519KeyPairSpec
748361847f8eSopenharmony_ci   * @extends AsyKeySpec
748461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
748561847f8eSopenharmony_ci   * @crossplatform
748661847f8eSopenharmony_ci   * @atomicservice
748761847f8eSopenharmony_ci   * @since 12
748861847f8eSopenharmony_ci   */
748961847f8eSopenharmony_ci  interface ED25519KeyPairSpec extends AsyKeySpec {
749061847f8eSopenharmony_ci    /**
749161847f8eSopenharmony_ci     * Indicates the private value of the ED25519 private key.
749261847f8eSopenharmony_ci     *
749361847f8eSopenharmony_ci     * @type { bigint }
749461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
749561847f8eSopenharmony_ci     * @crossplatform
749661847f8eSopenharmony_ci     * @since 11
749761847f8eSopenharmony_ci     */
749861847f8eSopenharmony_ci    /**
749961847f8eSopenharmony_ci     * Indicates the private value of the ED25519 private key.
750061847f8eSopenharmony_ci     *
750161847f8eSopenharmony_ci     * @type { bigint }
750261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
750361847f8eSopenharmony_ci     * @crossplatform
750461847f8eSopenharmony_ci     * @atomicservice
750561847f8eSopenharmony_ci     * @since 12
750661847f8eSopenharmony_ci     */
750761847f8eSopenharmony_ci    sk: bigint;
750861847f8eSopenharmony_ci
750961847f8eSopenharmony_ci    /**
751061847f8eSopenharmony_ci     * Indicates the public value of the ED25519 public key.
751161847f8eSopenharmony_ci     *
751261847f8eSopenharmony_ci     * @type { bigint }
751361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
751461847f8eSopenharmony_ci     * @crossplatform
751561847f8eSopenharmony_ci     * @since 11
751661847f8eSopenharmony_ci     */
751761847f8eSopenharmony_ci    /**
751861847f8eSopenharmony_ci     * Indicates the public value of the ED25519 public key.
751961847f8eSopenharmony_ci     *
752061847f8eSopenharmony_ci     * @type { bigint }
752161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
752261847f8eSopenharmony_ci     * @crossplatform
752361847f8eSopenharmony_ci     * @atomicservice
752461847f8eSopenharmony_ci     * @since 12
752561847f8eSopenharmony_ci     */
752661847f8eSopenharmony_ci    pk: bigint;
752761847f8eSopenharmony_ci  }
752861847f8eSopenharmony_ci
752961847f8eSopenharmony_ci  /**
753061847f8eSopenharmony_ci   * Specifies the X25519 private key with its associated parameters.
753161847f8eSopenharmony_ci   *
753261847f8eSopenharmony_ci   * @typedef X25519PriKeySpec
753361847f8eSopenharmony_ci   * @extends AsyKeySpec
753461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
753561847f8eSopenharmony_ci   * @crossplatform
753661847f8eSopenharmony_ci   * @since 11
753761847f8eSopenharmony_ci   */
753861847f8eSopenharmony_ci  /**
753961847f8eSopenharmony_ci   * Specifies the X25519 private key with its associated parameters.
754061847f8eSopenharmony_ci   *
754161847f8eSopenharmony_ci   * @typedef X25519PriKeySpec
754261847f8eSopenharmony_ci   * @extends AsyKeySpec
754361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
754461847f8eSopenharmony_ci   * @crossplatform
754561847f8eSopenharmony_ci   * @atomicservice
754661847f8eSopenharmony_ci   * @since 12
754761847f8eSopenharmony_ci   */
754861847f8eSopenharmony_ci  interface X25519PriKeySpec extends AsyKeySpec {
754961847f8eSopenharmony_ci    /**
755061847f8eSopenharmony_ci     * Indicates the private value of the X25519 private key.
755161847f8eSopenharmony_ci     *
755261847f8eSopenharmony_ci     * @type { bigint }
755361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
755461847f8eSopenharmony_ci     * @crossplatform
755561847f8eSopenharmony_ci     * @since 11
755661847f8eSopenharmony_ci     */
755761847f8eSopenharmony_ci    /**
755861847f8eSopenharmony_ci     * Indicates the private value of the X25519 private key.
755961847f8eSopenharmony_ci     *
756061847f8eSopenharmony_ci     * @type { bigint }
756161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
756261847f8eSopenharmony_ci     * @crossplatform
756361847f8eSopenharmony_ci     * @atomicservice
756461847f8eSopenharmony_ci     * @since 12
756561847f8eSopenharmony_ci     */
756661847f8eSopenharmony_ci    sk: bigint;
756761847f8eSopenharmony_ci  }
756861847f8eSopenharmony_ci
756961847f8eSopenharmony_ci  /**
757061847f8eSopenharmony_ci   * Specifies the X25519 public key with its associated parameters.
757161847f8eSopenharmony_ci   *
757261847f8eSopenharmony_ci   * @typedef X25519PubKeySpec
757361847f8eSopenharmony_ci   * @extends AsyKeySpec
757461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
757561847f8eSopenharmony_ci   * @crossplatform
757661847f8eSopenharmony_ci   * @since 11
757761847f8eSopenharmony_ci   */
757861847f8eSopenharmony_ci  /**
757961847f8eSopenharmony_ci   * Specifies the X25519 public key with its associated parameters.
758061847f8eSopenharmony_ci   *
758161847f8eSopenharmony_ci   * @typedef X25519PubKeySpec
758261847f8eSopenharmony_ci   * @extends AsyKeySpec
758361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
758461847f8eSopenharmony_ci   * @crossplatform
758561847f8eSopenharmony_ci   * @atomicservice
758661847f8eSopenharmony_ci   * @since 12
758761847f8eSopenharmony_ci   */
758861847f8eSopenharmony_ci  interface X25519PubKeySpec extends AsyKeySpec {
758961847f8eSopenharmony_ci    /**
759061847f8eSopenharmony_ci     * Indicates the public value of the X25519 public key.
759161847f8eSopenharmony_ci     *
759261847f8eSopenharmony_ci     * @type { bigint }
759361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
759461847f8eSopenharmony_ci     * @crossplatform
759561847f8eSopenharmony_ci     * @since 11
759661847f8eSopenharmony_ci     */
759761847f8eSopenharmony_ci    /**
759861847f8eSopenharmony_ci     * Indicates the public value of the X25519 public key.
759961847f8eSopenharmony_ci     *
760061847f8eSopenharmony_ci     * @type { bigint }
760161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
760261847f8eSopenharmony_ci     * @crossplatform
760361847f8eSopenharmony_ci     * @atomicservice
760461847f8eSopenharmony_ci     * @since 12
760561847f8eSopenharmony_ci     */
760661847f8eSopenharmony_ci    pk: bigint;
760761847f8eSopenharmony_ci  }
760861847f8eSopenharmony_ci
760961847f8eSopenharmony_ci  /**
761061847f8eSopenharmony_ci   * Specifies the X25519 keypair with its associated parameters.
761161847f8eSopenharmony_ci   *
761261847f8eSopenharmony_ci   * @typedef X25519KeyPairSpec
761361847f8eSopenharmony_ci   * @extends AsyKeySpec
761461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
761561847f8eSopenharmony_ci   * @crossplatform
761661847f8eSopenharmony_ci   * @since 11
761761847f8eSopenharmony_ci   */
761861847f8eSopenharmony_ci  /**
761961847f8eSopenharmony_ci   * Specifies the X25519 keypair with its associated parameters.
762061847f8eSopenharmony_ci   *
762161847f8eSopenharmony_ci   * @typedef X25519KeyPairSpec
762261847f8eSopenharmony_ci   * @extends AsyKeySpec
762361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
762461847f8eSopenharmony_ci   * @crossplatform
762561847f8eSopenharmony_ci   * @atomicservice
762661847f8eSopenharmony_ci   * @since 12
762761847f8eSopenharmony_ci   */
762861847f8eSopenharmony_ci  interface X25519KeyPairSpec extends AsyKeySpec {
762961847f8eSopenharmony_ci    /**
763061847f8eSopenharmony_ci     * Indicates the private value of the X25519 private key.
763161847f8eSopenharmony_ci     *
763261847f8eSopenharmony_ci     * @type { bigint }
763361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
763461847f8eSopenharmony_ci     * @crossplatform
763561847f8eSopenharmony_ci     * @since 11
763661847f8eSopenharmony_ci     */
763761847f8eSopenharmony_ci    /**
763861847f8eSopenharmony_ci     * Indicates the private value of the X25519 private key.
763961847f8eSopenharmony_ci     *
764061847f8eSopenharmony_ci     * @type { bigint }
764161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
764261847f8eSopenharmony_ci     * @crossplatform
764361847f8eSopenharmony_ci     * @atomicservice
764461847f8eSopenharmony_ci     * @since 12
764561847f8eSopenharmony_ci     */
764661847f8eSopenharmony_ci    sk: bigint;
764761847f8eSopenharmony_ci
764861847f8eSopenharmony_ci    /**
764961847f8eSopenharmony_ci     * Indicates the public value of the X25519 public key.
765061847f8eSopenharmony_ci     *
765161847f8eSopenharmony_ci     * @type { bigint }
765261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
765361847f8eSopenharmony_ci     * @crossplatform
765461847f8eSopenharmony_ci     * @since 11
765561847f8eSopenharmony_ci     */
765661847f8eSopenharmony_ci    /**
765761847f8eSopenharmony_ci     * Indicates the public value of the X25519 public key.
765861847f8eSopenharmony_ci     *
765961847f8eSopenharmony_ci     * @type { bigint }
766061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
766161847f8eSopenharmony_ci     * @crossplatform
766261847f8eSopenharmony_ci     * @atomicservice
766361847f8eSopenharmony_ci     * @since 12
766461847f8eSopenharmony_ci     */
766561847f8eSopenharmony_ci    pk: bigint;
766661847f8eSopenharmony_ci  }
766761847f8eSopenharmony_ci
766861847f8eSopenharmony_ci  /**
766961847f8eSopenharmony_ci   * Specifies the set of common parameters used in the RSA algorithm.
767061847f8eSopenharmony_ci   *
767161847f8eSopenharmony_ci   * @typedef RSACommonParamsSpec
767261847f8eSopenharmony_ci   * @extends AsyKeySpec
767361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
767461847f8eSopenharmony_ci   * @since 10
767561847f8eSopenharmony_ci   */
767661847f8eSopenharmony_ci  /**
767761847f8eSopenharmony_ci   * Specifies the set of common parameters used in the RSA algorithm.
767861847f8eSopenharmony_ci   *
767961847f8eSopenharmony_ci   * @typedef RSACommonParamsSpec
768061847f8eSopenharmony_ci   * @extends AsyKeySpec
768161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
768261847f8eSopenharmony_ci   * @crossplatform
768361847f8eSopenharmony_ci   * @since 11
768461847f8eSopenharmony_ci   */
768561847f8eSopenharmony_ci  /**
768661847f8eSopenharmony_ci   * Specifies the set of common parameters used in the RSA algorithm.
768761847f8eSopenharmony_ci   *
768861847f8eSopenharmony_ci   * @typedef RSACommonParamsSpec
768961847f8eSopenharmony_ci   * @extends AsyKeySpec
769061847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
769161847f8eSopenharmony_ci   * @crossplatform
769261847f8eSopenharmony_ci   * @atomicservice
769361847f8eSopenharmony_ci   * @since 12
769461847f8eSopenharmony_ci   */
769561847f8eSopenharmony_ci  interface RSACommonParamsSpec extends AsyKeySpec {
769661847f8eSopenharmony_ci    /**
769761847f8eSopenharmony_ci     * Indicates the modulus n.
769861847f8eSopenharmony_ci     *
769961847f8eSopenharmony_ci     * @type { bigint }
770061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
770161847f8eSopenharmony_ci     * @since 10
770261847f8eSopenharmony_ci     */
770361847f8eSopenharmony_ci    /**
770461847f8eSopenharmony_ci     * Indicates the modulus n.
770561847f8eSopenharmony_ci     *
770661847f8eSopenharmony_ci     * @type { bigint }
770761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
770861847f8eSopenharmony_ci     * @crossplatform
770961847f8eSopenharmony_ci     * @since 11
771061847f8eSopenharmony_ci     */
771161847f8eSopenharmony_ci    /**
771261847f8eSopenharmony_ci     * Indicates the modulus n.
771361847f8eSopenharmony_ci     *
771461847f8eSopenharmony_ci     * @type { bigint }
771561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
771661847f8eSopenharmony_ci     * @crossplatform
771761847f8eSopenharmony_ci     * @atomicservice
771861847f8eSopenharmony_ci     * @since 12
771961847f8eSopenharmony_ci     */
772061847f8eSopenharmony_ci    n: bigint;
772161847f8eSopenharmony_ci  }
772261847f8eSopenharmony_ci
772361847f8eSopenharmony_ci  /**
772461847f8eSopenharmony_ci   * Specifies the RSA public key with its associated parameters.
772561847f8eSopenharmony_ci   *
772661847f8eSopenharmony_ci   * @typedef RSAPubKeySpec
772761847f8eSopenharmony_ci   * @extends AsyKeySpec
772861847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
772961847f8eSopenharmony_ci   * @since 10
773061847f8eSopenharmony_ci   */
773161847f8eSopenharmony_ci  /**
773261847f8eSopenharmony_ci   * Specifies the RSA public key with its associated parameters.
773361847f8eSopenharmony_ci   *
773461847f8eSopenharmony_ci   * @typedef RSAPubKeySpec
773561847f8eSopenharmony_ci   * @extends AsyKeySpec
773661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
773761847f8eSopenharmony_ci   * @crossplatform
773861847f8eSopenharmony_ci   * @since 11
773961847f8eSopenharmony_ci   */
774061847f8eSopenharmony_ci  /**
774161847f8eSopenharmony_ci   * Specifies the RSA public key with its associated parameters.
774261847f8eSopenharmony_ci   *
774361847f8eSopenharmony_ci   * @typedef RSAPubKeySpec
774461847f8eSopenharmony_ci   * @extends AsyKeySpec
774561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
774661847f8eSopenharmony_ci   * @crossplatform
774761847f8eSopenharmony_ci   * @atomicservice
774861847f8eSopenharmony_ci   * @since 12
774961847f8eSopenharmony_ci   */
775061847f8eSopenharmony_ci  interface RSAPubKeySpec extends AsyKeySpec {
775161847f8eSopenharmony_ci    /**
775261847f8eSopenharmony_ci     * Indicates the RSA common parameters.
775361847f8eSopenharmony_ci     *
775461847f8eSopenharmony_ci     * @type { RSACommonParamsSpec }
775561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
775661847f8eSopenharmony_ci     * @since 10
775761847f8eSopenharmony_ci     */
775861847f8eSopenharmony_ci    /**
775961847f8eSopenharmony_ci     * Indicates the RSA common parameters.
776061847f8eSopenharmony_ci     *
776161847f8eSopenharmony_ci     * @type { RSACommonParamsSpec }
776261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
776361847f8eSopenharmony_ci     * @crossplatform
776461847f8eSopenharmony_ci     * @since 11
776561847f8eSopenharmony_ci     */
776661847f8eSopenharmony_ci    /**
776761847f8eSopenharmony_ci     * Indicates the RSA common parameters.
776861847f8eSopenharmony_ci     *
776961847f8eSopenharmony_ci     * @type { RSACommonParamsSpec }
777061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
777161847f8eSopenharmony_ci     * @crossplatform
777261847f8eSopenharmony_ci     * @atomicservice
777361847f8eSopenharmony_ci     * @since 12
777461847f8eSopenharmony_ci     */
777561847f8eSopenharmony_ci    params: RSACommonParamsSpec;
777661847f8eSopenharmony_ci
777761847f8eSopenharmony_ci    /**
777861847f8eSopenharmony_ci     * Indicates the public exponent e.
777961847f8eSopenharmony_ci     *
778061847f8eSopenharmony_ci     * @type { bigint }
778161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
778261847f8eSopenharmony_ci     * @since 10
778361847f8eSopenharmony_ci     */
778461847f8eSopenharmony_ci    /**
778561847f8eSopenharmony_ci     * Indicates the public exponent e.
778661847f8eSopenharmony_ci     *
778761847f8eSopenharmony_ci     * @type { bigint }
778861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
778961847f8eSopenharmony_ci     * @crossplatform
779061847f8eSopenharmony_ci     * @since 11
779161847f8eSopenharmony_ci     */
779261847f8eSopenharmony_ci    /**
779361847f8eSopenharmony_ci     * Indicates the public exponent e.
779461847f8eSopenharmony_ci     *
779561847f8eSopenharmony_ci     * @type { bigint }
779661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
779761847f8eSopenharmony_ci     * @crossplatform
779861847f8eSopenharmony_ci     * @atomicservice
779961847f8eSopenharmony_ci     * @since 12
780061847f8eSopenharmony_ci     */
780161847f8eSopenharmony_ci    pk: bigint;
780261847f8eSopenharmony_ci  }
780361847f8eSopenharmony_ci
780461847f8eSopenharmony_ci  /**
780561847f8eSopenharmony_ci   * Specifies the RSA keypair with its associated parameters.
780661847f8eSopenharmony_ci   *
780761847f8eSopenharmony_ci   * @typedef RSAKeyPairSpec
780861847f8eSopenharmony_ci   * @extends AsyKeySpec
780961847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
781061847f8eSopenharmony_ci   * @since 10
781161847f8eSopenharmony_ci   */
781261847f8eSopenharmony_ci  /**
781361847f8eSopenharmony_ci   * Specifies the RSA keypair with its associated parameters.
781461847f8eSopenharmony_ci   *
781561847f8eSopenharmony_ci   * @typedef RSAKeyPairSpec
781661847f8eSopenharmony_ci   * @extends AsyKeySpec
781761847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
781861847f8eSopenharmony_ci   * @crossplatform
781961847f8eSopenharmony_ci   * @since 11
782061847f8eSopenharmony_ci   */
782161847f8eSopenharmony_ci  /**
782261847f8eSopenharmony_ci   * Specifies the RSA keypair with its associated parameters.
782361847f8eSopenharmony_ci   *
782461847f8eSopenharmony_ci   * @typedef RSAKeyPairSpec
782561847f8eSopenharmony_ci   * @extends AsyKeySpec
782661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
782761847f8eSopenharmony_ci   * @crossplatform
782861847f8eSopenharmony_ci   * @atomicservice
782961847f8eSopenharmony_ci   * @since 12
783061847f8eSopenharmony_ci   */
783161847f8eSopenharmony_ci  interface RSAKeyPairSpec extends AsyKeySpec {
783261847f8eSopenharmony_ci    /**
783361847f8eSopenharmony_ci     * Indicates the RSA common parameters.
783461847f8eSopenharmony_ci     *
783561847f8eSopenharmony_ci     * @type { RSACommonParamsSpec }
783661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
783761847f8eSopenharmony_ci     * @since 10
783861847f8eSopenharmony_ci     */
783961847f8eSopenharmony_ci    /**
784061847f8eSopenharmony_ci     * Indicates the RSA common parameters.
784161847f8eSopenharmony_ci     *
784261847f8eSopenharmony_ci     * @type { RSACommonParamsSpec }
784361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
784461847f8eSopenharmony_ci     * @crossplatform
784561847f8eSopenharmony_ci     * @since 11
784661847f8eSopenharmony_ci     */
784761847f8eSopenharmony_ci    /**
784861847f8eSopenharmony_ci     * Indicates the RSA common parameters.
784961847f8eSopenharmony_ci     *
785061847f8eSopenharmony_ci     * @type { RSACommonParamsSpec }
785161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
785261847f8eSopenharmony_ci     * @crossplatform
785361847f8eSopenharmony_ci     * @atomicservice
785461847f8eSopenharmony_ci     * @since 12
785561847f8eSopenharmony_ci     */
785661847f8eSopenharmony_ci    params: RSACommonParamsSpec;
785761847f8eSopenharmony_ci
785861847f8eSopenharmony_ci    /**
785961847f8eSopenharmony_ci     * Indicates the private exponent d.
786061847f8eSopenharmony_ci     *
786161847f8eSopenharmony_ci     * @type { bigint }
786261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
786361847f8eSopenharmony_ci     * @since 10
786461847f8eSopenharmony_ci     */
786561847f8eSopenharmony_ci    /**
786661847f8eSopenharmony_ci     * Indicates the private exponent d.
786761847f8eSopenharmony_ci     *
786861847f8eSopenharmony_ci     * @type { bigint }
786961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
787061847f8eSopenharmony_ci     * @crossplatform
787161847f8eSopenharmony_ci     * @since 11
787261847f8eSopenharmony_ci     */
787361847f8eSopenharmony_ci    /**
787461847f8eSopenharmony_ci     * Indicates the private exponent d.
787561847f8eSopenharmony_ci     *
787661847f8eSopenharmony_ci     * @type { bigint }
787761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
787861847f8eSopenharmony_ci     * @crossplatform
787961847f8eSopenharmony_ci     * @atomicservice
788061847f8eSopenharmony_ci     * @since 12
788161847f8eSopenharmony_ci     */
788261847f8eSopenharmony_ci    sk: bigint;
788361847f8eSopenharmony_ci
788461847f8eSopenharmony_ci    /**
788561847f8eSopenharmony_ci     * Indicates the public exponent e.
788661847f8eSopenharmony_ci     *
788761847f8eSopenharmony_ci     * @type { bigint }
788861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
788961847f8eSopenharmony_ci     * @since 10
789061847f8eSopenharmony_ci     */
789161847f8eSopenharmony_ci    /**
789261847f8eSopenharmony_ci     * Indicates the public exponent e.
789361847f8eSopenharmony_ci     *
789461847f8eSopenharmony_ci     * @type { bigint }
789561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
789661847f8eSopenharmony_ci     * @crossplatform
789761847f8eSopenharmony_ci     * @since 11
789861847f8eSopenharmony_ci     */
789961847f8eSopenharmony_ci    /**
790061847f8eSopenharmony_ci     * Indicates the public exponent e.
790161847f8eSopenharmony_ci     *
790261847f8eSopenharmony_ci     * @type { bigint }
790361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
790461847f8eSopenharmony_ci     * @crossplatform
790561847f8eSopenharmony_ci     * @atomicservice
790661847f8eSopenharmony_ci     * @since 12
790761847f8eSopenharmony_ci     */
790861847f8eSopenharmony_ci    pk: bigint;
790961847f8eSopenharmony_ci  }
791061847f8eSopenharmony_ci
791161847f8eSopenharmony_ci  /**
791261847f8eSopenharmony_ci   * The AsyKeyGeneratorBySpec provides the ability to generate key with its associated parameters.
791361847f8eSopenharmony_ci   *
791461847f8eSopenharmony_ci   * @typedef AsyKeyGeneratorBySpec
791561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
791661847f8eSopenharmony_ci   * @since 10
791761847f8eSopenharmony_ci   */
791861847f8eSopenharmony_ci  /**
791961847f8eSopenharmony_ci   * The AsyKeyGeneratorBySpec provides the ability to generate key with its associated parameters.
792061847f8eSopenharmony_ci   *
792161847f8eSopenharmony_ci   * @typedef AsyKeyGeneratorBySpec
792261847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
792361847f8eSopenharmony_ci   * @crossplatform
792461847f8eSopenharmony_ci   * @since 11
792561847f8eSopenharmony_ci   */
792661847f8eSopenharmony_ci  /**
792761847f8eSopenharmony_ci   * The AsyKeyGeneratorBySpec provides the ability to generate key with its associated parameters.
792861847f8eSopenharmony_ci   *
792961847f8eSopenharmony_ci   * @typedef AsyKeyGeneratorBySpec
793061847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
793161847f8eSopenharmony_ci   * @crossplatform
793261847f8eSopenharmony_ci   * @atomicservice
793361847f8eSopenharmony_ci   * @since 12
793461847f8eSopenharmony_ci   */
793561847f8eSopenharmony_ci  interface AsyKeyGeneratorBySpec {
793661847f8eSopenharmony_ci    /**
793761847f8eSopenharmony_ci     * Generate an asymmetric keypair.
793861847f8eSopenharmony_ci     *
793961847f8eSopenharmony_ci     * @param { AsyncCallback<KeyPair> } callback - the callback used to return keypair.
794061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: Incorrect parameter types;
794161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
794261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
794361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
794461847f8eSopenharmony_ci     * @since 10
794561847f8eSopenharmony_ci     */
794661847f8eSopenharmony_ci    /**
794761847f8eSopenharmony_ci     * Generate an asymmetric keypair.
794861847f8eSopenharmony_ci     *
794961847f8eSopenharmony_ci     * @param { AsyncCallback<KeyPair> } callback - the callback used to return keypair.
795061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: Incorrect parameter types;
795161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
795261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
795361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
795461847f8eSopenharmony_ci     * @crossplatform
795561847f8eSopenharmony_ci     * @since 11
795661847f8eSopenharmony_ci     */
795761847f8eSopenharmony_ci    /**
795861847f8eSopenharmony_ci     * Generate an asymmetric keypair.
795961847f8eSopenharmony_ci     *
796061847f8eSopenharmony_ci     * @param { AsyncCallback<KeyPair> } callback - the callback used to return keypair.
796161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: Incorrect parameter types;
796261847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
796361847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
796461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
796561847f8eSopenharmony_ci     * @crossplatform
796661847f8eSopenharmony_ci     * @atomicservice
796761847f8eSopenharmony_ci     * @since 12
796861847f8eSopenharmony_ci     */
796961847f8eSopenharmony_ci    generateKeyPair(callback: AsyncCallback<KeyPair>): void;
797061847f8eSopenharmony_ci
797161847f8eSopenharmony_ci    /**
797261847f8eSopenharmony_ci     * Generate an asymmetric keypair.
797361847f8eSopenharmony_ci     *
797461847f8eSopenharmony_ci     * @returns { Promise<KeyPair> } the promise used to return keypair.
797561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
797661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
797761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
797861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
797961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
798061847f8eSopenharmony_ci     * @since 10
798161847f8eSopenharmony_ci     */
798261847f8eSopenharmony_ci    /**
798361847f8eSopenharmony_ci     * Generate an asymmetric keypair.
798461847f8eSopenharmony_ci     *
798561847f8eSopenharmony_ci     * @returns { Promise<KeyPair> } the promise used to return keypair.
798661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
798761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
798861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
798961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
799061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
799161847f8eSopenharmony_ci     * @crossplatform
799261847f8eSopenharmony_ci     * @since 11
799361847f8eSopenharmony_ci     */
799461847f8eSopenharmony_ci    /**
799561847f8eSopenharmony_ci     * Generate an asymmetric keypair.
799661847f8eSopenharmony_ci     *
799761847f8eSopenharmony_ci     * @returns { Promise<KeyPair> } the promise used to return keypair.
799861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
799961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
800061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
800161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
800261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
800361847f8eSopenharmony_ci     * @crossplatform
800461847f8eSopenharmony_ci     * @atomicservice
800561847f8eSopenharmony_ci     * @since 12
800661847f8eSopenharmony_ci     */
800761847f8eSopenharmony_ci    generateKeyPair(): Promise<KeyPair>;
800861847f8eSopenharmony_ci
800961847f8eSopenharmony_ci    /**
801061847f8eSopenharmony_ci     * Generate an asymmetric keypair.
801161847f8eSopenharmony_ci     *
801261847f8eSopenharmony_ci     * @returns { KeyPair } return keypair.
801361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
801461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
801561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
801661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
801761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
801861847f8eSopenharmony_ci     * @crossplatform
801961847f8eSopenharmony_ci     * @atomicservice
802061847f8eSopenharmony_ci     * @since 12
802161847f8eSopenharmony_ci     */
802261847f8eSopenharmony_ci    generateKeyPairSync(): KeyPair;
802361847f8eSopenharmony_ci
802461847f8eSopenharmony_ci    /**
802561847f8eSopenharmony_ci     * Generate a private key instance.
802661847f8eSopenharmony_ci     *
802761847f8eSopenharmony_ci     * @param { AsyncCallback<PriKey> } callback - the callback used to return PriKey.
802861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: Mandatory parameters are left unspecified;
802961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
803061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
803161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
803261847f8eSopenharmony_ci     * @since 10
803361847f8eSopenharmony_ci     */
803461847f8eSopenharmony_ci    /**
803561847f8eSopenharmony_ci     * Generate a private key instance.
803661847f8eSopenharmony_ci     *
803761847f8eSopenharmony_ci     * @param { AsyncCallback<PriKey> } callback - the callback used to return PriKey.
803861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: Mandatory parameters are left unspecified;
803961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
804061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
804161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
804261847f8eSopenharmony_ci     * @crossplatform
804361847f8eSopenharmony_ci     * @since 11
804461847f8eSopenharmony_ci     */
804561847f8eSopenharmony_ci    /**
804661847f8eSopenharmony_ci     * Generate a private key instance.
804761847f8eSopenharmony_ci     *
804861847f8eSopenharmony_ci     * @param { AsyncCallback<PriKey> } callback - the callback used to return PriKey.
804961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: Mandatory parameters are left unspecified;
805061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
805161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
805261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
805361847f8eSopenharmony_ci     * @crossplatform
805461847f8eSopenharmony_ci     * @atomicservice
805561847f8eSopenharmony_ci     * @since 12
805661847f8eSopenharmony_ci     */
805761847f8eSopenharmony_ci    generatePriKey(callback: AsyncCallback<PriKey>): void;
805861847f8eSopenharmony_ci
805961847f8eSopenharmony_ci    /**
806061847f8eSopenharmony_ci     * Generate a private key instance.
806161847f8eSopenharmony_ci     *
806261847f8eSopenharmony_ci     * @returns { Promise<PriKey> } the promise used to return PriKey.
806361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
806461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
806561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
806661847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
806761847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
806861847f8eSopenharmony_ci     * @since 10
806961847f8eSopenharmony_ci     */
807061847f8eSopenharmony_ci    /**
807161847f8eSopenharmony_ci     * Generate a private key instance.
807261847f8eSopenharmony_ci     *
807361847f8eSopenharmony_ci     * @returns { Promise<PriKey> } the promise used to return PriKey.
807461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
807561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
807661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
807761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
807861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
807961847f8eSopenharmony_ci     * @crossplatform
808061847f8eSopenharmony_ci     * @since 11
808161847f8eSopenharmony_ci     */
808261847f8eSopenharmony_ci    /**
808361847f8eSopenharmony_ci     * Generate a private key instance.
808461847f8eSopenharmony_ci     *
808561847f8eSopenharmony_ci     * @returns { Promise<PriKey> } the promise used to return PriKey.
808661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
808761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
808861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
808961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
809061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
809161847f8eSopenharmony_ci     * @crossplatform
809261847f8eSopenharmony_ci     * @atomicservice
809361847f8eSopenharmony_ci     * @since 12
809461847f8eSopenharmony_ci     */
809561847f8eSopenharmony_ci    generatePriKey(): Promise<PriKey>;
809661847f8eSopenharmony_ci
809761847f8eSopenharmony_ci    /**
809861847f8eSopenharmony_ci     * Generate a private key instance.
809961847f8eSopenharmony_ci     *
810061847f8eSopenharmony_ci     * @returns { PriKey } return PriKey.
810161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
810261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
810361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
810461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
810561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
810661847f8eSopenharmony_ci     * @crossplatform
810761847f8eSopenharmony_ci     * @atomicservice
810861847f8eSopenharmony_ci     * @since 12
810961847f8eSopenharmony_ci     */
811061847f8eSopenharmony_ci    generatePriKeySync(): PriKey;
811161847f8eSopenharmony_ci
811261847f8eSopenharmony_ci    /**
811361847f8eSopenharmony_ci     * Generate a public key instance.
811461847f8eSopenharmony_ci     *
811561847f8eSopenharmony_ci     * @param { AsyncCallback<PubKey> } callback - the callback used to return PubKey.
811661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: Incorrect parameter types;
811761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
811861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
811961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
812061847f8eSopenharmony_ci     * @since 10
812161847f8eSopenharmony_ci     */
812261847f8eSopenharmony_ci    /**
812361847f8eSopenharmony_ci     * Generate a public key instance.
812461847f8eSopenharmony_ci     *
812561847f8eSopenharmony_ci     * @param { AsyncCallback<PubKey> } callback - the callback used to return PubKey.
812661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: Incorrect parameter types;
812761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
812861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
812961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
813061847f8eSopenharmony_ci     * @crossplatform
813161847f8eSopenharmony_ci     * @since 11
813261847f8eSopenharmony_ci     */
813361847f8eSopenharmony_ci    /**
813461847f8eSopenharmony_ci     * Generate a public key instance.
813561847f8eSopenharmony_ci     *
813661847f8eSopenharmony_ci     * @param { AsyncCallback<PubKey> } callback - the callback used to return PubKey.
813761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: Incorrect parameter types;
813861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
813961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
814061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
814161847f8eSopenharmony_ci     * @crossplatform
814261847f8eSopenharmony_ci     * @atomicservice
814361847f8eSopenharmony_ci     * @since 12
814461847f8eSopenharmony_ci     */
814561847f8eSopenharmony_ci    generatePubKey(callback: AsyncCallback<PubKey>): void;
814661847f8eSopenharmony_ci
814761847f8eSopenharmony_ci    /**
814861847f8eSopenharmony_ci     * Generate a public key instance.
814961847f8eSopenharmony_ci     *
815061847f8eSopenharmony_ci     * @returns { Promise<PubKey> } the promise used to return PubKey.
815161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
815261847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
815361847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
815461847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
815561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
815661847f8eSopenharmony_ci     * @since 10
815761847f8eSopenharmony_ci     */
815861847f8eSopenharmony_ci    /**
815961847f8eSopenharmony_ci     * Generate a public key instance.
816061847f8eSopenharmony_ci     *
816161847f8eSopenharmony_ci     * @returns { Promise<PubKey> } the promise used to return PubKey.
816261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
816361847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
816461847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
816561847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
816661847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
816761847f8eSopenharmony_ci     * @crossplatform
816861847f8eSopenharmony_ci     * @since 11
816961847f8eSopenharmony_ci     */
817061847f8eSopenharmony_ci    /**
817161847f8eSopenharmony_ci     * Generate a public key instance.
817261847f8eSopenharmony_ci     *
817361847f8eSopenharmony_ci     * @returns { Promise<PubKey> } the promise used to return PubKey.
817461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
817561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
817661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
817761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
817861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
817961847f8eSopenharmony_ci     * @crossplatform
818061847f8eSopenharmony_ci     * @atomicservice
818161847f8eSopenharmony_ci     * @since 12
818261847f8eSopenharmony_ci     */
818361847f8eSopenharmony_ci    generatePubKey(): Promise<PubKey>;
818461847f8eSopenharmony_ci
818561847f8eSopenharmony_ci    /**
818661847f8eSopenharmony_ci     * Generate a public key instance.
818761847f8eSopenharmony_ci     *
818861847f8eSopenharmony_ci     * @returns { PubKey } return PubKey.
818961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
819061847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
819161847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
819261847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
819361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
819461847f8eSopenharmony_ci     * @crossplatform
819561847f8eSopenharmony_ci     * @atomicservice
819661847f8eSopenharmony_ci     * @since 12
819761847f8eSopenharmony_ci     */
819861847f8eSopenharmony_ci    generatePubKeySync(): PubKey;
819961847f8eSopenharmony_ci
820061847f8eSopenharmony_ci    /**
820161847f8eSopenharmony_ci     * Indicates the algorithm name of the generator.
820261847f8eSopenharmony_ci     *
820361847f8eSopenharmony_ci     * @type { string }
820461847f8eSopenharmony_ci     * @readonly
820561847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
820661847f8eSopenharmony_ci     * @since 10
820761847f8eSopenharmony_ci     */
820861847f8eSopenharmony_ci    /**
820961847f8eSopenharmony_ci     * Indicates the algorithm name of the generator.
821061847f8eSopenharmony_ci     *
821161847f8eSopenharmony_ci     * @type { string }
821261847f8eSopenharmony_ci     * @readonly
821361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
821461847f8eSopenharmony_ci     * @crossplatform
821561847f8eSopenharmony_ci     * @since 11
821661847f8eSopenharmony_ci     */
821761847f8eSopenharmony_ci    /**
821861847f8eSopenharmony_ci     * Indicates the algorithm name of the generator.
821961847f8eSopenharmony_ci     *
822061847f8eSopenharmony_ci     * @type { string }
822161847f8eSopenharmony_ci     * @readonly
822261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
822361847f8eSopenharmony_ci     * @crossplatform
822461847f8eSopenharmony_ci     * @atomicservice
822561847f8eSopenharmony_ci     * @since 12
822661847f8eSopenharmony_ci     */
822761847f8eSopenharmony_ci    readonly algName: string;
822861847f8eSopenharmony_ci  }
822961847f8eSopenharmony_ci
823061847f8eSopenharmony_ci  /**
823161847f8eSopenharmony_ci   * Create an asymmetric key generator with the specified parameters.
823261847f8eSopenharmony_ci   *
823361847f8eSopenharmony_ci   * @param { AsyKeySpec } asyKeySpec - indicates the associated parameters of algorithm.
823461847f8eSopenharmony_ci   * @returns { AsyKeyGeneratorBySpec } the generator obj create by asyKeySpec.
823561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
823661847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
823761847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
823861847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
823961847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
824061847f8eSopenharmony_ci   * @since 10
824161847f8eSopenharmony_ci   */
824261847f8eSopenharmony_ci  /**
824361847f8eSopenharmony_ci   * Create an asymmetric key generator with the specified parameters.
824461847f8eSopenharmony_ci   *
824561847f8eSopenharmony_ci   * @param { AsyKeySpec } asyKeySpec - indicates the associated parameters of algorithm.
824661847f8eSopenharmony_ci   * @returns { AsyKeyGeneratorBySpec } the generator obj create by asyKeySpec.
824761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
824861847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
824961847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
825061847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
825161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
825261847f8eSopenharmony_ci   * @crossplatform
825361847f8eSopenharmony_ci   * @since 11
825461847f8eSopenharmony_ci   */
825561847f8eSopenharmony_ci  /**
825661847f8eSopenharmony_ci   * Create an asymmetric key generator with the specified parameters.
825761847f8eSopenharmony_ci   *
825861847f8eSopenharmony_ci   * @param { AsyKeySpec } asyKeySpec - indicates the associated parameters of algorithm.
825961847f8eSopenharmony_ci   * @returns { AsyKeyGeneratorBySpec } the generator obj create by asyKeySpec.
826061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
826161847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
826261847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
826361847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
826461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Key.AsymKey
826561847f8eSopenharmony_ci   * @crossplatform
826661847f8eSopenharmony_ci   * @atomicservice
826761847f8eSopenharmony_ci   * @since 12
826861847f8eSopenharmony_ci   */
826961847f8eSopenharmony_ci  function createAsyKeyGeneratorBySpec(asyKeySpec: AsyKeySpec): AsyKeyGeneratorBySpec;
827061847f8eSopenharmony_ci
827161847f8eSopenharmony_ci  /**
827261847f8eSopenharmony_ci   * Specifies the key derivation function parameters.
827361847f8eSopenharmony_ci   *
827461847f8eSopenharmony_ci   * @typedef KdfSpec
827561847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
827661847f8eSopenharmony_ci   * @crossplatform
827761847f8eSopenharmony_ci   * @since 11
827861847f8eSopenharmony_ci   */
827961847f8eSopenharmony_ci  /**
828061847f8eSopenharmony_ci   * Specifies the key derivation function parameters.
828161847f8eSopenharmony_ci   *
828261847f8eSopenharmony_ci   * @typedef KdfSpec
828361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Kdf
828461847f8eSopenharmony_ci   * @crossplatform
828561847f8eSopenharmony_ci   * @atomicservice
828661847f8eSopenharmony_ci   * @since 12
828761847f8eSopenharmony_ci   */
828861847f8eSopenharmony_ci  interface KdfSpec {
828961847f8eSopenharmony_ci    /**
829061847f8eSopenharmony_ci     * Indicates the algorithm name of key derivation function.
829161847f8eSopenharmony_ci     *
829261847f8eSopenharmony_ci     * @type { string }
829361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
829461847f8eSopenharmony_ci     * @crossplatform
829561847f8eSopenharmony_ci     * @since 11
829661847f8eSopenharmony_ci     */
829761847f8eSopenharmony_ci    /**
829861847f8eSopenharmony_ci     * Indicates the algorithm name of key derivation function.
829961847f8eSopenharmony_ci     *
830061847f8eSopenharmony_ci     * @type { string }
830161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Kdf
830261847f8eSopenharmony_ci     * @crossplatform
830361847f8eSopenharmony_ci     * @atomicservice
830461847f8eSopenharmony_ci     * @since 12
830561847f8eSopenharmony_ci     */
830661847f8eSopenharmony_ci    algName: string;
830761847f8eSopenharmony_ci  }
830861847f8eSopenharmony_ci
830961847f8eSopenharmony_ci  /**
831061847f8eSopenharmony_ci   * Specifies the PBKDF2 parameters.
831161847f8eSopenharmony_ci   *
831261847f8eSopenharmony_ci   * @typedef PBKDF2Spec
831361847f8eSopenharmony_ci   * @extends KdfSpec
831461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
831561847f8eSopenharmony_ci   * @crossplatform
831661847f8eSopenharmony_ci   * @since 11
831761847f8eSopenharmony_ci   */
831861847f8eSopenharmony_ci  /**
831961847f8eSopenharmony_ci   * Specifies the PBKDF2 parameters.
832061847f8eSopenharmony_ci   *
832161847f8eSopenharmony_ci   * @typedef PBKDF2Spec
832261847f8eSopenharmony_ci   * @extends KdfSpec
832361847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Kdf
832461847f8eSopenharmony_ci   * @crossplatform
832561847f8eSopenharmony_ci   * @atomicservice
832661847f8eSopenharmony_ci   * @since 12
832761847f8eSopenharmony_ci   */
832861847f8eSopenharmony_ci  interface PBKDF2Spec extends KdfSpec {
832961847f8eSopenharmony_ci    /**
833061847f8eSopenharmony_ci     * Indicates the password parameter of PBKDF2.
833161847f8eSopenharmony_ci     *
833261847f8eSopenharmony_ci     * @type { string | Uint8Array }
833361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
833461847f8eSopenharmony_ci     * @crossplatform
833561847f8eSopenharmony_ci     * @since 11
833661847f8eSopenharmony_ci     */
833761847f8eSopenharmony_ci    /**
833861847f8eSopenharmony_ci     * Indicates the password parameter of PBKDF2.
833961847f8eSopenharmony_ci     *
834061847f8eSopenharmony_ci     * @type { string | Uint8Array }
834161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Kdf
834261847f8eSopenharmony_ci     * @crossplatform
834361847f8eSopenharmony_ci     * @atomicservice
834461847f8eSopenharmony_ci     * @since 12
834561847f8eSopenharmony_ci     */
834661847f8eSopenharmony_ci    password: string | Uint8Array;
834761847f8eSopenharmony_ci
834861847f8eSopenharmony_ci    /**
834961847f8eSopenharmony_ci     * Indicates the salt parameter of PBKDF2.
835061847f8eSopenharmony_ci     *
835161847f8eSopenharmony_ci     * @type { Uint8Array }
835261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
835361847f8eSopenharmony_ci     * @crossplatform
835461847f8eSopenharmony_ci     * @since 11
835561847f8eSopenharmony_ci     */
835661847f8eSopenharmony_ci    /**
835761847f8eSopenharmony_ci     * Indicates the salt parameter of PBKDF2.
835861847f8eSopenharmony_ci     *
835961847f8eSopenharmony_ci     * @type { Uint8Array }
836061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Kdf
836161847f8eSopenharmony_ci     * @crossplatform
836261847f8eSopenharmony_ci     * @atomicservice
836361847f8eSopenharmony_ci     * @since 12
836461847f8eSopenharmony_ci     */
836561847f8eSopenharmony_ci    salt: Uint8Array;
836661847f8eSopenharmony_ci
836761847f8eSopenharmony_ci    /**
836861847f8eSopenharmony_ci     * Indicates the iteration number of PBKDF2.
836961847f8eSopenharmony_ci     *
837061847f8eSopenharmony_ci     * @type { number }
837161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
837261847f8eSopenharmony_ci     * @crossplatform
837361847f8eSopenharmony_ci     * @since 11
837461847f8eSopenharmony_ci     */
837561847f8eSopenharmony_ci    /**
837661847f8eSopenharmony_ci     * Indicates the iteration number of PBKDF2.
837761847f8eSopenharmony_ci     *
837861847f8eSopenharmony_ci     * @type { number }
837961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Kdf
838061847f8eSopenharmony_ci     * @crossplatform
838161847f8eSopenharmony_ci     * @atomicservice
838261847f8eSopenharmony_ci     * @since 12
838361847f8eSopenharmony_ci     */
838461847f8eSopenharmony_ci    iterations: number;
838561847f8eSopenharmony_ci
838661847f8eSopenharmony_ci    /**
838761847f8eSopenharmony_ci     * Indicates the byte length of output key of PBKDF2.
838861847f8eSopenharmony_ci     *
838961847f8eSopenharmony_ci     * @type { number }
839061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
839161847f8eSopenharmony_ci     * @crossplatform
839261847f8eSopenharmony_ci     * @since 11
839361847f8eSopenharmony_ci     */
839461847f8eSopenharmony_ci    /**
839561847f8eSopenharmony_ci     * Indicates the byte length of output key of PBKDF2.
839661847f8eSopenharmony_ci     *
839761847f8eSopenharmony_ci     * @type { number }
839861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Kdf
839961847f8eSopenharmony_ci     * @crossplatform
840061847f8eSopenharmony_ci     * @atomicservice
840161847f8eSopenharmony_ci     * @since 12
840261847f8eSopenharmony_ci     */
840361847f8eSopenharmony_ci    keySize: number;
840461847f8eSopenharmony_ci  }
840561847f8eSopenharmony_ci
840661847f8eSopenharmony_ci  /**
840761847f8eSopenharmony_ci   * Specifies the HKDF parameters.
840861847f8eSopenharmony_ci   *
840961847f8eSopenharmony_ci   * @typedef HKDFSpec
841061847f8eSopenharmony_ci   * @extends KdfSpec
841161847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Kdf
841261847f8eSopenharmony_ci   * @crossplatform
841361847f8eSopenharmony_ci   * @atomicservice
841461847f8eSopenharmony_ci   * @since 12
841561847f8eSopenharmony_ci   */
841661847f8eSopenharmony_ci  interface HKDFSpec extends KdfSpec {
841761847f8eSopenharmony_ci    /**
841861847f8eSopenharmony_ci     * Indicates the key parameter of HKDF.
841961847f8eSopenharmony_ci     *
842061847f8eSopenharmony_ci     * @type { string | Uint8Array }
842161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Kdf
842261847f8eSopenharmony_ci     * @crossplatform
842361847f8eSopenharmony_ci     * @atomicservice
842461847f8eSopenharmony_ci     * @since 12
842561847f8eSopenharmony_ci     */
842661847f8eSopenharmony_ci    key: string | Uint8Array;
842761847f8eSopenharmony_ci
842861847f8eSopenharmony_ci    /**
842961847f8eSopenharmony_ci     * Indicates the salt parameter of HKDF.
843061847f8eSopenharmony_ci     *
843161847f8eSopenharmony_ci     * @type { Uint8Array }
843261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Kdf
843361847f8eSopenharmony_ci     * @crossplatform
843461847f8eSopenharmony_ci     * @atomicservice
843561847f8eSopenharmony_ci     * @since 12
843661847f8eSopenharmony_ci     */
843761847f8eSopenharmony_ci    salt: Uint8Array;
843861847f8eSopenharmony_ci
843961847f8eSopenharmony_ci    /**
844061847f8eSopenharmony_ci     * Indicates the info about the context of HKDF.
844161847f8eSopenharmony_ci     *
844261847f8eSopenharmony_ci     * @type { Uint8Array }
844361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Kdf
844461847f8eSopenharmony_ci     * @crossplatform
844561847f8eSopenharmony_ci     * @atomicservice
844661847f8eSopenharmony_ci     * @since 12
844761847f8eSopenharmony_ci     */
844861847f8eSopenharmony_ci    info: Uint8Array;
844961847f8eSopenharmony_ci
845061847f8eSopenharmony_ci    /**
845161847f8eSopenharmony_ci     * Indicates the byte length of output key of HKDF.
845261847f8eSopenharmony_ci     *
845361847f8eSopenharmony_ci     * @type { number }
845461847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Kdf
845561847f8eSopenharmony_ci     * @crossplatform
845661847f8eSopenharmony_ci     * @atomicservice
845761847f8eSopenharmony_ci     * @since 12
845861847f8eSopenharmony_ci     */
845961847f8eSopenharmony_ci    keySize: number;
846061847f8eSopenharmony_ci  }
846161847f8eSopenharmony_ci
846261847f8eSopenharmony_ci  /**
846361847f8eSopenharmony_ci   * The key derivation function object provides the ability to derive key with its associated parameters.
846461847f8eSopenharmony_ci   *
846561847f8eSopenharmony_ci   * @typedef Kdf
846661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
846761847f8eSopenharmony_ci   * @crossplatform
846861847f8eSopenharmony_ci   * @since 11
846961847f8eSopenharmony_ci   */
847061847f8eSopenharmony_ci  /**
847161847f8eSopenharmony_ci   * The key derivation function object provides the ability to derive key with its associated parameters.
847261847f8eSopenharmony_ci   *
847361847f8eSopenharmony_ci   * @typedef Kdf
847461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Kdf
847561847f8eSopenharmony_ci   * @crossplatform
847661847f8eSopenharmony_ci   * @atomicservice
847761847f8eSopenharmony_ci   * @since 12
847861847f8eSopenharmony_ci   */
847961847f8eSopenharmony_ci  interface Kdf {
848061847f8eSopenharmony_ci    /**
848161847f8eSopenharmony_ci     * Generate a dataBlob object of secret key.
848261847f8eSopenharmony_ci     *
848361847f8eSopenharmony_ci     * @param { KdfSpec } params - the input params of key derivation function.
848461847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback used to return dataBlob.
848561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
848661847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
848761847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
848861847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
848961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
849061847f8eSopenharmony_ci     * @crossplatform
849161847f8eSopenharmony_ci     * @since 11
849261847f8eSopenharmony_ci     */
849361847f8eSopenharmony_ci    /**
849461847f8eSopenharmony_ci     * Generate a dataBlob object of secret key.
849561847f8eSopenharmony_ci     *
849661847f8eSopenharmony_ci     * @param { KdfSpec } params - the input params of key derivation function.
849761847f8eSopenharmony_ci     * @param { AsyncCallback<DataBlob> } callback - the callback used to return dataBlob.
849861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
849961847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
850061847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
850161847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
850261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Kdf
850361847f8eSopenharmony_ci     * @crossplatform
850461847f8eSopenharmony_ci     * @atomicservice
850561847f8eSopenharmony_ci     * @since 12
850661847f8eSopenharmony_ci     */
850761847f8eSopenharmony_ci    generateSecret(params: KdfSpec, callback: AsyncCallback<DataBlob>): void;
850861847f8eSopenharmony_ci
850961847f8eSopenharmony_ci    /**
851061847f8eSopenharmony_ci     * Generate a dataBlob object of secret key.
851161847f8eSopenharmony_ci     *
851261847f8eSopenharmony_ci     * @param { KdfSpec } params - the input params of key derivation function.
851361847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise used to return dataBlob.
851461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
851561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
851661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
851761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
851861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
851961847f8eSopenharmony_ci     * @crossplatform
852061847f8eSopenharmony_ci     * @since 11
852161847f8eSopenharmony_ci     */
852261847f8eSopenharmony_ci    /**
852361847f8eSopenharmony_ci     * Generate a dataBlob object of secret key.
852461847f8eSopenharmony_ci     *
852561847f8eSopenharmony_ci     * @param { KdfSpec } params - the input params of key derivation function.
852661847f8eSopenharmony_ci     * @returns { Promise<DataBlob> } the promise used to return dataBlob.
852761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
852861847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
852961847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
853061847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
853161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Kdf
853261847f8eSopenharmony_ci     * @crossplatform
853361847f8eSopenharmony_ci     * @atomicservice
853461847f8eSopenharmony_ci     * @since 12
853561847f8eSopenharmony_ci     */
853661847f8eSopenharmony_ci    generateSecret(params: KdfSpec): Promise<DataBlob>;
853761847f8eSopenharmony_ci
853861847f8eSopenharmony_ci    /**
853961847f8eSopenharmony_ci     * Generate a dataBlob object of secret key.
854061847f8eSopenharmony_ci     *
854161847f8eSopenharmony_ci     * @param { KdfSpec } params - the input params of key derivation function.
854261847f8eSopenharmony_ci     * @returns { DataBlob } the sync used to return dataBlob.
854361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
854461847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
854561847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
854661847f8eSopenharmony_ci     * @throws { BusinessError } 17620002 - runtime error.
854761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
854861847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Kdf
854961847f8eSopenharmony_ci     * @crossplatform
855061847f8eSopenharmony_ci     * @atomicservice
855161847f8eSopenharmony_ci     * @since 12
855261847f8eSopenharmony_ci     */
855361847f8eSopenharmony_ci    generateSecretSync(params: KdfSpec): DataBlob;
855461847f8eSopenharmony_ci
855561847f8eSopenharmony_ci    /**
855661847f8eSopenharmony_ci     * Indicates the algorithm name of the key derivation function.
855761847f8eSopenharmony_ci     *
855861847f8eSopenharmony_ci     * @type { string }
855961847f8eSopenharmony_ci     * @readonly
856061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework
856161847f8eSopenharmony_ci     * @crossplatform
856261847f8eSopenharmony_ci     * @since 11
856361847f8eSopenharmony_ci     */
856461847f8eSopenharmony_ci    /**
856561847f8eSopenharmony_ci     * Indicates the algorithm name of the key derivation function.
856661847f8eSopenharmony_ci     *
856761847f8eSopenharmony_ci     * @type { string }
856861847f8eSopenharmony_ci     * @readonly
856961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Kdf
857061847f8eSopenharmony_ci     * @crossplatform
857161847f8eSopenharmony_ci     * @atomicservice
857261847f8eSopenharmony_ci     * @since 12
857361847f8eSopenharmony_ci     */
857461847f8eSopenharmony_ci    readonly algName: string;
857561847f8eSopenharmony_ci  }
857661847f8eSopenharmony_ci
857761847f8eSopenharmony_ci  /**
857861847f8eSopenharmony_ci   * Create a key derivation function object.
857961847f8eSopenharmony_ci   *
858061847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name and params.
858161847f8eSopenharmony_ci   * @returns { Kdf } the key derivation function object.
858261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
858361847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
858461847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
858561847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
858661847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework
858761847f8eSopenharmony_ci   * @crossplatform
858861847f8eSopenharmony_ci   * @since 11
858961847f8eSopenharmony_ci   */
859061847f8eSopenharmony_ci  /**
859161847f8eSopenharmony_ci   * Create a key derivation function object.
859261847f8eSopenharmony_ci   *
859361847f8eSopenharmony_ci   * @param { string } algName - indicates the algorithm name and params. Multiple parameters need to be concatenated by "|".
859461847f8eSopenharmony_ci   * @returns { Kdf } the key derivation function object.
859561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
859661847f8eSopenharmony_ci   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
859761847f8eSopenharmony_ci   * @throws { BusinessError } 801 - this operation is not supported.
859861847f8eSopenharmony_ci   * @throws { BusinessError } 17620001 - memory error.
859961847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Kdf
860061847f8eSopenharmony_ci   * @crossplatform
860161847f8eSopenharmony_ci   * @atomicservice
860261847f8eSopenharmony_ci   * @since 12
860361847f8eSopenharmony_ci   */
860461847f8eSopenharmony_ci  function createKdf(algName: string): Kdf;
860561847f8eSopenharmony_ci
860661847f8eSopenharmony_ci  /**
860761847f8eSopenharmony_ci   * Provides the interface for specifying detailed data in the SM2 ciphertext in ASN.1 format.
860861847f8eSopenharmony_ci   *
860961847f8eSopenharmony_ci   * @typedef SM2CipherTextSpec
861061847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Cipher
861161847f8eSopenharmony_ci   * @crossplatform
861261847f8eSopenharmony_ci   * @atomicservice
861361847f8eSopenharmony_ci   * @since 12
861461847f8eSopenharmony_ci   */
861561847f8eSopenharmony_ci  interface SM2CipherTextSpec {
861661847f8eSopenharmony_ci    /**
861761847f8eSopenharmony_ci     * Indicates the x coordinate, also known as C1x.
861861847f8eSopenharmony_ci     *
861961847f8eSopenharmony_ci     * @type { bigint }
862061847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
862161847f8eSopenharmony_ci     * @crossplatform
862261847f8eSopenharmony_ci     * @atomicservice
862361847f8eSopenharmony_ci     * @since 12
862461847f8eSopenharmony_ci     */
862561847f8eSopenharmony_ci    xCoordinate: bigint;
862661847f8eSopenharmony_ci
862761847f8eSopenharmony_ci    /**
862861847f8eSopenharmony_ci     * Indicates the y coordinate, also known as C1y.
862961847f8eSopenharmony_ci     *
863061847f8eSopenharmony_ci     * @type { bigint }
863161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
863261847f8eSopenharmony_ci     * @crossplatform
863361847f8eSopenharmony_ci     * @atomicservice
863461847f8eSopenharmony_ci     * @since 12
863561847f8eSopenharmony_ci     */
863661847f8eSopenharmony_ci    yCoordinate: bigint;
863761847f8eSopenharmony_ci
863861847f8eSopenharmony_ci    /**
863961847f8eSopenharmony_ci     * Indicates the detailed ciphertext data, also known as C2.
864061847f8eSopenharmony_ci     *
864161847f8eSopenharmony_ci     * @type { Uint8Array }
864261847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
864361847f8eSopenharmony_ci     * @crossplatform
864461847f8eSopenharmony_ci     * @atomicservice
864561847f8eSopenharmony_ci     * @since 12
864661847f8eSopenharmony_ci     */
864761847f8eSopenharmony_ci    cipherTextData: Uint8Array;
864861847f8eSopenharmony_ci
864961847f8eSopenharmony_ci    /**
865061847f8eSopenharmony_ci     * Indicates the hash data, also known as C3.
865161847f8eSopenharmony_ci     *
865261847f8eSopenharmony_ci     * @type { Uint8Array }
865361847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
865461847f8eSopenharmony_ci     * @crossplatform
865561847f8eSopenharmony_ci     * @atomicservice
865661847f8eSopenharmony_ci     * @since 12
865761847f8eSopenharmony_ci     */
865861847f8eSopenharmony_ci    hashData: Uint8Array;
865961847f8eSopenharmony_ci  }
866061847f8eSopenharmony_ci
866161847f8eSopenharmony_ci  /**
866261847f8eSopenharmony_ci   * Utilities for SM2 crypto operations.
866361847f8eSopenharmony_ci   *
866461847f8eSopenharmony_ci   * @syscap SystemCapability.Security.CryptoFramework.Cipher
866561847f8eSopenharmony_ci   * @crossplatform
866661847f8eSopenharmony_ci   * @atomicservice
866761847f8eSopenharmony_ci   * @since 12
866861847f8eSopenharmony_ci   */
866961847f8eSopenharmony_ci  class SM2CryptoUtil {
867061847f8eSopenharmony_ci    /**
867161847f8eSopenharmony_ci     * Generate the SM2 ciphertext in ASN.1 format according to the specific data.
867261847f8eSopenharmony_ci     *
867361847f8eSopenharmony_ci     * @param { SM2CipherTextSpec } spec - indicates the specific data of SM2 ciphertext.
867461847f8eSopenharmony_ci     * @param { string } [mode] - indicates the arrangement mode of the SM2 ciphertext.
867561847f8eSopenharmony_ci     * @returns { DataBlob } the SM2 ciphertext in ASN.1 format.
867661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
867761847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
867861847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
867961847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
868061847f8eSopenharmony_ci     * @static
868161847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
868261847f8eSopenharmony_ci     * @crossplatform
868361847f8eSopenharmony_ci     * @atomicservice
868461847f8eSopenharmony_ci     * @since 12
868561847f8eSopenharmony_ci     */
868661847f8eSopenharmony_ci    static genCipherTextBySpec(spec: SM2CipherTextSpec, mode?: string): DataBlob;
868761847f8eSopenharmony_ci
868861847f8eSopenharmony_ci    /**
868961847f8eSopenharmony_ci     * Get the specific data from the SM2 ciphertext in ASN.1 format.
869061847f8eSopenharmony_ci     *
869161847f8eSopenharmony_ci     * @param { DataBlob } cipherText - indicates the SM2 ciphertext in ASN.1 format.
869261847f8eSopenharmony_ci     * @param { string } [mode] - indicates the arrangement mode of the SM2 ciphertext.
869361847f8eSopenharmony_ci     * @returns { SM2CipherTextSpec } the specific data of SM2 ciphertext.
869461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
869561847f8eSopenharmony_ci     * <br>2. Incorrect parameter types; 3. Parameter verification failed.
869661847f8eSopenharmony_ci     * @throws { BusinessError } 17620001 - memory error.
869761847f8eSopenharmony_ci     * @throws { BusinessError } 17630001 - crypto operation error.
869861847f8eSopenharmony_ci     * @static
869961847f8eSopenharmony_ci     * @syscap SystemCapability.Security.CryptoFramework.Cipher
870061847f8eSopenharmony_ci     * @crossplatform
870161847f8eSopenharmony_ci     * @atomicservice
870261847f8eSopenharmony_ci     * @since 12
870361847f8eSopenharmony_ci     */
870461847f8eSopenharmony_ci    static getCipherTextSpec(cipherText: DataBlob, mode?: string): SM2CipherTextSpec;
870561847f8eSopenharmony_ci  }
870661847f8eSopenharmony_ci}
870761847f8eSopenharmony_ci
870861847f8eSopenharmony_ciexport default cryptoFramework;
8709