Mercurial > projects > dstep
comparison dstep/security/SecTrust.d @ 11:07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sat, 01 Aug 2009 15:03:28 +0200 |
parents | |
children | 19885b43130e |
comparison
equal
deleted
inserted
replaced
10:27e00625790b | 11:07194b026fa4 |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Jul 22, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.security.SecTrust; | |
8 | |
9 //import dstep.AvailabilityMacros; | |
10 import dstep.corefoundation.CoreFoundation; | |
11 import dstep.coreservices.carboncore.MacTypes : OSStatus; | |
12 import dstep.security.SecBase; | |
13 import dstep.security.cssmapple; | |
14 import dstep.security.cssmtype; | |
15 | |
16 alias int SecTrustUserSetting; | |
17 alias OpaqueSecTrustRef* SecTrustRef; | |
18 | |
19 enum SecTrustResultType | |
20 { | |
21 kSecTrustResultInvalid, | |
22 kSecTrustResultProceed, | |
23 kSecTrustResultConfirm, | |
24 kSecTrustResultDeny, | |
25 kSecTrustResultUnspecified, | |
26 kSecTrustResultRecoverableTrustFailure, | |
27 kSecTrustResultFatalTrustFailure, | |
28 kSecTrustResultOtherError | |
29 } | |
30 | |
31 extern (C) | |
32 { | |
33 uint SecTrustGetTypeID (); | |
34 int SecTrustCreateWithCertificates (CFArrayRef certificates, CFTypeRef policies, SecTrustRef* trustRef); | |
35 int SecTrustSetPolicies (SecTrustRef trust, CFTypeRef policies); | |
36 int SecTrustSetParameters (SecTrustRef trustRef, uint action, CFDataRef actionData); | |
37 int SecTrustSetAnchorCertificates (SecTrustRef trust, CFArrayRef anchorCertificates); | |
38 int SecTrustSetKeychains (SecTrustRef trust, CFTypeRef keychainOrArray); | |
39 int SecTrustSetVerifyDate (SecTrustRef trust, CFDateRef verifyDate); | |
40 int SecTrustEvaluate (SecTrustRef trust, SecTrustResultType* result); | |
41 int SecTrustGetResult (SecTrustRef trustRef, SecTrustResultType* result, CFArrayRef* certChain, CSSM_TP_APPLE_EVIDENCE_INFO** statusChain); | |
42 int SecTrustGetCssmResult (SecTrustRef trust, CSSM_TP_VERIFY_CONTEXT_RESULT_PTR* result); | |
43 int SecTrustGetCssmResultCode (SecTrustRef trust, OSStatus* resultCode); | |
44 int SecTrustGetTPHandle (SecTrustRef trust, CSSM_TP_HANDLE* handle); | |
45 int SecTrustCopyPolicies (SecTrustRef trust, CFArrayRef* policies); | |
46 int SecTrustCopyCustomAnchorCertificates (SecTrustRef trust, CFArrayRef* anchors); | |
47 int SecTrustCopyAnchorCertificates (CFArrayRef* anchors); | |
48 int SecTrustGetCSSMAnchorCertificates (CSSM_DATA** cssmAnchors, uint* cssmAnchorCount); | |
49 int SecTrustGetUserTrust (SecCertificateRef certificate, SecPolicyRef policy, SecTrustUserSetting* trustSetting); | |
50 int SecTrustSetUserTrust (SecCertificateRef certificate, SecPolicyRef policy, int trustSetting); | |
51 } |