ohos-crypto-sys 0.1.0

Raw bindings to the CryptoArchitectureKit NDK of OpenHarmony
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
// automatically generated by rust-bindgen 0.71.1

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#[cfg(feature = "api-20")]
use crate::asym_key::OH_CryptoPrivKey;
use crate::asym_key::OH_CryptoPubKey;
use crate::common::{CryptoResult, Crypto_DataBlob};

#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl CryptoSignature_ParamType {
    /// Indicates the algorithm name of the message digest function.
    pub const CRYPTO_PSS_MD_NAME_STR: CryptoSignature_ParamType = CryptoSignature_ParamType(100);
    /// Indicates the algorithm name for the mask generation function.
    pub const CRYPTO_PSS_MGF_NAME_STR: CryptoSignature_ParamType = CryptoSignature_ParamType(101);
    /// Indicates the message digest parameter for the MGF1 mask generation function.
    pub const CRYPTO_PSS_MGF1_NAME_STR: CryptoSignature_ParamType = CryptoSignature_ParamType(102);
    /// Indicates the salt length in bits.
    pub const CRYPTO_PSS_SALT_LEN_INT: CryptoSignature_ParamType = CryptoSignature_ParamType(103);
    /// Indicates the value for the trailer field.
    pub const CRYPTO_PSS_TRAILER_FIELD_INT: CryptoSignature_ParamType =
        CryptoSignature_ParamType(104);
    /// Indicates the value for user id.
    pub const CRYPTO_SM2_USER_ID_DATABLOB: CryptoSignature_ParamType =
        CryptoSignature_ParamType(105);
}
#[repr(transparent)]
/// Define the signature param type.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct CryptoSignature_ParamType(pub ::core::ffi::c_uint);
/// Define the verify structure.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
pub struct OH_CryptoVerify {
    _unused: [u8; 0],
}
/// Defines the sign structure.
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
#[repr(C)]
pub struct OH_CryptoSign {
    _unused: [u8; 0],
}
/// Defines the ECC signature spec.
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
#[repr(C)]
pub struct OH_CryptoEccSignatureSpec {
    _unused: [u8; 0],
}
extern "C" {
    /// Create a verify context according to the given algorithm name.
    ///
    /// # Arguments
    ///
    /// * `algoName` - Indicates the algorithm name for generating the verify context. Example RSA1024|PKCS1|SHA256.
    ///
    /// * `verify` - Indicates the pointer to the verify context.
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_INVALID_PARAMS`] 401 - If parameter is invalid.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto opertion failed.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_CryptoVerify_Create(
        algoName: *const ::core::ffi::c_char,
        verify: *mut *mut OH_CryptoVerify,
    ) -> CryptoResult;
    /// Init verify context with given public Key.
    ///
    /// # Arguments
    ///
    /// * `ctx` - Indicates the verify context.
    ///
    /// * `pubKey` - indicates the public Key
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_INVALID_PARAMS`] 401 - If parameter is invalid.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto opertion failed.
    /// [`OH_CryptoVerify_Update`] [`OH_CryptoVerify_Final`]
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_CryptoVerify_Init(
        ctx: *mut OH_CryptoVerify,
        pubKey: *mut OH_CryptoPubKey,
    ) -> CryptoResult;
    /// Used to append the message that needs to be verified.
    ///
    /// # Arguments
    ///
    /// * `ctx` - Indicates the verify context.
    ///
    /// * `in` - Indicates the data need to be verified.
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_INVALID_PARAMS`] 401 - If parameter is invalid.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto opertion failed.
    /// [`OH_CryptoVerify_Init`] [`OH_CryptoVerify_Final`]
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_CryptoVerify_Update(
        ctx: *mut OH_CryptoVerify,
        in_: *mut Crypto_DataBlob,
    ) -> CryptoResult;
    /// Used to verify the message.
    ///
    /// # Arguments
    ///
    /// * `ctx` - Indicates the verify context.
    ///
    /// * `in` - Indicates the data need to be verified.
    ///
    /// * `signData` - Indicates the signature data.
    ///
    /// # Returns
    ///
    /// * Return result use bool value.
    /// [`OH_CryptoVerify_Init`] [`OH_CryptoVerify_Update`]
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_CryptoVerify_Final(
        ctx: *mut OH_CryptoVerify,
        in_: *mut Crypto_DataBlob,
        signData: *mut Crypto_DataBlob,
    ) -> bool;
    /// Used to recover signed data.
    ///
    /// # Arguments
    ///
    /// * `ctx` - Indicates the verify context.
    ///
    /// * `signData` - Indicates the signature data.
    ///
    /// * `rawSignData` - Indicates the raw sign data.
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_INVALID_PARAMS`] 401 - If parameter is invalid.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto opertion failed.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_CryptoVerify_Recover(
        ctx: *mut OH_CryptoVerify,
        signData: *mut Crypto_DataBlob,
        rawSignData: *mut Crypto_DataBlob,
    ) -> CryptoResult;
    /// Get the algorithm name of the verify context.
    ///
    /// # Arguments
    ///
    /// * `ctx` - Indicates the verify context.
    ///
    /// # Returns
    ///
    /// * Return verify algorithm name.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_CryptoVerify_GetAlgoName(ctx: *mut OH_CryptoVerify) -> *const ::core::ffi::c_char;
    /// Set the specified parameter to the verify context.
    ///
    /// # Arguments
    ///
    /// * `ctx` - Indicates the verify context.
    ///
    /// * `type` - Indicates the verify parameter type.
    ///
    /// * `value` - Indicates the input data.
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_INVALID_PARAMS`] 401 - If parameter is invalid.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto opertion failed.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_CryptoVerify_SetParam(
        ctx: *mut OH_CryptoVerify,
        type_: CryptoSignature_ParamType,
        value: *mut Crypto_DataBlob,
    ) -> CryptoResult;
    /// Get the specified parameter from the verify context.
    ///
    /// # Arguments
    ///
    /// * `ctx` - Indicates the verify context.
    ///
    /// * `type` - Indicates the verify parameter type.
    ///
    /// * `value` - Indicates the output data.
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_INVALID_PARAMS`] 401 - If parameter is invalid.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto opertion failed.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_CryptoVerify_GetParam(
        ctx: *mut OH_CryptoVerify,
        type_: CryptoSignature_ParamType,
        value: *mut Crypto_DataBlob,
    ) -> CryptoResult;
    /// Destroy the verify context.
    ///
    /// # Arguments
    ///
    /// * `ctx` - Indicates the verify context.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_CryptoVerify_Destroy(ctx: *mut OH_CryptoVerify);
    /// Creates a sign context according to the given algorithm name.
    ///
    /// # Arguments
    ///
    /// * `algoName` - Indicates the algorithm name for generating the sign context. e.g. "RSA|PKCS1|SHA384", "ECC|SHA384".
    ///
    /// * `sign` - Indicates the sign context.
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_PARAMETER_CHECK_FAILED`] 17620003 - If parameter check failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto operation failed.
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_CryptoSign_Create(
        algoName: *const ::core::ffi::c_char,
        sign: *mut *mut OH_CryptoSign,
    ) -> CryptoResult;
    /// Initializes the sign context.
    ///
    /// # Arguments
    ///
    /// * `ctx` - Indicates the sign context.
    ///
    /// * `privKey` - Indicates the private key.
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_PARAMETER_CHECK_FAILED`] 17620003 - If parameter check failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto operation failed.
    /// [`OH_CryptoSign_Update`] [`OH_CryptoSign_Final`]
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_CryptoSign_Init(
        ctx: *mut OH_CryptoSign,
        privKey: *mut OH_CryptoPrivKey,
    ) -> CryptoResult;
    /// Updates the data to be signed.
    ///
    /// # Arguments
    ///
    /// * `ctx` - Indicates the sign context.
    ///
    /// * `in` - Indicates the data to be signed.
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_PARAMETER_CHECK_FAILED`] 17620003 - If parameter check failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto operation failed.
    /// [`OH_CryptoSign_Init`] [`OH_CryptoSign_Final`]
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_CryptoSign_Update(
        ctx: *mut OH_CryptoSign,
        in_: *const Crypto_DataBlob,
    ) -> CryptoResult;
    /// Finalizes the sign operation.
    ///
    /// # Arguments
    ///
    /// * `ctx` - Indicates the sign context.
    ///
    /// * `in` - Indicates the data to be signed, if OH_CryptoSign_Update has been called, this parameter can be NULL.
    ///
    /// * `out` - Indicates the sign result.
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_PARAMETER_CHECK_FAILED`] 17620003 - If parameter check failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto operation failed.
    /// [`OH_CryptoSign_Init`] [`OH_CryptoSign_Update`]
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_CryptoSign_Final(
        ctx: *mut OH_CryptoSign,
        in_: *const Crypto_DataBlob,
        out: *mut Crypto_DataBlob,
    ) -> CryptoResult;
    /// Gets the algorithm name of the sign context.
    ///
    /// # Arguments
    ///
    /// * `ctx` - Indicates the sign context.
    ///
    /// # Returns
    ///
    /// * Return signature algorithm name.
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_CryptoSign_GetAlgoName(ctx: *mut OH_CryptoSign) -> *const ::core::ffi::c_char;
    /// Sets the specified parameter to the sign context.
    ///
    /// # Arguments
    ///
    /// * `ctx` - Indicates the sign context.
    ///
    /// * `type` - Indicates the signature parameter type.
    ///
    /// * `value` - Indicates the input data.
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_PARAMETER_CHECK_FAILED`] 17620003 - If parameter check failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto operation failed.
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_CryptoSign_SetParam(
        ctx: *mut OH_CryptoSign,
        type_: CryptoSignature_ParamType,
        value: *const Crypto_DataBlob,
    ) -> CryptoResult;
    /// Gets the specified parameter from the sign context.
    ///
    /// # Arguments
    ///
    /// * `ctx` - Indicates the sign context.
    ///
    /// * `type` - Indicates the signature parameter type.
    ///
    /// * `value` - Indicates the output data.
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_PARAMETER_CHECK_FAILED`] 17620003 - If parameter check failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto operation failed.
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_CryptoSign_GetParam(
        ctx: *mut OH_CryptoSign,
        type_: CryptoSignature_ParamType,
        value: *mut Crypto_DataBlob,
    ) -> CryptoResult;
    /// Destroys the sign context.
    ///
    /// # Arguments
    ///
    /// * `ctx` - Indicates the sign context.
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_CryptoSign_Destroy(ctx: *mut OH_CryptoSign);
    /// Creates the ECC signature spec, also support SM2 signature.
    ///
    /// # Arguments
    ///
    /// * `eccSignature` - Indicates the ECC signature in DER format, if eccSignature parameter is NULL,
    /// an empty ECC signature spec will be created.
    ///
    /// * `spec` - Indicates the output ECC signature spec.
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_PARAMETER_CHECK_FAILED`] 17620003 - If parameter check failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto operation failed.
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_CryptoEccSignatureSpec_Create(
        eccSignature: *mut Crypto_DataBlob,
        spec: *mut *mut OH_CryptoEccSignatureSpec,
    ) -> CryptoResult;
    /// Gets the r and s value from the ECC signature spec.
    ///
    /// # Arguments
    ///
    /// * `spec` - Indicates the ECC signature spec.
    ///
    /// * `r` - Indicates the output r value.
    ///
    /// * `s` - Indicates the output s value.
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_PARAMETER_CHECK_FAILED`] 17620003 - If parameter check failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto operation failed.
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_CryptoEccSignatureSpec_GetRAndS(
        spec: *mut OH_CryptoEccSignatureSpec,
        r: *mut Crypto_DataBlob,
        s: *mut Crypto_DataBlob,
    ) -> CryptoResult;
    /// Sets the r and s value to the ECC signature spec.
    ///
    /// # Arguments
    ///
    /// * `spec` - Indicates the ECC signature spec.
    ///
    /// * `r` - Indicates the input r value.
    ///
    /// * `s` - Indicates the input s value.
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_PARAMETER_CHECK_FAILED`] 17620003 - If parameter check failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto operation failed.
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_CryptoEccSignatureSpec_SetRAndS(
        spec: *mut OH_CryptoEccSignatureSpec,
        r: *mut Crypto_DataBlob,
        s: *mut Crypto_DataBlob,
    ) -> CryptoResult;
    /// Encodes the ECC signature spec to signature data in DER format.
    ///
    /// # Arguments
    ///
    /// * `spec` - Indicates the ECC signature spec.
    ///
    /// * `out` - Indicates the output data blob.
    ///
    /// # Returns
    ///
    /// * [`OH_Crypto_ErrCode#CRYPTO_SUCCESS`] 0 - If the operation is successful.
    /// [`OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED`] 801 - If the operation is not supported.
    /// [`OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR`] 17620001 - If memory operation failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_PARAMETER_CHECK_FAILED`] 17620003 - If parameter check failed.
    /// [`OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR`] 17630001 - If crypto operation failed.
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_CryptoEccSignatureSpec_Encode(
        spec: *mut OH_CryptoEccSignatureSpec,
        out: *mut Crypto_DataBlob,
    ) -> CryptoResult;
    /// Destroys the ECC signature spec.
    ///
    /// # Arguments
    ///
    /// * `spec` - Indicates the ECC signature spec.
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_CryptoEccSignatureSpec_Destroy(spec: *mut OH_CryptoEccSignatureSpec);
}