-
Notifications
You must be signed in to change notification settings - Fork 12
/
iOSapi.Security.pas
1506 lines (1318 loc) · 48.5 KB
/
iOSapi.Security.pas
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
{ *********************************************************** }
{ }
{ CodeGear Delphi Runtime Library }
{ }
{ Copyright(c) 2012-2014 Embarcadero Technologies, Inc. }
{ }
{ *********************************************************** }
//
// Delphi-Objective-C Bridge
// Interfaces for Cocoa framework Security
//
unit iOSapi.Security;
interface
uses
Macapi.CoreFoundation,
Macapi.CoreServices,
Macapi.Dispatch,
Macapi.Foundation,
Macapi.Mach,
Macapi.ObjCRuntime,
Macapi.ObjectiveC,
Macapi.QuartzCore,
iOSapi.CocoaTypes,
iOSapi.Foundation;
const
errSecSuccess = 0;
errSecUnimplemented = -4;
errSecIO = -36;
errSecOpWr = -49;
errSecParam = -50;
errSecAllocate = -108;
errSecUserCanceled = -128;
errSecBadReq = -909;
errSecInternalComponent = -2070;
errSecNotAvailable = -25291;
errSecDuplicateItem = -25299;
errSecItemNotFound = -25300;
errSecInteractionNotAllowed = -25308;
errSecDecode = -26275;
errSecAuthFailed = -25293;
kSecAccessControlUserPresence = 1 shl 0;
kSecAccessControlTouchIDAny = 1 shl 1;
kSecAccessControlTouchIDCurrentSet = 1 shl 3;
kSecAccessControlDevicePasscode = 1 shl 4;
kSecAccessControlOr = 1 shl 14;
kSecAccessControlAnd = 1 shl 15;
kSecAccessControlPrivateKeyUsage = 1 shl 30;
kSecAccessControlApplicationPassword = 1 shl 31;
kSecPaddingNone = 0;
kSecPaddingPKCS1 = 1;
kSecPaddingOAEP = 2;
kSecPaddingSigRaw = 16384;
kSecPaddingPKCS1MD2 = 32768;
kSecPaddingPKCS1MD5 = 32769;
kSecPaddingPKCS1SHA1 = 32770;
kSecPaddingPKCS1SHA224 = 32771;
kSecPaddingPKCS1SHA256 = 32772;
kSecPaddingPKCS1SHA384 = 32773;
kSecPaddingPKCS1SHA512 = 32774;
kSecRevocationOCSPMethod = (1 shl 0);
kSecRevocationCRLMethod = (1 shl 1);
kSecRevocationPreferCRL = (1 shl 2);
kSecRevocationRequirePositiveResponse = (1 shl 3);
kSecRevocationNetworkAccessDisabled = (1 shl 4);
kSecRevocationUseAnyAvailableMethod = (kSecRevocationOCSPMethod or
kSecRevocationCRLMethod);
kSecTrustResultInvalid = 0;
kSecTrustResultProceed = 1;
kSecTrustResultConfirm = 2;
kSecTrustResultDeny = 3;
kSecTrustResultUnspecified = 4;
kSecTrustResultRecoverableTrustFailure = 5;
kSecTrustResultFatalTrustFailure = 6;
kSecTrustResultOtherError = 7;
kSSLProtocolUnknown = 0;
kSSLProtocol3 = 2;
kTLSProtocol1 = 4;
kTLSProtocol11 = 7;
kTLSProtocol12 = 8;
kDTLSProtocol1 = 9;
kSSLProtocol2 = 1;
kSSLProtocol3Only = 3;
kTLSProtocol1Only = 5;
kSSLProtocolAll = 6;
kSSLSessionOptionBreakOnServerAuth = 0;
kSSLSessionOptionBreakOnCertRequested = 1;
kSSLSessionOptionBreakOnClientAuth = 2;
kSSLSessionOptionFalseStart = 3;
kSSLSessionOptionSendOneByteRecord = 4;
kSSLSessionOptionAllowServerIdentityChange = 5;
kSSLSessionOptionFallback = 6;
kSSLSessionOptionBreakOnClientHello = 7;
kSSLIdle = 0;
kSSLHandshake = 1;
kSSLConnected = 2;
kSSLClosed = 3;
kSSLAborted = 4;
kSSLClientCertNone = 0;
kSSLClientCertRequested = 1;
kSSLClientCertSent = 2;
kSSLClientCertRejected = 3;
errSSLProtocol = -9800;
errSSLNegotiation = -9801;
errSSLFatalAlert = -9802;
errSSLWouldBlock = -9803;
errSSLSessionNotFound = -9804;
errSSLClosedGraceful = -9805;
errSSLClosedAbort = -9806;
errSSLXCertChainInvalid = -9807;
errSSLBadCert = -9808;
errSSLCrypto = -9809;
errSSLInternal = -9810;
errSSLModuleAttach = -9811;
errSSLUnknownRootCert = -9812;
errSSLNoRootCert = -9813;
errSSLCertExpired = -9814;
errSSLCertNotYetValid = -9815;
errSSLClosedNoNotify = -9816;
errSSLBufferOverflow = -9817;
errSSLBadCipherSuite = -9818;
errSSLPeerUnexpectedMsg = -9819;
errSSLPeerBadRecordMac = -9820;
errSSLPeerDecryptionFail = -9821;
errSSLPeerRecordOverflow = -9822;
errSSLPeerDecompressFail = -9823;
errSSLPeerHandshakeFail = -9824;
errSSLPeerBadCert = -9825;
errSSLPeerUnsupportedCert = -9826;
errSSLPeerCertRevoked = -9827;
errSSLPeerCertExpired = -9828;
errSSLPeerCertUnknown = -9829;
errSSLIllegalParam = -9830;
errSSLPeerUnknownCA = -9831;
errSSLPeerAccessDenied = -9832;
errSSLPeerDecodeError = -9833;
errSSLPeerDecryptError = -9834;
errSSLPeerExportRestriction = -9835;
errSSLPeerProtocolVersion = -9836;
errSSLPeerInsufficientSecurity = -9837;
errSSLPeerInternalError = -9838;
errSSLPeerUserCancelled = -9839;
errSSLPeerNoRenegotiation = -9840;
errSSLPeerAuthCompleted = -9841;
errSSLClientCertRequested = -9842;
errSSLHostNameMismatch = -9843;
errSSLConnectionRefused = -9844;
errSSLDecryptionFail = -9845;
errSSLBadRecordMac = -9846;
errSSLRecordOverflow = -9847;
errSSLBadConfiguration = -9848;
errSSLUnexpectedRecord = -9849;
errSSLWeakPeerEphemeralDHKey = -9850;
errSSLClientHelloReceived = -9851;
kSSLServerSide = 0;
kSSLClientSide = 1;
kSSLStreamType = 0;
kSSLDatagramType = 1;
kSSLSessionStrengthPolicyDefault = 0;
kSSLSessionStrengthPolicyATSv1 = 1;
kSSLSessionStrengthPolicyATSv1_noPFS = 2;
kNeverAuthenticate = 0;
kAlwaysAuthenticate = 1;
kTryAuthenticate = 2;
type
// ===== Framework typedefs =====
{$M+}
SSLCipherSuite = Word;
SecCertificateRef = Pointer;
SecIdentityRef = Pointer;
SecKeyRef = Pointer;
SecPolicyRef = Pointer;
SecAccessControlRef = Pointer;
CFTypeID = LongWord;
CFIndex = LongInt;
SecAccessControlCreateFlags = CFIndex;
CFAllocatorRef = Pointer;
CFTypeRef = Pointer;
CFDataRef = Pointer;
CFStringRef = Pointer;
OSStatus = Int32;
CFDictionaryRef = Pointer;
SecPadding = LongWord;
__darwin_size_t = LongWord;
Boolean = Byte;
CFOptionFlags = LongWord;
SecRandomRef = Pointer;
CFErrorRef = Pointer;
TSecurityCompletionHandler = procedure(param1: CFErrorRef) of object;
CFArrayRef = Pointer;
TSecurityCompletionHandler1 = procedure(param1: CFArrayRef;
param2: CFErrorRef) of object;
SecTrustResultType = LongWord;
SecTrustRef = Pointer;
SecTrustCallback = procedure(param1: SecTrustRef; param2: SecTrustResultType)
of object;
CFDateRef = Pointer;
CFTimeInterval = Double;
CFAbsoluteTime = CFTimeInterval;
dispatch_queue_t = Pointer;
SSLContextRef = Pointer;
SSLConnectionRef = Pointer;
SSLProtocol = Integer;
SSLSessionOption = Integer;
SSLSessionState = Integer;
SSLClientCertificateState = Integer;
SSLReadFunc = function(param1: SSLConnectionRef; param2: Pointer;
param3: PLongWord): OSStatus; cdecl;
SSLWriteFunc = function(param1: SSLConnectionRef; param2: Pointer;
param3: PLongWord): OSStatus; cdecl;
SSLProtocolSide = Integer;
SSLConnectionType = Integer;
SSLSessionStrengthPolicy = Integer;
SSLAuthenticate = Integer;
// ===== Exported string consts =====
function kSecImportExportPassphrase: Pointer;
function kSecImportItemLabel: Pointer;
function kSecImportItemKeyID: Pointer;
function kSecImportItemTrust: Pointer;
function kSecImportItemCertChain: Pointer;
function kSecImportItemIdentity: Pointer;
function kSecClass: Pointer;
function kSecClassGenericPassword: Pointer;
function kSecClassInternetPassword: Pointer;
function kSecClassCertificate: Pointer;
function kSecClassKey: Pointer;
function kSecClassIdentity: Pointer;
function kSecAttrAccessible: Pointer;
function kSecAttrAccessControl: Pointer;
function kSecAttrAccessGroup: Pointer;
function kSecAttrSynchronizable: Pointer;
function kSecAttrCreationDate: Pointer;
function kSecAttrModificationDate: Pointer;
function kSecAttrDescription: Pointer;
function kSecAttrComment: Pointer;
function kSecAttrCreator: Pointer;
function kSecAttrType: Pointer;
function kSecAttrLabel: Pointer;
function kSecAttrIsInvisible: Pointer;
function kSecAttrIsNegative: Pointer;
function kSecAttrAccount: Pointer;
function kSecAttrService: Pointer;
function kSecAttrGeneric: Pointer;
function kSecAttrSecurityDomain: Pointer;
function kSecAttrServer: Pointer;
function kSecAttrProtocol: Pointer;
function kSecAttrAuthenticationType: Pointer;
function kSecAttrPort: Pointer;
function kSecAttrPath: Pointer;
function kSecAttrSubject: Pointer;
function kSecAttrIssuer: Pointer;
function kSecAttrSerialNumber: Pointer;
function kSecAttrSubjectKeyID: Pointer;
function kSecAttrPublicKeyHash: Pointer;
function kSecAttrCertificateType: Pointer;
function kSecAttrCertificateEncoding: Pointer;
function kSecAttrKeyClass: Pointer;
function kSecAttrApplicationLabel: Pointer;
function kSecAttrIsPermanent: Pointer;
function kSecAttrApplicationTag: Pointer;
function kSecAttrKeyType: Pointer;
function kSecAttrKeySizeInBits: Pointer;
function kSecAttrEffectiveKeySize: Pointer;
function kSecAttrCanEncrypt: Pointer;
function kSecAttrCanDecrypt: Pointer;
function kSecAttrCanDerive: Pointer;
function kSecAttrCanSign: Pointer;
function kSecAttrCanVerify: Pointer;
function kSecAttrCanWrap: Pointer;
function kSecAttrCanUnwrap: Pointer;
function kSecAttrSyncViewHint: Pointer;
function kSecAttrTokenID: Pointer;
function kSecAttrAccessibleWhenUnlocked: Pointer;
function kSecAttrAccessibleAfterFirstUnlock: Pointer;
function kSecAttrAccessibleAlways: Pointer;
function kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly: Pointer;
function kSecAttrAccessibleWhenUnlockedThisDeviceOnly: Pointer;
function kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly: Pointer;
function kSecAttrAccessibleAlwaysThisDeviceOnly: Pointer;
function kSecAttrProtocolFTP: Pointer;
function kSecAttrProtocolFTPAccount: Pointer;
function kSecAttrProtocolHTTP: Pointer;
function kSecAttrProtocolIRC: Pointer;
function kSecAttrProtocolNNTP: Pointer;
function kSecAttrProtocolPOP3: Pointer;
function kSecAttrProtocolSMTP: Pointer;
function kSecAttrProtocolSOCKS: Pointer;
function kSecAttrProtocolIMAP: Pointer;
function kSecAttrProtocolLDAP: Pointer;
function kSecAttrProtocolAppleTalk: Pointer;
function kSecAttrProtocolAFP: Pointer;
function kSecAttrProtocolTelnet: Pointer;
function kSecAttrProtocolSSH: Pointer;
function kSecAttrProtocolFTPS: Pointer;
function kSecAttrProtocolHTTPS: Pointer;
function kSecAttrProtocolHTTPProxy: Pointer;
function kSecAttrProtocolHTTPSProxy: Pointer;
function kSecAttrProtocolFTPProxy: Pointer;
function kSecAttrProtocolSMB: Pointer;
function kSecAttrProtocolRTSP: Pointer;
function kSecAttrProtocolRTSPProxy: Pointer;
function kSecAttrProtocolDAAP: Pointer;
function kSecAttrProtocolEPPC: Pointer;
function kSecAttrProtocolIPP: Pointer;
function kSecAttrProtocolNNTPS: Pointer;
function kSecAttrProtocolLDAPS: Pointer;
function kSecAttrProtocolTelnetS: Pointer;
function kSecAttrProtocolIMAPS: Pointer;
function kSecAttrProtocolIRCS: Pointer;
function kSecAttrProtocolPOP3S: Pointer;
function kSecAttrAuthenticationTypeNTLM: Pointer;
function kSecAttrAuthenticationTypeMSN: Pointer;
function kSecAttrAuthenticationTypeDPA: Pointer;
function kSecAttrAuthenticationTypeRPA: Pointer;
function kSecAttrAuthenticationTypeHTTPBasic: Pointer;
function kSecAttrAuthenticationTypeHTTPDigest: Pointer;
function kSecAttrAuthenticationTypeHTMLForm: Pointer;
function kSecAttrAuthenticationTypeDefault: Pointer;
function kSecAttrKeyClassPublic: Pointer;
function kSecAttrKeyClassPrivate: Pointer;
function kSecAttrKeyClassSymmetric: Pointer;
function kSecAttrKeyTypeRSA: Pointer;
function kSecAttrKeyTypeEC: Pointer;
function kSecAttrSynchronizableAny: Pointer;
function kSecMatchPolicy: Pointer;
function kSecMatchItemList: Pointer;
function kSecMatchSearchList: Pointer;
function kSecMatchIssuers: Pointer;
function kSecMatchEmailAddressIfPresent: Pointer;
function kSecMatchSubjectContains: Pointer;
function kSecMatchCaseInsensitive: Pointer;
function kSecMatchTrustedOnly: Pointer;
function kSecMatchValidOnDate: Pointer;
function kSecMatchLimit: Pointer;
function kSecMatchLimitOne: Pointer;
function kSecMatchLimitAll: Pointer;
function kSecReturnData: Pointer;
function kSecReturnAttributes: Pointer;
function kSecReturnRef: Pointer;
function kSecReturnPersistentRef: Pointer;
function kSecValueData: Pointer;
function kSecValueRef: Pointer;
function kSecValuePersistentRef: Pointer;
function kSecUseItemList: Pointer;
function kSecUseOperationPrompt: Pointer;
function kSecUseNoAuthenticationUI: Pointer;
function kSecUseAuthenticationUI: Pointer;
function kSecUseAuthenticationContext: Pointer;
function kSecUseAuthenticationUIAllow: Pointer;
function kSecUseAuthenticationUIFail: Pointer;
function kSecUseAuthenticationUISkip: Pointer;
function kSecAttrTokenIDSecureEnclave: Pointer;
function kSecPrivateKeyAttrs: Pointer;
function kSecPublicKeyAttrs: Pointer;
function kSecPolicyAppleX509Basic: Pointer;
function kSecPolicyAppleSSL: Pointer;
function kSecPolicyAppleSMIME: Pointer;
function kSecPolicyAppleEAP: Pointer;
function kSecPolicyAppleIPsec: Pointer;
function kSecPolicyApplePKINITClient: Pointer;
function kSecPolicyApplePKINITServer: Pointer;
function kSecPolicyAppleCodeSigning: Pointer;
function kSecPolicyMacAppStoreReceipt: Pointer;
function kSecPolicyAppleIDValidation: Pointer;
function kSecPolicyAppleTimeStamping: Pointer;
function kSecPolicyAppleRevocation: Pointer;
function kSecPolicyApplePayIssuerEncryption: Pointer;
function kSecPolicyOid: Pointer;
function kSecPolicyName: Pointer;
function kSecPolicyClient: Pointer;
function kSecPolicyRevocationFlags: Pointer;
function kSecRandomDefault: Pointer;
function kSecSharedPassword: Pointer;
function kSecPropertyTypeTitle: Pointer;
function kSecPropertyTypeError: Pointer;
function kSecTrustEvaluationDate: Pointer;
function kSecTrustExtendedValidation: Pointer;
function kSecTrustOrganizationName: Pointer;
function kSecTrustResultValue: Pointer;
function kSecTrustRevocationChecked: Pointer;
function kSecTrustRevocationValidUntilDate: Pointer;
function kSecTrustCertificateTransparency: Pointer;
// ===== External functions =====
const
libSecurity = '/System/Library/Frameworks/Security.framework/Security';
function CF_ENUM(param1: SSLCipherSuite): Integer; cdecl;
external libSecurity name _PU + 'CF_ENUM';
function SecAccessControlGetTypeID: CFTypeID; cdecl;
external libSecurity name _PU + 'SecAccessControlGetTypeID';
function SecAccessControlCreateWithFlags(allocator: CFAllocatorRef;
protection: CFTypeRef; flags: SecAccessControlCreateFlags; error: Pointer)
: SecAccessControlRef; cdecl;
external libSecurity name _PU + 'SecAccessControlCreateWithFlags';
function SecCertificateGetTypeID: CFTypeID; cdecl;
external libSecurity name _PU + 'SecCertificateGetTypeID';
function SecCertificateCreateWithData(allocator: CFAllocatorRef;
data: CFDataRef): SecCertificateRef; cdecl;
external libSecurity name _PU + 'SecCertificateCreateWithData';
function SecCertificateCopyData(certificate: SecCertificateRef): CFDataRef;
cdecl; external libSecurity name _PU + 'SecCertificateCopyData';
function SecCertificateCopySubjectSummary(certificate: SecCertificateRef)
: CFStringRef; cdecl; external libSecurity name _PU +
'SecCertificateCopySubjectSummary';
function SecIdentityGetTypeID: CFTypeID; cdecl;
external libSecurity name _PU + 'SecIdentityGetTypeID';
function SecIdentityCopyCertificate(identityRef: SecIdentityRef;
certificateRef: Pointer): OSStatus; cdecl;
external libSecurity name _PU + 'SecIdentityCopyCertificate';
function SecIdentityCopyPrivateKey(identityRef: SecIdentityRef;
privateKeyRef: Pointer): OSStatus; cdecl;
external libSecurity name _PU + 'SecIdentityCopyPrivateKey';
function SecPKCS12Import(pkcs12_data: CFDataRef; options: CFDictionaryRef;
items: Pointer): OSStatus; cdecl;
external libSecurity name _PU + 'SecPKCS12Import';
function SecItemCopyMatching(query: CFDictionaryRef; result: Pointer): OSStatus;
cdecl; external libSecurity name _PU + 'SecItemCopyMatching';
function SecItemAdd(attributes: CFDictionaryRef; result: Pointer): OSStatus;
cdecl; external libSecurity name _PU + 'SecItemAdd';
function SecItemUpdate(query: CFDictionaryRef;
attributesToUpdate: CFDictionaryRef): OSStatus; cdecl;
external libSecurity name _PU + 'SecItemUpdate';
function SecItemDelete(query: CFDictionaryRef): OSStatus; cdecl;
external libSecurity name _PU + 'SecItemDelete';
function SecKeyGetTypeID: CFTypeID; cdecl;
external libSecurity name _PU + 'SecKeyGetTypeID';
function SecKeyGeneratePair(parameters: CFDictionaryRef; publicKey: Pointer;
privateKey: Pointer): OSStatus; cdecl;
external libSecurity name _PU + 'SecKeyGeneratePair';
function SecKeyRawSign(key: SecKeyRef; padding: SecPadding; dataToSign: PByte;
dataToSignLen: LongWord; sig: PByte; sigLen: PLongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SecKeyRawSign';
function SecKeyRawVerify(key: SecKeyRef; padding: SecPadding; signedData: PByte;
signedDataLen: LongWord; sig: PByte; sigLen: LongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SecKeyRawVerify';
function SecKeyEncrypt(key: SecKeyRef; padding: SecPadding; plainText: PByte;
plainTextLen: LongWord; cipherText: PByte; cipherTextLen: PLongWord)
: OSStatus; cdecl; external libSecurity name _PU + 'SecKeyEncrypt';
function SecKeyDecrypt(key: SecKeyRef; padding: SecPadding; cipherText: PByte;
cipherTextLen: LongWord; plainText: PByte; plainTextLen: PLongWord): OSStatus;
cdecl; external libSecurity name _PU + 'SecKeyDecrypt';
function SecKeyGetBlockSize(key: SecKeyRef): LongWord; cdecl;
external libSecurity name _PU + 'SecKeyGetBlockSize';
function SecPolicyGetTypeID: CFTypeID; cdecl;
external libSecurity name _PU + 'SecPolicyGetTypeID';
function SecPolicyCopyProperties(policyRef: SecPolicyRef): CFDictionaryRef;
cdecl; external libSecurity name _PU + 'SecPolicyCopyProperties';
function SecPolicyCreateBasicX509: SecPolicyRef; cdecl;
external libSecurity name _PU + 'SecPolicyCreateBasicX509';
function SecPolicyCreateSSL(server: Boolean; hostname: CFStringRef)
: SecPolicyRef; cdecl; external libSecurity name _PU + 'SecPolicyCreateSSL';
function SecPolicyCreateRevocation(revocationFlags: CFOptionFlags)
: SecPolicyRef; cdecl; external libSecurity name _PU +
'SecPolicyCreateRevocation';
function SecPolicyCreateWithProperties(policyIdentifier: CFTypeRef;
properties: CFDictionaryRef): SecPolicyRef; cdecl;
external libSecurity name _PU + 'SecPolicyCreateWithProperties';
function SecRandomCopyBytes(rnd: SecRandomRef; count: LongWord; bytes: PByte)
: Integer; cdecl; external libSecurity name _PU + 'SecRandomCopyBytes';
procedure SecAddSharedWebCredential(fqdn: CFStringRef; account: CFStringRef;
password: CFStringRef; completionHandler: TSecurityCompletionHandler); cdecl;
external libSecurity name _PU + 'SecAddSharedWebCredential';
procedure SecRequestSharedWebCredential(fqdn: CFStringRef; account: CFStringRef;
completionHandler: TSecurityCompletionHandler1); cdecl;
external libSecurity name _PU + 'SecRequestSharedWebCredential';
function SecCreateSharedWebCredentialPassword: CFStringRef; cdecl;
external libSecurity name _PU + 'SecCreateSharedWebCredentialPassword';
function SecTrustGetTypeID: CFTypeID; cdecl;
external libSecurity name _PU + 'SecTrustGetTypeID';
function SecTrustCreateWithCertificates(certificates: CFTypeRef;
policies: CFTypeRef; trust: Pointer): OSStatus; cdecl;
external libSecurity name _PU + 'SecTrustCreateWithCertificates';
function SecTrustSetPolicies(trust: SecTrustRef; policies: CFTypeRef): OSStatus;
cdecl; external libSecurity name _PU + 'SecTrustSetPolicies';
function SecTrustCopyPolicies(trust: SecTrustRef; policies: Pointer): OSStatus;
cdecl; external libSecurity name _PU + 'SecTrustCopyPolicies';
function SecTrustSetNetworkFetchAllowed(trust: SecTrustRef; allowFetch: Boolean)
: OSStatus; cdecl; external libSecurity name _PU +
'SecTrustSetNetworkFetchAllowed';
function SecTrustGetNetworkFetchAllowed(trust: SecTrustRef; allowFetch: PByte)
: OSStatus; cdecl; external libSecurity name _PU +
'SecTrustGetNetworkFetchAllowed';
function SecTrustSetAnchorCertificates(trust: SecTrustRef;
anchorCertificates: CFArrayRef): OSStatus; cdecl;
external libSecurity name _PU + 'SecTrustSetAnchorCertificates';
function SecTrustSetAnchorCertificatesOnly(trust: SecTrustRef;
anchorCertificatesOnly: Boolean): OSStatus; cdecl;
external libSecurity name _PU + 'SecTrustSetAnchorCertificatesOnly';
function SecTrustCopyCustomAnchorCertificates(trust: SecTrustRef;
anchors: Pointer): OSStatus; cdecl;
external libSecurity name _PU + 'SecTrustCopyCustomAnchorCertificates';
function SecTrustSetVerifyDate(trust: SecTrustRef; verifyDate: CFDateRef)
: OSStatus; cdecl; external libSecurity name _PU + 'SecTrustSetVerifyDate';
function SecTrustGetVerifyTime(trust: SecTrustRef): CFAbsoluteTime; cdecl;
external libSecurity name _PU + 'SecTrustGetVerifyTime';
function SecTrustEvaluate(trust: SecTrustRef; result: PLongWord): OSStatus;
cdecl; external libSecurity name _PU + 'SecTrustEvaluate';
function SecTrustEvaluateAsync(trust: SecTrustRef; queue: dispatch_queue_t;
result: SecTrustCallback): OSStatus; cdecl;
external libSecurity name _PU + 'SecTrustEvaluateAsync';
function SecTrustGetTrustResult(trust: SecTrustRef; result: PLongWord)
: OSStatus; cdecl; external libSecurity name _PU + 'SecTrustGetTrustResult';
function SecTrustCopyPublicKey(trust: SecTrustRef): SecKeyRef; cdecl;
external libSecurity name _PU + 'SecTrustCopyPublicKey';
function SecTrustGetCertificateCount(trust: SecTrustRef): CFIndex; cdecl;
external libSecurity name _PU + 'SecTrustGetCertificateCount';
function SecTrustGetCertificateAtIndex(trust: SecTrustRef; ix: CFIndex)
: SecCertificateRef; cdecl;
external libSecurity name _PU + 'SecTrustGetCertificateAtIndex';
function SecTrustCopyExceptions(trust: SecTrustRef): CFDataRef; cdecl;
external libSecurity name _PU + 'SecTrustCopyExceptions';
function SecTrustSetExceptions(trust: SecTrustRef; exceptions: CFDataRef)
: Integer; cdecl; external libSecurity name _PU + 'SecTrustSetExceptions';
function SecTrustCopyProperties(trust: SecTrustRef): CFArrayRef; cdecl;
external libSecurity name _PU + 'SecTrustCopyProperties';
function SecTrustCopyResult(trust: SecTrustRef): CFDictionaryRef; cdecl;
external libSecurity name _PU + 'SecTrustCopyResult';
function SecTrustSetOCSPResponse(trust: SecTrustRef; responseData: CFTypeRef)
: OSStatus; cdecl; external libSecurity name _PU + 'SecTrustSetOCSPResponse';
function SSLContextGetTypeID: CFTypeID; cdecl;
external libSecurity name _PU + 'SSLContextGetTypeID';
function SSLCreateContext(alloc: CFAllocatorRef; protocolSide: SSLProtocolSide;
connectionType: SSLConnectionType): SSLContextRef; cdecl;
external libSecurity name _PU + 'SSLCreateContext';
function SSLGetSessionState(context: SSLContextRef; state: Integer): OSStatus;
cdecl; external libSecurity name _PU + 'SSLGetSessionState';
function SSLSetSessionOption(context: SSLContextRef; option: SSLSessionOption;
value: Boolean): OSStatus; cdecl;
external libSecurity name _PU + 'SSLSetSessionOption';
function SSLGetSessionOption(context: SSLContextRef; option: SSLSessionOption;
value: PByte): OSStatus; cdecl;
external libSecurity name _PU + 'SSLGetSessionOption';
function SSLSetIOFuncs(context: SSLContextRef; readFunc: SSLReadFunc;
writeFunc: SSLWriteFunc): OSStatus; cdecl;
external libSecurity name _PU + 'SSLSetIOFuncs';
function SSLSetProtocolVersionMin(context: SSLContextRef;
minVersion: SSLProtocol): OSStatus; cdecl;
external libSecurity name _PU + 'SSLSetProtocolVersionMin';
function SSLGetProtocolVersionMin(context: SSLContextRef; minVersion: Integer)
: OSStatus; cdecl; external libSecurity name _PU + 'SSLGetProtocolVersionMin';
function SSLSetProtocolVersionMax(context: SSLContextRef;
maxVersion: SSLProtocol): OSStatus; cdecl;
external libSecurity name _PU + 'SSLSetProtocolVersionMax';
function SSLGetProtocolVersionMax(context: SSLContextRef; maxVersion: Integer)
: OSStatus; cdecl; external libSecurity name _PU + 'SSLGetProtocolVersionMax';
function SSLSetCertificate(context: SSLContextRef; certRefs: CFArrayRef)
: OSStatus; cdecl; external libSecurity name _PU + 'SSLSetCertificate';
function SSLSetConnection(context: SSLContextRef; connection: SSLConnectionRef)
: OSStatus; cdecl; external libSecurity name _PU + 'SSLSetConnection';
function SSLGetConnection(context: SSLContextRef; connection: Pointer)
: OSStatus; cdecl; external libSecurity name _PU + 'SSLGetConnection';
function SSLSetPeerDomainName(context: SSLContextRef;
peerName: MarshaledAString; peerNameLen: LongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLSetPeerDomainName';
function SSLGetPeerDomainNameLength(context: SSLContextRef;
peerNameLen: PLongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLGetPeerDomainNameLength';
function SSLGetPeerDomainName(context: SSLContextRef;
peerName: MarshaledAString; peerNameLen: PLongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLGetPeerDomainName';
function SSLSetDatagramHelloCookie(dtlsContext: SSLContextRef; cookie: Pointer;
cookieLen: LongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLSetDatagramHelloCookie';
function SSLSetMaxDatagramRecordSize(dtlsContext: SSLContextRef;
maxSize: LongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLSetMaxDatagramRecordSize';
function SSLGetMaxDatagramRecordSize(dtlsContext: SSLContextRef;
maxSize: PLongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLGetMaxDatagramRecordSize';
function SSLGetNegotiatedProtocolVersion(context: SSLContextRef;
protocol: Integer): OSStatus; cdecl;
external libSecurity name _PU + 'SSLGetNegotiatedProtocolVersion';
function SSLGetNumberSupportedCiphers(context: SSLContextRef;
numCiphers: PLongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLGetNumberSupportedCiphers';
function SSLGetSupportedCiphers(context: SSLContextRef; ciphers: PWord;
numCiphers: PLongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLGetSupportedCiphers';
function SSLSetEnabledCiphers(context: SSLContextRef; ciphers: PWord;
numCiphers: LongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLSetEnabledCiphers';
function SSLGetNumberEnabledCiphers(context: SSLContextRef;
numCiphers: PLongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLGetNumberEnabledCiphers';
function SSLGetEnabledCiphers(context: SSLContextRef; ciphers: PWord;
numCiphers: PLongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLGetEnabledCiphers';
function SSLSetSessionStrengthPolicy(context: SSLContextRef;
policyStrength: SSLSessionStrengthPolicy): OSStatus; cdecl;
external libSecurity name _PU + 'SSLSetSessionStrengthPolicy';
function SSLCopyPeerTrust(context: SSLContextRef; trust: Pointer): OSStatus;
cdecl; external libSecurity name _PU + 'SSLCopyPeerTrust';
function SSLSetPeerID(context: SSLContextRef; peerID: Pointer;
peerIDLen: LongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLSetPeerID';
function SSLGetPeerID(context: SSLContextRef; peerID: Pointer;
peerIDLen: PLongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLGetPeerID';
function SSLGetNegotiatedCipher(context: SSLContextRef; cipherSuite: PWord)
: OSStatus; cdecl; external libSecurity name _PU + 'SSLGetNegotiatedCipher';
function SSLSetEncryptionCertificate(context: SSLContextRef;
certRefs: CFArrayRef): OSStatus; cdecl;
external libSecurity name _PU + 'SSLSetEncryptionCertificate';
function SSLSetClientSideAuthenticate(context: SSLContextRef;
auth: SSLAuthenticate): OSStatus; cdecl;
external libSecurity name _PU + 'SSLSetClientSideAuthenticate';
function SSLAddDistinguishedName(context: SSLContextRef; derDN: Pointer;
derDNLen: LongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLAddDistinguishedName';
function SSLCopyDistinguishedNames(context: SSLContextRef; names: Pointer)
: OSStatus; cdecl; external libSecurity name _PU +
'SSLCopyDistinguishedNames';
function SSLGetClientCertificateState(context: SSLContextRef;
clientState: Integer): OSStatus; cdecl;
external libSecurity name _PU + 'SSLGetClientCertificateState';
function SSLHandshake(context: SSLContextRef): OSStatus; cdecl;
external libSecurity name _PU + 'SSLHandshake';
function SSLWrite(context: SSLContextRef; data: Pointer; dataLength: LongWord;
processed: PLongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLWrite';
function SSLRead(context: SSLContextRef; data: Pointer; dataLength: LongWord;
processed: PLongWord): OSStatus; cdecl;
external libSecurity name _PU + 'SSLRead';
function SSLGetBufferedReadSize(context: SSLContextRef; bufSize: PLongWord)
: OSStatus; cdecl; external libSecurity name _PU + 'SSLGetBufferedReadSize';
function SSLGetDatagramWriteSize(dtlsContext: SSLContextRef; bufSize: PLongWord)
: OSStatus; cdecl; external libSecurity name _PU + 'SSLGetDatagramWriteSize';
function SSLClose(context: SSLContextRef): OSStatus; cdecl;
external libSecurity name _PU + 'SSLClose';
implementation
{$IF defined(IOS) and NOT defined(CPUARM)}
uses
Posix.Dlfcn;
var
SecurityModule: THandle;
{$ENDIF IOS}
function kSecImportExportPassphrase: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecImportExportPassphrase');
end;
function kSecImportItemLabel: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecImportItemLabel');
end;
function kSecImportItemKeyID: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecImportItemKeyID');
end;
function kSecImportItemTrust: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecImportItemTrust');
end;
function kSecImportItemCertChain: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecImportItemCertChain');
end;
function kSecImportItemIdentity: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecImportItemIdentity');
end;
function kSecClass: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecClass');
end;
function kSecClassGenericPassword: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecClassGenericPassword');
end;
function kSecClassInternetPassword: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecClassInternetPassword');
end;
function kSecClassCertificate: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecClassCertificate');
end;
function kSecClassKey: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecClassKey');
end;
function kSecClassIdentity: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecClassIdentity');
end;
function kSecAttrAccessible: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrAccessible');
end;
function kSecAttrAccessControl: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrAccessControl');
end;
function kSecAttrAccessGroup: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrAccessGroup');
end;
function kSecAttrSynchronizable: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrSynchronizable');
end;
function kSecAttrCreationDate: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrCreationDate');
end;
function kSecAttrModificationDate: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrModificationDate');
end;
function kSecAttrDescription: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrDescription');
end;
function kSecAttrComment: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrComment');
end;
function kSecAttrCreator: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrCreator');
end;
function kSecAttrType: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrType');
end;
function kSecAttrLabel: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrLabel');
end;
function kSecAttrIsInvisible: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrIsInvisible');
end;
function kSecAttrIsNegative: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrIsNegative');
end;
function kSecAttrAccount: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrAccount');
end;
function kSecAttrService: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrService');
end;
function kSecAttrGeneric: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrGeneric');
end;
function kSecAttrSecurityDomain: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrSecurityDomain');
end;
function kSecAttrServer: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrServer');
end;
function kSecAttrProtocol: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrProtocol');
end;
function kSecAttrAuthenticationType: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrAuthenticationType');
end;
function kSecAttrPort: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrPort');
end;
function kSecAttrPath: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrPath');
end;
function kSecAttrSubject: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrSubject');
end;
function kSecAttrIssuer: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrIssuer');
end;
function kSecAttrSerialNumber: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrSerialNumber');
end;
function kSecAttrSubjectKeyID: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrSubjectKeyID');
end;
function kSecAttrPublicKeyHash: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrPublicKeyHash');
end;
function kSecAttrCertificateType: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrCertificateType');
end;
function kSecAttrCertificateEncoding: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrCertificateEncoding');
end;
function kSecAttrKeyClass: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrKeyClass');
end;
function kSecAttrApplicationLabel: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrApplicationLabel');
end;
function kSecAttrIsPermanent: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrIsPermanent');
end;
function kSecAttrApplicationTag: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrApplicationTag');
end;
function kSecAttrKeyType: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrKeyType');
end;
function kSecAttrKeySizeInBits: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrKeySizeInBits');
end;
function kSecAttrEffectiveKeySize: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrEffectiveKeySize');
end;
function kSecAttrCanEncrypt: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrCanEncrypt');
end;
function kSecAttrCanDecrypt: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrCanDecrypt');
end;
function kSecAttrCanDerive: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrCanDerive');
end;
function kSecAttrCanSign: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrCanSign');
end;
function kSecAttrCanVerify: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrCanVerify');
end;
function kSecAttrCanWrap: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrCanWrap');
end;
function kSecAttrCanUnwrap: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrCanUnwrap');
end;
function kSecAttrSyncViewHint: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrSyncViewHint');
end;
function kSecAttrTokenID: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrTokenID');
end;
function kSecAttrAccessibleWhenUnlocked: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrAccessibleWhenUnlocked');
end;
function kSecAttrAccessibleAfterFirstUnlock: Pointer;
begin
result := CocoaPointerConst(libSecurity,
'kSecAttrAccessibleAfterFirstUnlock');
end;
function kSecAttrAccessibleAlways: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrAccessibleAlways');
end;
function kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly: Pointer;
begin
result := CocoaPointerConst(libSecurity,
'kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly');
end;
function kSecAttrAccessibleWhenUnlockedThisDeviceOnly: Pointer;
begin
result := CocoaPointerConst(libSecurity,
'kSecAttrAccessibleWhenUnlockedThisDeviceOnly');
end;
function kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly: Pointer;
begin
result := CocoaPointerConst(libSecurity,
'kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly');
end;
function kSecAttrAccessibleAlwaysThisDeviceOnly: Pointer;
begin
result := CocoaPointerConst(libSecurity,
'kSecAttrAccessibleAlwaysThisDeviceOnly');
end;
function kSecAttrProtocolFTP: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrProtocolFTP');
end;
function kSecAttrProtocolFTPAccount: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrProtocolFTPAccount');
end;
function kSecAttrProtocolHTTP: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrProtocolHTTP');
end;
function kSecAttrProtocolIRC: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrProtocolIRC');
end;
function kSecAttrProtocolNNTP: Pointer;
begin
result := CocoaPointerConst(libSecurity, 'kSecAttrProtocolNNTP');
end;