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
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2_core_foundation::*;
use crate::*;
extern "C" {
/// Predefined key constant used to get or set item class values in
/// a dictionary. Its value is one of the constants defined in the Value
/// Constants for kSecClass.
///
/// class code. You use this key to get or set a value of type CFTypeRef
/// that contains the item class code.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecclass?language=objc)
pub static kSecClass: &'static CFString;
}
extern "C" {
/// Predefined item class constants used to get or set values in
/// a dictionary. The kSecClass constant is the key and its value is one
/// of the constants defined here. Note: on Mac OS X 10.6, only items
/// of class kSecClassInternetPassword are supported.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecclassinternetpassword?language=objc)
pub static kSecClassInternetPassword: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecclassgenericpassword?language=objc)
pub static kSecClassGenericPassword: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecclasscertificate?language=objc)
pub static kSecClassCertificate: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecclasskey?language=objc)
pub static kSecClassKey: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecclassidentity?language=objc)
pub static kSecClassIdentity: &'static CFString;
}
extern "C" {
/// Predefined item attribute keys used to get or set values in a
/// dictionary. Not all attributes apply to each item class. The table
/// below lists the currently defined attributes for each item class:
///
/// kSecClassGenericPassword item attributes:
/// kSecAttrAccess (macOS only)
/// kSecAttrAccessControl
/// kSecAttrAccessGroup (iOS; also macOS if kSecAttrSynchronizable and/or kSecUseDataProtectionKeychain set)
/// kSecAttrAccessible (iOS; also macOS if kSecAttrSynchronizable and/or kSecUseDataProtectionKeychain set)
/// kSecAttrCreationDate
/// kSecAttrModificationDate
/// kSecAttrDescription
/// kSecAttrComment
/// kSecAttrCreator
/// kSecAttrType
/// kSecAttrLabel
/// kSecAttrIsInvisible
/// kSecAttrIsNegative
/// kSecAttrAccount
/// kSecAttrService
/// kSecAttrGeneric
/// kSecAttrSynchronizable
///
/// kSecClassInternetPassword item attributes:
/// kSecAttrAccess (macOS only)
/// kSecAttrAccessControl
/// kSecAttrAccessGroup (iOS; also macOS if kSecAttrSynchronizable and/or kSecUseDataProtectionKeychain set)
/// kSecAttrAccessible (iOS; also macOS if kSecAttrSynchronizable and/or kSecUseDataProtectionKeychain set)
/// kSecAttrCreationDate
/// kSecAttrModificationDate
/// kSecAttrDescription
/// kSecAttrComment
/// kSecAttrCreator
/// kSecAttrType
/// kSecAttrLabel
/// kSecAttrIsInvisible
/// kSecAttrIsNegative
/// kSecAttrAccount
/// kSecAttrSecurityDomain
/// kSecAttrServer
/// kSecAttrProtocol
/// kSecAttrAuthenticationType
/// kSecAttrPort
/// kSecAttrPath
/// kSecAttrSynchronizable
///
/// kSecClassCertificate item attributes:
/// kSecAttrAccessible (iOS only)
/// kSecAttrAccessControl (iOS only)
/// kSecAttrAccessGroup (iOS only)
/// kSecAttrCertificateType
/// kSecAttrCertificateEncoding
/// kSecAttrLabel
/// kSecAttrSubject
/// kSecAttrIssuer
/// kSecAttrSerialNumber
/// kSecAttrSubjectKeyID
/// kSecAttrPublicKeyHash
/// kSecAttrSynchronizable
///
/// kSecClassKey item attributes:
/// kSecAttrAccess (macOS only)
/// kSecAttrAccessControl
/// kSecAttrAccessGroup (iOS; also macOS if kSecAttrSynchronizable and/or kSecUseDataProtectionKeychain set)
/// kSecAttrAccessible (iOS; also macOS if kSecAttrSynchronizable and/or kSecUseDataProtectionKeychain set)
/// kSecAttrKeyClass
/// kSecAttrLabel
/// kSecAttrApplicationLabel
/// kSecAttrIsPermanent
/// kSecAttrApplicationTag
/// kSecAttrKeyType
/// kSecAttrPRF (macOS only)
/// kSecAttrSalt (macOS only)
/// kSecAttrRounds (macOS only)
/// kSecAttrKeySizeInBits
/// kSecAttrEffectiveKeySize
/// kSecAttrCanEncrypt
/// kSecAttrCanDecrypt
/// kSecAttrCanDerive
/// kSecAttrCanSign
/// kSecAttrCanVerify
/// kSecAttrCanWrap
/// kSecAttrCanUnwrap
/// kSecAttrSynchronizable
///
/// Note that the attributes kSecAttrCan* describe attributes of the
/// key itself at relatively high level. Some of these attributes are
/// mathematical -- for example, a DSA key cannot encrypt. Others are
/// key-level policy issues -- for example, it is good cryptographic
/// hygiene to use an RSA key either for encryption or signing but not
/// both. Compare these to the certificate-level policy values in
/// SecPolicy.h.
///
/// kSecClassIdentity item attributes:
/// Since an identity is the combination of a private key and a
/// certificate, this class shares attributes of both kSecClassKey and
/// kSecClassCertificate.
///
///
/// indicates when your application needs access to an item's data. You
/// should choose the most restrictive option that meets your application's
/// needs to allow the system to protect that item in the best way possible.
/// See the "kSecAttrAccessible Value Constants" section for a list of
/// values which can be specified.
/// IMPORTANT: This attribute is currently not supported for macOS keychain
/// items, unless the kSecAttrSynchronizable attribute is also present. If
/// both attributes are specified on either macOS or iOS, the value for the
/// kSecAttrAccessible key may only be one whose name does not end with
/// "ThisDeviceOnly", as those cannot sync to another device.
///
///
/// is SecAccessControl instance which contains access control conditions
/// for item.
/// IMPORTANT: This attribute is mutually exclusive with kSecAttrAccess
/// attribute.
///
///
/// is a SecAccessRef describing the access control settings for this item.
/// This key is available on macOS only.
///
///
/// a CFStringRef indicating which access group a item is in. The access
/// groups that a particular application has membership in are determined by
/// two entitlements for that application. The application-identifier
/// entitlement contains the application's single access group, unless
/// there is a keychain-access-groups entitlement present. The latter
/// has as its value a list of access groups; the first item in this list
/// is the default access group. Unless a specific access group is provided
/// as the value of kSecAttrAccessGroup when SecItemAdd is called, new items
/// are created in the application's default access group. Specifying this
/// attribute in SecItemCopyMatching, SecItemUpdate, or SecItemDelete calls
/// limits the search to the specified access group (of which the calling
/// application must be a member to obtain matching results.) To share
/// keychain items between multiple applications, each application must have
/// a common group listed in its keychain-access-groups entitlement, and each
/// must specify this shared access group name as the value for the
/// kSecAttrAccessGroup key in the dictionary passed to SecItem functions.
///
///
/// a CFBooleanRef indicating whether the item in question can be synchronized.
/// To add a new item which can be synced to other devices, or to obtain
/// synchronizable results from a query, supply this key with a value of
/// kCFBooleanTrue. If the key is not supplied, or has a value of
/// kCFBooleanFalse, then no synchronizable items will be added or returned.
/// A predefined value, kSecAttrSynchronizableAny, may be provided instead of
/// kCFBooleanTrue if both synchronizable and non-synchronizable results are
/// desired.
///
/// IMPORTANT: Specifying the kSecAttrSynchronizable key has several caveats:
///
/// - Updating or deleting items using the kSecAttrSynchronizable key will
/// affect all copies of the item, not just the one on your local device.
/// Be sure that it makes sense to use the same password on all devices
/// before deciding to make a password synchronizable.
/// - Starting in iOS 14, macOS 11, and watchOS 7, the keychain
/// synchronizes passwords, certificates, and cryptographic keys.
/// Earlier OS versions synchronize only passwords.
/// - Items stored or obtained using the kSecAttrSynchronizable key cannot
/// specify SecAccessRef-based access control with kSecAttrAccess. If a
/// password is intended to be shared between multiple applications, the
/// kSecAttrAccessGroup key must be specified, and each application
/// using this password must have a 'keychain-access-groups' entitlement
/// with the specified access group value.
/// - Items stored or obtained using the kSecAttrSynchronizable key may
/// not also specify a kSecAttrAccessible value which is incompatible
/// with syncing (namely, those whose names end with "ThisDeviceOnly".)
/// - On macOS, when kSecAttrSynchronizable is set to true, returning
/// references is supported only for Certificate, Key or Identity items.
/// - Persistent references to synchronizable items should be avoided;
/// while they may work locally, they cannot be moved between devices,
/// and may not resolve if the item is modified on some other device.
/// - When specifying a query that uses the kSecAttrSynchronizable key,
/// search keys are limited to the item's class and attributes.
/// The only search constant which may be used is kSecMatchLimit; other
/// constants using the kSecMatch prefix are not supported at this time.
///
///
/// non-synchronizable results should be returned from this query. This may be
/// used as a value for the kSecAttrSynchronizable dictionary key in a call to
/// SecItemCopyMatching, SecItemUpdate, or SecItemDelete.
///
///
/// value is the item's creation date. You use this key to get a value
/// of type CFDateRef that represents the date the item was created.
///
/// whose value is the item's modification date. You use this key to get
/// a value of type CFDateRef that represents the last time the item was
/// updated.
///
/// the item's description attribute. You use this key to set or get a
/// value of type CFStringRef that represents a user-visible string
/// describing this particular kind of item (e.g., "disk image password").
///
/// item's comment attribute. You use this key to set or get a value of
/// type CFStringRef containing the user-editable comment for this item.
///
/// item's creator attribute. You use this key to set or get a value of
/// type CFNumberRef that represents the item's creator. This number is
/// the unsigned integer representation of a four-character code (e.g.,
/// 'aCrt').
///
/// type attribute. You use this key to set or get a value of type
/// CFNumberRef that represents the item's type. This number is the
/// unsigned integer representation of a four-character code (e.g.,
/// 'aTyp').
///
/// item's label attribute. You use this key to set or get a value of
/// type CFStringRef containing the user-visible label for this item.
///
/// item's invisible attribute. You use this key to set or get a value
/// of type CFBooleanRef that indicates whether the item is invisible
/// (i.e., should not be displayed.)
///
/// item's negative attribute. You use this key to set or get a value of
/// type CFBooleanRef that indicates whether there is a valid password
/// associated with this keychain item. This is useful if your application
/// doesn't want a password for some particular service to be stored in
/// the keychain, but prefers that it always be entered by the user.
///
/// item's account attribute. You use this key to set or get a CFStringRef
/// that contains an account name. (Items of class
/// kSecClassGenericPassword, kSecClassInternetPassword have this
/// attribute.)
///
/// item's service attribute. You use this key to set or get a CFStringRef
/// that represents the service associated with this item. (Items of class
/// kSecClassGenericPassword have this attribute.)
///
/// item's generic attribute. You use this key to set or get a value of
/// CFDataRef that contains a user-defined attribute. (Items of class
/// kSecClassGenericPassword have this attribute.)
///
/// is the item's security domain attribute. You use this key to set or
/// get a CFStringRef value that represents the Internet security domain.
/// (Items of class kSecClassInternetPassword have this attribute.)
///
/// item's server attribute. You use this key to set or get a value of
/// type CFStringRef that contains the server's domain name or IP address.
/// (Items of class kSecClassInternetPassword have this attribute.)
///
/// item's protocol attribute. You use this key to set or get a value of
/// type CFNumberRef that denotes the protocol for this item (see the
/// SecProtocolType enum in SecKeychainItem.h). (Items of class
/// kSecClassInternetPassword have this attribute.)
///
/// is the item's authentication type attribute. You use this key to set
/// or get a value of type CFNumberRef that denotes the authentication
/// scheme for this item (see the kSecAttrAuthenticationType value
/// constants below).
///
/// port attribute. You use this key to set or get a CFNumberRef value
/// that represents an Internet port number. (Items of class
/// kSecClassInternetPassword have this attribute.)
///
/// path attribute, typically this is the path component of the URL. You use
/// this key to set or get a CFStringRef value that represents a path. (Items
/// of class kSecClassInternetPassword have this attribute.)
///
/// value is the item's subject. You use this key to get a value of type
/// CFDataRef that contains the X.500 subject name of a certificate.
/// (Items of class kSecClassCertificate have this attribute.)
///
/// is the item's issuer. You use this key to get a value of type
/// CFDataRef that contains the X.500 issuer name of a certificate. (Items
/// of class kSecClassCertificate have this attribute.)
///
/// value is the item's serial number. You use this key to get a value
/// of type CFDataRef that contains the serial number data of a
/// certificate. (Items of class kSecClassCertificate have this
/// attribute.)
///
/// value is the item's subject key ID. You use this key to get a value
/// of type CFDataRef that contains the subject key ID of a certificate.
/// (Items of class kSecClassCertificate have this attribute.)
///
/// whose value is the item's public key hash. You use this key to get a
/// value of type CFDataRef that contains the hash of a certificate's
/// public key. (Items of class kSecClassCertificate have this attribute.)
///
/// whose value is the item's certificate type. You use this key to get
/// a value of type CFNumberRef that denotes the certificate type
/// (On iOS, currently the value of this attribute must be equal to the
/// version of the X509 certificate. So, 1 for v1, 2 for v2, and 3 for v3
/// certificates). (On macOS, see the CSSM_CERT_TYPE enum in cssmtype.h).
/// Only items of class kSecClassCertificate have this attribute.
///
/// key whose value is the item's certificate encoding. You use this key
/// to get a value of type CFNumberRef that denotes the certificate
/// encoding (On iOS, currently only the value 3 meaning
/// kSecAttrCertificateEncodingDER is supported). On macOS, see the
/// CSSM_CERT_ENCODING enum in cssmtype.h. Only items of class
/// kSecClassCertificate have this attribute.
///
/// value is one of kSecAttrKeyClassPublic, kSecAttrKeyClassPrivate or
/// kSecAttrKeyClassSymmetric.
///
/// is the key's application label attribute. This is different from the
/// kSecAttrLabel (which is intended to be human-readable). This attribute
/// is used to look up a key programmatically; in particular, for keys of
/// class kSecAttrKeyClassPublic and kSecAttrKeyClassPrivate, the value of
/// this attribute is the hash of the public key. This item is a type of CFDataRef.
/// Legacy keys may contain a UUID in this field as a CFStringRef.
///
/// CFBooleanRef indicating whether the key in question will be stored
/// permanently.
///
/// CFBooleanRef indicating that the key in question can only be exported
/// in a wrapped (encrypted) format. macOS only.
///
/// CFBooleanRef indicating whether the key in question can be exported from
/// its keychain container. macOS only.
///
/// CFDataRef containing private tag data.
///
/// CFNumberRef indicating the algorithm associated with this key
/// (On iOS, currently only the value 42 is supported, alternatively you can use
/// kSecAttrKeyTypeRSA). (On macOS, see the CSSM_ALGORITHMS enum in cssmtype.h).
///
///
/// (pseudo-random function) for this key (see "kSecAttrPRF Value Constants".)
/// macOS only.
///
/// CFData containing the salt to use for this key. macOS only.
///
/// number of rounds for the pseudo-random function specified by kSecAttrPRF.
/// macOS only.
///
/// is a CFNumberRef indicating the number of bits in this key.
///
/// is a CFNumberRef indicating the effective number of bits in this key.
/// For example, a DES key has a kSecAttrKeySizeInBits of 64, but a
/// kSecAttrEffectiveKeySize of 56 bits.
///
/// CFBooleanRef indicating whether the key in question can be used to
/// encrypt data.
///
/// CFBooleanRef indicating whether the key in question can be used to
/// decrypt data.
///
/// CFBooleanRef indicating whether the key in question can be used to
/// derive another key.
///
/// CFBooleanRef indicating whether the key in question can be used to
/// create a digital signature.
///
/// CFBooleanRef indicating whether the key in question can be used to
/// verify a digital signature.
///
/// CFBooleanRef indicating whether the key in question can be used to
/// wrap another key.
///
/// CFBooleanRef indicating whether the key in question can be used to
/// unwrap another key.
///
/// a CFStringRef. This value is part of the primary key of each item, and
/// can be used to help distiguish Sync Views when defining their
/// queries. iOS and sychronizable items only.
///
/// indicates that item is backed by external token. Value of this attribute
/// is CFStringRef uniquely identifying containing token. When this attribute
/// is not present, item is stored in internal keychain database.
/// Note that once item is created, this attribute cannot be changed - in other
/// words it is not possible to migrate existing items to, from or between tokens.
/// Currently the only available value for this attribute is
/// kSecAttrTokenIDSecureEnclave, which indicates that item (private key) is
/// backed by device's Secure Enclave.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecattraccessible?language=objc)
pub static kSecAttrAccessible: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattraccess?language=objc)
pub static kSecAttrAccess: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattraccesscontrol?language=objc)
pub static kSecAttrAccessControl: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattraccessgroup?language=objc)
pub static kSecAttrAccessGroup: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrsynchronizable?language=objc)
pub static kSecAttrSynchronizable: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrsynchronizableany?language=objc)
pub static kSecAttrSynchronizableAny: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrcreationdate?language=objc)
pub static kSecAttrCreationDate: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrmodificationdate?language=objc)
pub static kSecAttrModificationDate: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrdescription?language=objc)
pub static kSecAttrDescription: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrcomment?language=objc)
pub static kSecAttrComment: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrcreator?language=objc)
pub static kSecAttrCreator: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrtype?language=objc)
pub static kSecAttrType: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrlabel?language=objc)
pub static kSecAttrLabel: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrisinvisible?language=objc)
pub static kSecAttrIsInvisible: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrisnegative?language=objc)
pub static kSecAttrIsNegative: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattraccount?language=objc)
pub static kSecAttrAccount: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrservice?language=objc)
pub static kSecAttrService: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrgeneric?language=objc)
pub static kSecAttrGeneric: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrsecuritydomain?language=objc)
pub static kSecAttrSecurityDomain: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrserver?language=objc)
pub static kSecAttrServer: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocol?language=objc)
pub static kSecAttrProtocol: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrauthenticationtype?language=objc)
pub static kSecAttrAuthenticationType: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrport?language=objc)
pub static kSecAttrPort: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrpath?language=objc)
pub static kSecAttrPath: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrsubject?language=objc)
pub static kSecAttrSubject: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrissuer?language=objc)
pub static kSecAttrIssuer: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrserialnumber?language=objc)
pub static kSecAttrSerialNumber: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrsubjectkeyid?language=objc)
pub static kSecAttrSubjectKeyID: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrpublickeyhash?language=objc)
pub static kSecAttrPublicKeyHash: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrcertificatetype?language=objc)
pub static kSecAttrCertificateType: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrcertificateencoding?language=objc)
pub static kSecAttrCertificateEncoding: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeyclass?language=objc)
pub static kSecAttrKeyClass: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrapplicationlabel?language=objc)
pub static kSecAttrApplicationLabel: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrispermanent?language=objc)
pub static kSecAttrIsPermanent: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrissensitive?language=objc)
pub static kSecAttrIsSensitive: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrisextractable?language=objc)
pub static kSecAttrIsExtractable: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrapplicationtag?language=objc)
pub static kSecAttrApplicationTag: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeytype?language=objc)
pub static kSecAttrKeyType: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprf?language=objc)
pub static kSecAttrPRF: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrsalt?language=objc)
pub static kSecAttrSalt: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrrounds?language=objc)
pub static kSecAttrRounds: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeysizeinbits?language=objc)
pub static kSecAttrKeySizeInBits: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattreffectivekeysize?language=objc)
pub static kSecAttrEffectiveKeySize: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrcanencrypt?language=objc)
pub static kSecAttrCanEncrypt: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrcandecrypt?language=objc)
pub static kSecAttrCanDecrypt: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrcanderive?language=objc)
pub static kSecAttrCanDerive: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrcansign?language=objc)
pub static kSecAttrCanSign: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrcanverify?language=objc)
pub static kSecAttrCanVerify: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrcanwrap?language=objc)
pub static kSecAttrCanWrap: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrcanunwrap?language=objc)
pub static kSecAttrCanUnwrap: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrsyncviewhint?language=objc)
pub static kSecAttrSyncViewHint: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrtokenid?language=objc)
pub static kSecAttrTokenID: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrpersistantreference?language=objc)
pub static kSecAttrPersistantReference: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrpersistentreference?language=objc)
pub static kSecAttrPersistentReference: &'static CFString;
}
extern "C" {
/// Predefined item attribute constants used to get or set values
/// in a dictionary. The kSecAttrAccessible constant is the key and its
/// value is one of the constants defined here.
/// When asking SecItemCopyMatching to return the item's data, the error
/// errSecInteractionNotAllowed will be returned if the item's data is not
/// available until a device unlock occurs.
///
/// while the device is unlocked. This is recommended for items that only
/// need be accesible while the application is in the foreground. Items
/// with this attribute will migrate to a new device when using encrypted
/// backups.
///
/// accessed once the device has been unlocked after a restart. This is
/// recommended for items that need to be accesible by background
/// applications. Items with this attribute will migrate to a new device
/// when using encrypted backups.
///
/// regardless of the lock state of the device. This is not recommended
/// for anything except system use. Items with this attribute will migrate
/// to a new device when using encrypted backups.
///
/// only be accessed while the device is unlocked. This is recommended for
/// items that only need to be accessible while the application is in the
/// foreground and requires a passcode to be set on the device. Items with
/// this attribute will never migrate to a new device, so after a backup
/// is restored to a new device, these items will be missing. This
/// attribute will not be available on devices without a passcode. Disabling
/// the device passcode will cause all previously protected items to
/// be deleted.
///
/// be accessed while the device is unlocked. This is recommended for items
/// that only need be accesible while the application is in the foreground.
/// Items with this attribute will never migrate to a new device, so after
/// a backup is restored to a new device, these items will be missing.
///
/// only be accessed once the device has been unlocked after a restart.
/// This is recommended for items that need to be accessible by background
/// applications. Items with this attribute will never migrate to a new
/// device, so after a backup is restored to a new device these items will
/// be missing.
///
/// be accessed regardless of the lock state of the device. This option
/// is not recommended for anything except system use. Items with this
/// attribute will never migrate to a new device, so after a backup is
/// restored to a new device, these items will be missing.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecattraccessiblewhenunlocked?language=objc)
pub static kSecAttrAccessibleWhenUnlocked: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattraccessibleafterfirstunlock?language=objc)
pub static kSecAttrAccessibleAfterFirstUnlock: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattraccessiblealways?language=objc)
#[deprecated = "Use an accessibility level that provides some user protection, such as kSecAttrAccessibleAfterFirstUnlock"]
pub static kSecAttrAccessibleAlways: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattraccessiblewhenpasscodesetthisdeviceonly?language=objc)
pub static kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattraccessiblewhenunlockedthisdeviceonly?language=objc)
pub static kSecAttrAccessibleWhenUnlockedThisDeviceOnly: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattraccessibleafterfirstunlockthisdeviceonly?language=objc)
pub static kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattraccessiblealwaysthisdeviceonly?language=objc)
#[deprecated = "Use an accessibility level that provides some user protection, such as kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly"]
pub static kSecAttrAccessibleAlwaysThisDeviceOnly: &'static CFString;
}
extern "C" {
/// Predefined item attribute constants used to get or set values
/// in a dictionary. The kSecAttrProtocol constant is the key and its
/// value is one of the constants defined here.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolftp?language=objc)
pub static kSecAttrProtocolFTP: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolftpaccount?language=objc)
pub static kSecAttrProtocolFTPAccount: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolhttp?language=objc)
pub static kSecAttrProtocolHTTP: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolirc?language=objc)
pub static kSecAttrProtocolIRC: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolnntp?language=objc)
pub static kSecAttrProtocolNNTP: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolpop3?language=objc)
pub static kSecAttrProtocolPOP3: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolsmtp?language=objc)
pub static kSecAttrProtocolSMTP: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolsocks?language=objc)
pub static kSecAttrProtocolSOCKS: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolimap?language=objc)
pub static kSecAttrProtocolIMAP: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolldap?language=objc)
pub static kSecAttrProtocolLDAP: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolappletalk?language=objc)
pub static kSecAttrProtocolAppleTalk: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolafp?language=objc)
pub static kSecAttrProtocolAFP: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocoltelnet?language=objc)
pub static kSecAttrProtocolTelnet: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolssh?language=objc)
pub static kSecAttrProtocolSSH: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolftps?language=objc)
pub static kSecAttrProtocolFTPS: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolhttps?language=objc)
pub static kSecAttrProtocolHTTPS: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolhttpproxy?language=objc)
pub static kSecAttrProtocolHTTPProxy: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolhttpsproxy?language=objc)
pub static kSecAttrProtocolHTTPSProxy: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolftpproxy?language=objc)
pub static kSecAttrProtocolFTPProxy: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolsmb?language=objc)
pub static kSecAttrProtocolSMB: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolrtsp?language=objc)
pub static kSecAttrProtocolRTSP: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolrtspproxy?language=objc)
pub static kSecAttrProtocolRTSPProxy: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocoldaap?language=objc)
pub static kSecAttrProtocolDAAP: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocoleppc?language=objc)
pub static kSecAttrProtocolEPPC: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolipp?language=objc)
pub static kSecAttrProtocolIPP: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolnntps?language=objc)
pub static kSecAttrProtocolNNTPS: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolldaps?language=objc)
pub static kSecAttrProtocolLDAPS: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocoltelnets?language=objc)
pub static kSecAttrProtocolTelnetS: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolimaps?language=objc)
pub static kSecAttrProtocolIMAPS: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolircs?language=objc)
pub static kSecAttrProtocolIRCS: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprotocolpop3s?language=objc)
pub static kSecAttrProtocolPOP3S: &'static CFString;
}
extern "C" {
/// Predefined item attribute constants used to get or set values
/// in a dictionary. The kSecAttrAuthenticationType constant is the key
/// and its value is one of the constants defined here.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrauthenticationtypentlm?language=objc)
pub static kSecAttrAuthenticationTypeNTLM: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrauthenticationtypemsn?language=objc)
pub static kSecAttrAuthenticationTypeMSN: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrauthenticationtypedpa?language=objc)
pub static kSecAttrAuthenticationTypeDPA: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrauthenticationtyperpa?language=objc)
pub static kSecAttrAuthenticationTypeRPA: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrauthenticationtypehttpbasic?language=objc)
pub static kSecAttrAuthenticationTypeHTTPBasic: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrauthenticationtypehttpdigest?language=objc)
pub static kSecAttrAuthenticationTypeHTTPDigest: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrauthenticationtypehtmlform?language=objc)
pub static kSecAttrAuthenticationTypeHTMLForm: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrauthenticationtypedefault?language=objc)
pub static kSecAttrAuthenticationTypeDefault: &'static CFString;
}
extern "C" {
/// Predefined item attribute constants used to get or set values
/// in a dictionary. The kSecAttrKeyClass constant is the key
/// and its value is one of the constants defined here.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeyclasspublic?language=objc)
pub static kSecAttrKeyClassPublic: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeyclassprivate?language=objc)
pub static kSecAttrKeyClassPrivate: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeyclasssymmetric?language=objc)
pub static kSecAttrKeyClassSymmetric: &'static CFString;
}
extern "C" {
/// Predefined item attribute constants used to get or set values
/// in a dictionary. The kSecAttrKeyType constant is the key
/// and its value is one of the constants defined here.
///
/// The size is specified by kSecAttrKeySizeInBits attribute. Curves are defined in FIPS PUB 186-4 standard.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeytypersa?language=objc)
pub static kSecAttrKeyTypeRSA: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeytypedsa?language=objc)
pub static kSecAttrKeyTypeDSA: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeytypeaes?language=objc)
pub static kSecAttrKeyTypeAES: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeytypedes?language=objc)
pub static kSecAttrKeyTypeDES: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeytype3des?language=objc)
pub static kSecAttrKeyType3DES: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeytyperc4?language=objc)
pub static kSecAttrKeyTypeRC4: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeytyperc2?language=objc)
pub static kSecAttrKeyTypeRC2: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeytypecast?language=objc)
pub static kSecAttrKeyTypeCAST: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeytypeecdsa?language=objc)
pub static kSecAttrKeyTypeECDSA: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeytypeec?language=objc)
pub static kSecAttrKeyTypeEC: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrkeytypeecsecprimerandom?language=objc)
pub static kSecAttrKeyTypeECSECPrimeRandom: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprfhmacalgsha1?language=objc)
pub static kSecAttrPRFHmacAlgSHA1: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprfhmacalgsha224?language=objc)
pub static kSecAttrPRFHmacAlgSHA224: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprfhmacalgsha256?language=objc)
pub static kSecAttrPRFHmacAlgSHA256: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprfhmacalgsha384?language=objc)
pub static kSecAttrPRFHmacAlgSHA384: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrprfhmacalgsha512?language=objc)
pub static kSecAttrPRFHmacAlgSHA512: &'static CFString;
}
extern "C" {
/// Predefined search constants used to set values in a query
/// dictionary. You can specify a combination of search attributes and
/// item attributes when looking for matching items with the
/// SecItemCopyMatching function.
///
/// SecPolicyRef. If provided, returned certificates or identities must
/// verify with this policy.
///
/// CFArray of SecKeychainItemRef items. If provided, returned items will be
/// limited to the subset which are contained in this list.
///
/// CFArray of SecKeychainRef items. If provided, the search will be limited
/// to the keychains contained in this list.
///
/// CFArray of X.500 names (of type CFDataRef). If provided, returned
/// certificates or identities will be limited to those whose
/// certificate chain contains one of the issuers provided in this list.
///
/// value is a CFStringRef containing an RFC822 email address. If
/// provided, returned certificates or identities will be limited to those
/// that contain the address in their subject or subject alternative name.
///
/// is a CFStringRef. If provided, returned certificates or identities
/// will be limited to those containing this string in the subject.
///
/// is a CFStringRef. If provided, returned internet passwords will be limited to those which
/// have a server host that is equal to or a subdomain of this string. This filter only works on
/// the Data Protection Keychain on macOS.
///
/// is a CFStringRef. If provided, returned certificates or identities
/// will be limited to those with subject names that start with this string.
///
/// is a CFStringRef. If provided, returned certificates or identities
/// will be limited to those with subject names that end with this string.
///
/// value is a CFStringRef. If provided, returned certificates or identities
/// will be limited to those matching this string exactly in the subject.
///
/// is a CFBooleanRef. If this value is kCFBooleanFalse, or is not
/// provided, then case-sensitive string matching is performed.
///
/// value is a CFBooleanRef. If this value is kCFBooleanFalse, or is not
/// provided, then diacritic-sensitive string matching is performed.
///
/// value is a CFBooleanRef. If this value is kCFBooleanFalse, or is not
/// provided, then string matching is width-sensitive (e.g. 'a' != 0xFF41).
///
/// a CFBooleanRef. If provided with a value of kCFBooleanTrue, only
/// certificates which can be verified back to a trusted anchor will be
/// returned. If this value is kCFBooleanFalse, or is not provided, then
/// both trusted and untrusted certificates may be returned.
///
/// of type CFDateRef. If provided, returned keys, certificates or
/// identities will be limited to those which are valid for the given date.
/// Pass a value of kCFNull to indicate the current date.
///
/// CFNumberRef. If provided, this value specifies the maximum number of
/// results to return. If not provided, results are limited to the first
/// item found. Predefined values are provided for a single item
/// (kSecMatchLimitOne) and all matching items (kSecMatchLimitAll).
///
/// item found; used as a value for the kSecMatchLimit dictionary key.
///
/// may be returned; used as a value for the kSecMatchLimit dictionary
/// key.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchpolicy?language=objc)
pub static kSecMatchPolicy: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchitemlist?language=objc)
pub static kSecMatchItemList: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchsearchlist?language=objc)
pub static kSecMatchSearchList: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchissuers?language=objc)
pub static kSecMatchIssuers: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchemailaddressifpresent?language=objc)
pub static kSecMatchEmailAddressIfPresent: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchsubjectcontains?language=objc)
pub static kSecMatchSubjectContains: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchhostorsubdomainofhost?language=objc)
pub static kSecMatchHostOrSubdomainOfHost: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchsubjectstartswith?language=objc)
pub static kSecMatchSubjectStartsWith: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchsubjectendswith?language=objc)
pub static kSecMatchSubjectEndsWith: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchsubjectwholestring?language=objc)
pub static kSecMatchSubjectWholeString: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchcaseinsensitive?language=objc)
pub static kSecMatchCaseInsensitive: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchdiacriticinsensitive?language=objc)
pub static kSecMatchDiacriticInsensitive: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchwidthinsensitive?language=objc)
pub static kSecMatchWidthInsensitive: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchtrustedonly?language=objc)
pub static kSecMatchTrustedOnly: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchvalidondate?language=objc)
pub static kSecMatchValidOnDate: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchlimit?language=objc)
pub static kSecMatchLimit: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchlimitone?language=objc)
pub static kSecMatchLimitOne: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecmatchlimitall?language=objc)
pub static kSecMatchLimitAll: &'static CFString;
}
extern "C" {
/// Predefined return type keys used to set values in a dictionary.
/// You use these keys to specify the type of results which should be
/// returned by the SecItemCopyMatching or SecItemAdd function. You can
/// specify zero or more of these return types. If more than one of these
/// result types is specified, the result is returned as a CFDictionaryRef
/// whose keys are the result types and values are the requested data.
///
/// CFBooleanRef. A value of kCFBooleanTrue indicates that the data of
/// an item (CFDataRef) should be returned. For keys and password
/// items, data is secret (encrypted) and may require the user to enter
/// a password for access.
///
/// of type CFBooleanRef. A value of kCFBooleanTrue indicates that the
/// (non-encrypted) attributes of an item (CFDictionaryRef) should be
/// returned.
///
/// CFBooleanRef. A value of kCFBooleanTrue indicates that a reference
/// should be returned. Depending on the item class requested, the
/// returned reference(s) may be of type SecKeychainItemRef, SecKeyRef,
/// SecCertificateRef, or SecIdentityRef. Note that returning references is
/// supported only for Certificate, Key or Identity items on iOS, watchOS and
/// tvOS. Similarly, returning references is supported only for Certificate, Key
/// or Identity items on macOS when either kSecUseDataProtectionKeychain
/// is set to true or kSecAttrSynchronizable is set to true.
///
/// is of type CFBooleanRef. A value of kCFBooleanTrue indicates that a
/// persistent reference to an item (CFDataRef) should be returned.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecreturndata?language=objc)
pub static kSecReturnData: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecreturnattributes?language=objc)
pub static kSecReturnAttributes: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecreturnref?language=objc)
pub static kSecReturnRef: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecreturnpersistentref?language=objc)
pub static kSecReturnPersistentRef: &'static CFString;
}
extern "C" {
/// Predefined value type keys used to pass values in a dictionary.
/// You can specify zero or more of these types depending on the function
/// you are calling. For SecItemCopyMatching or SecItemAdd these are
/// used as keys in the results dictionary.
///
/// CFDataRef. For keys and password items, data is secret (encrypted)
/// and may require the user to enter a password for access.
///
/// on the item class requested, is of type SecKeychainItemRef, SecKeyRef,
/// SecCertificateRef, or SecIdentityRef.
///
/// is of type CFDataRef. The bytes in this CFDataRef can be stored by
/// the caller and used on a subsequent invocation of the application (or
/// even a different application) to retrieve the item referenced by it.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecvaluedata?language=objc)
pub static kSecValueData: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecvalueref?language=objc)
pub static kSecValueRef: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecvaluepersistentref?language=objc)
pub static kSecValuePersistentRef: &'static CFString;
}
extern "C" {
/// Predefined constants used to set values in a dictionary.
///
/// CFArray of items. If provided, this array is treated as the set of
/// all possible items to search, or add if the API being called is
/// SecItemAdd. The items in this array may be of type SecKeyRef,
/// SecCertificateRef, SecIdentityRef, or CFDataRef (for a persistent
/// item reference.) The items in the array must all be of the same
/// type. When this attribute is provided, no keychains are searched.
///
/// keychain reference. You use this key to specify a value of type
/// SecKeychainRef to which SecItemAdd will add the provided item(s).
///
/// is a CFStringRef that represents a user-visible string describing
/// the operation for which the application is attempting to authenticate.
/// The application is responsible for the text localization.
///
/// is a CFBooleanRef. If provided with a value of kCFBooleanTrue, the error
/// errSecInteractionNotAllowed will be returned if the item is attempting
/// to authenticate with UI. Note: on macOS, this attribute only applies to items stored
/// in the Data Protection keychain. Legacy keychain items will still activate UI if needed.
///
/// is one of kSecUseAuthenticationUIAllow, kSecUseAuthenticationUIFail, kSecUseAuthenticationUISkip.
///
/// is LAContext to be used for keychain item authentication.
/// If the item requires authentication and this key is omitted, a new context
/// will be created just for the purpose of the single call.
/// If the specified context has been previously authenticated, the operation
/// will succeed without asking user for authentication.
/// If the specified context has not been previously authenticated, the new
/// authentication will be started on this context, allowing caller to
/// eventually reuse the successfully authenticated context in subsequent
/// keychain operations.
///
/// is a CFBooleanRef. Set to kCFBooleanTrue to use kSecAttrAccessGroup and/or
/// kSecAttrAccessible on macOS without requiring the item to be marked synchronizable.
/// Note that when kSecUseDataProtectionKeychain is set to true, returning references is
/// supported only for Certificate, Key or Identity items.
///
/// indicating whether the item is shared with other personas on the system.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecuseitemlist?language=objc)
#[deprecated = "Not implemented on this platform"]
pub static kSecUseItemList: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecusekeychain?language=objc)
pub static kSecUseKeychain: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecuseoperationprompt?language=objc)
#[deprecated = "Use kSecUseAuthenticationContext and set LAContext.localizedReason property"]
pub static kSecUseOperationPrompt: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecusenoauthenticationui?language=objc)
#[deprecated = "Use kSecUseAuthenticationUI instead."]
pub static kSecUseNoAuthenticationUI: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecuseauthenticationui?language=objc)
pub static kSecUseAuthenticationUI: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecuseauthenticationcontext?language=objc)
pub static kSecUseAuthenticationContext: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecusedataprotectionkeychain?language=objc)
pub static kSecUseDataProtectionKeychain: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecuseuserindependentkeychain?language=objc)
pub static kSecUseUserIndependentKeychain: &'static CFString;
}
extern "C" {
/// Predefined item attribute constants used to get or set values
/// in a dictionary. The kSecUseAuthenticationUI constant is the key and its
/// value is one of the constants defined here.
/// If the key kSecUseAuthenticationUI not provided then kSecUseAuthenticationUIAllow
/// is used as default.
///
///
/// errSecInteractionNotAllowed will be returned if an item needs
/// to authenticate with UI
///
/// to authenticate with UI will be silently skipped. This value can be used
/// only with SecItemCopyMatching.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecuseauthenticationuiallow?language=objc)
#[deprecated = "Instead of kSecUseAuthenticationUI, use kSecUseAuthenticationContext and set LAContext.interactionNotAllowed property"]
pub static kSecUseAuthenticationUIAllow: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecuseauthenticationuifail?language=objc)
#[deprecated = "Instead of kSecUseAuthenticationUI, use kSecUseAuthenticationContext and set LAContext.interactionNotAllowed property"]
pub static kSecUseAuthenticationUIFail: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/security/ksecuseauthenticationuiskip?language=objc)
pub static kSecUseAuthenticationUISkip: &'static CFString;
}
extern "C" {
/// Predefined item attribute constant used to get or set values
/// in a dictionary. The kSecAttrTokenID constant is the key and its value
/// can be kSecAttrTokenIDSecureEnclave.
///
/// token implemented using device's Secure Enclave. The only keychain items
/// supported by the Secure Enclave token are 256-bit elliptic curve keys
/// (kSecAttrKeyTypeECSecPrimeRandom). Keys must be generated on the secure enclave using
/// SecKeyGenerateKeyPair call with kSecAttrTokenID set to
/// kSecAttrTokenIDSecureEnclave in the parameters dictionary, it is not
/// possible to import pregenerated keys to kSecAttrTokenIDSecureEnclave token.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecattrtokenidsecureenclave?language=objc)
pub static kSecAttrTokenIDSecureEnclave: &'static CFString;
}
extern "C" {
/// which contains items provided by external token (typically smart card).
/// This may be used as a value for kSecAttrAccessGroup attribute. Every
/// application has access to this access group so it is not needed to
/// explicitly list it in keychain-access-groups entitlement, but application
/// must explicitly state this access group in keychain queries in order to
/// be able to access items from external tokens.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksecattraccessgrouptoken?language=objc)
pub static kSecAttrAccessGroupToken: &'static CFString;
}
extern "C-unwind" {
/// Returns one or more items which match a search query.
///
/// Parameter `query`: A dictionary containing an item class specification and
/// optional attributes for controlling the search. See the "Keychain
/// Search Attributes" section for a description of currently defined
/// search attributes.
///
/// Parameter `result`: On return, a CFTypeRef reference to the found item(s). The
/// exact type of the result is based on the search attributes supplied
/// in the query, as discussed below.
///
/// Returns: A result code. See "Security Error Codes" (SecBase.h).
///
/// Attributes defining a search are specified by adding key/value
/// pairs to the query dictionary.
///
/// A typical query consists of:
///
/// a kSecClass key, whose value is a constant from the Class
/// Constants section that specifies the class of item(s) to be searched
/// one or more keys from the "Attribute Key Constants" section, whose value
/// is the attribute data to be matched
/// one or more keys from the "Search Constants" section, whose value is
/// used to further refine the search
/// a key from the "Return Type Key Constants" section, specifying the type of
/// results desired
///
/// Result types are specified as follows:
///
/// To obtain the data of a matching item (CFDataRef), specify
/// kSecReturnData with a value of kCFBooleanTrue.
/// To obtain the attributes of a matching item (CFDictionaryRef), specify
/// kSecReturnAttributes with a value of kCFBooleanTrue.
/// To obtain a reference to a matching item (SecKeychainItemRef,
/// SecKeyRef, SecCertificateRef, or SecIdentityRef), specify kSecReturnRef
/// with a value of kCFBooleanTrue. Note that returning references is
/// supported only for Certificate, Key or Identity items on iOS, watchOS and
/// tvOS. Similarly, returning references is supported only for Certificate, Key
/// or Identity items on macOS when either kSecUseDataProtectionKeychain
/// is set to true or kSecAttrSynchronizable is set to true.
/// To obtain a persistent reference to a matching item (CFDataRef),
/// specify kSecReturnPersistentRef with a value of kCFBooleanTrue. Note
/// that unlike normal references, a persistent reference may be stored
/// on disk or passed between processes.
/// If more than one of these result types is specified, the result is
/// returned as a CFDictionaryRef containing all the requested data.
/// If a result type is not specified, no results are returned.
///
/// By default, this function returns only the first match found. To obtain
/// more than one matching item at a time, specify kSecMatchLimit with a value
/// greater than 1. The result will be a CFArrayRef containing up to that
/// number of matching items; the items' types are described above.
///
/// To filter a provided list of items down to those matching the query,
/// specify a kSecMatchItemList whose value is a CFArray of SecKeychainItemRef,
/// SecKeyRef, SecCertificateRef, or SecIdentityRef items. The objects in the
/// provided array must be of the same type.
///
/// On iOS, to convert from a persistent item reference to a normal item reference,
/// specify a kSecValuePersistentRef whose value a CFDataRef (the persistent
/// reference), and a kSecReturnRef whose value is kCFBooleanTrue.
///
/// On macOS, to convert from persistent item references to normal item references,
/// specify a kSecMatchItemList whose value is a CFArray containing one or
/// more CFDataRef elements (the persistent reference), and a kSecReturnRef
/// whose value is kCFBooleanTrue. The objects in the provided array must be
/// of the same type.
///
/// # Safety
///
/// - `query` generics must be of the correct type.
/// - `result` must be a valid pointer or null.
pub fn SecItemCopyMatching(query: &CFDictionary, result: *mut *const CFType) -> OSStatus;
}
extern "C-unwind" {
/// Add one or more items to a keychain.
///
/// Parameter `attributes`: A dictionary containing an item class specification and
/// optional entries specifying the item's attribute values. See the
/// "Attribute Key Constants" section for a description of currently defined
/// attributes.
///
/// Parameter `result`: On return, a CFTypeRef reference to the newly added item(s).
/// The exact type of the result is based on the values supplied
/// in attributes, as discussed below. Pass NULL if this result is not
/// required.
///
/// Returns: A result code. See "Security Error Codes" (SecBase.h).
///
/// Attributes defining an item are specified by adding key/value
/// pairs to the attributes dictionary. To add multiple items to a keychain
/// at once use the kSecUseItemList key with an array of items as its value.
/// This is currently only supported for non password items.
///
/// On macOS, to add an item to a particular keychain, supply kSecUseKeychain
/// with a SecKeychainRef as its value.
///
/// On iOS, watchOS
/// &
/// tvOS, Certificate, Key, and Identity items may be
/// added by reference, but neither Internet Passwords nor Generic Passwords
/// may be. Similarly, on macOS with either kSecUseDataProtectionKeychain
/// set to true or kSecAttrSynchronizable set to true, Certificate, Key, and Identity
/// items may be added by reference, but neither Internet Passwords nor Generic
/// Passwords may be.
///
/// Result types are specified as follows:
///
/// To obtain the data of the added item (CFDataRef), specify
/// kSecReturnData with a value of kCFBooleanTrue.
/// To obtain all the attributes of the added item (CFDictionaryRef),
/// specify kSecReturnAttributes with a value of kCFBooleanTrue.
/// To obtain a reference to the added item (SecKeychainItemRef, SecKeyRef,
/// SecCertificateRef, or SecIdentityRef), specify kSecReturnRef with a
/// value of kCFBooleanTrue. See also note about kSecReturnRef and
/// macOS.
/// To obtain a persistent reference to the added item (CFDataRef), specify
/// kSecReturnPersistentRef with a value of kCFBooleanTrue. Note that
/// unlike normal references, a persistent reference may be stored on disk
/// or passed between processes.
/// If more than one of these result types is specified, the result is
/// returned as a CFDictionaryRef containing all the requested data.
/// On iOS, if a result type is not specified, no results are returned.
/// On macOS, the added item is returned.
///
/// # Safety
///
/// - `attributes` generics must be of the correct type.
/// - `result` must be a valid pointer or null.
pub fn SecItemAdd(attributes: &CFDictionary, result: *mut *const CFType) -> OSStatus;
}
extern "C-unwind" {
/// Modify zero or more items which match a search query.
///
/// Parameter `query`: A dictionary containing an item class specification and
/// optional attributes for controlling the search. See the "Attribute
/// Constants" and "Search Constants" sections for a description of
/// currently defined search attributes.
///
/// Parameter `attributesToUpdate`: A dictionary containing one or more attributes
/// whose values should be set to the ones specified. Only real keychain
/// attributes are permitted in this dictionary (no "meta" attributes are
/// allowed.) See the "Attribute Key Constants" section for a description of
/// currently defined value attributes.
///
/// Returns: A result code. See "Security Error Codes" (SecBase.h).
///
/// Attributes defining a search are specified by adding key/value
/// pairs to the query dictionary.
///
/// # Safety
///
/// - `query` generics must be of the correct type.
/// - `attributes_to_update` generics must be of the correct type.
pub fn SecItemUpdate(query: &CFDictionary, attributes_to_update: &CFDictionary) -> OSStatus;
}
extern "C-unwind" {
/// Delete zero or more items which match a search query.
///
/// Parameter `query`: A dictionary containing an item class specification and
/// optional attributes for controlling the search. See the "Attribute
/// Constants" and "Search Constants" sections for a description of
/// currently defined search attributes.
///
/// Returns: A result code. See "Security Error Codes" (SecBase.h).
///
/// Attributes defining a search are specified by adding key/value
/// pairs to the query dictionary.
///
/// By default, this function deletes all items matching the specified query.
/// You can change this behavior by specifying one of the follow keys:
///
/// To delete an item identified by a transient reference, on iOS, specify
/// kSecValueRef with a item reference. On macOS, give a kSecMatchItemList
/// containing an item reference.
/// To delete an item identified by a persistent reference, on iOS, specify
/// kSecValuePersistentRef with a persistent reference returned by
/// using the kSecReturnPersistentRef key to SecItemCopyMatching or
/// SecItemAdd. On macOS, use kSecMatchItemList with a persistent reference
/// returned by using the kSecReturnPersistentRef key with
/// SecItemCopyMatching or SecItemAdd.
/// To delete multiple items specify kSecMatchItemList with an array
/// of references.
/// If more than one of these result keys is specified, the behavior is
/// undefined.
///
/// # Safety
///
/// `query` generics must be of the correct type.
pub fn SecItemDelete(query: &CFDictionary) -> OSStatus;
}