Mercurial > projects > dstep
view dstep/security/SecureDownload.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 |
line wrap: on
line source
/** * Copyright: Copyright (c) 2009 Jacob Carlborg. * Authors: Jacob Carlborg * Version: Initial created: Jul 22, 2009 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) */ module dstep.security.SecureDownload; import dstep.corefoundation.CoreFoundation; import dstep.security.SecBase; import dstep.security.SecTrust; struct OpaqueSecureDownload; alias OpaqueSecureDownload* SecureDownloadRef; extern (C) { alias int function (SecTrustRef, int, void*) SecureDownloadTrustEvaluateCallback; alias int function (SecTrustRef, void*) SecureDownloadTrustSetupCallback; } enum { errSecureDownloadInvalidTicket = -20052, errSecureDownloadInvalidDownload = -20053 } enum _SecureDownloadTrustCallbackResult { kSecureDownloadDoNotEvaluateSigner = 0, kSecureDownloadEvaluateSigner = 1, kSecureDownloadFailEvaluation = 2 } extern (C) { int SecureDownloadCreateWithTicket (CFDataRef ticket, SecureDownloadTrustSetupCallback setup, void* setupContext, SecureDownloadTrustEvaluateCallback evaluate, void* evaluateContext, SecureDownloadRef* downloadRef); int SecureDownloadCopyURLs (SecureDownloadRef downloadRef, CFArrayRef* urls); int SecureDownloadCopyName (SecureDownloadRef downloadRef, CFStringRef* name); int SecureDownloadCopyCreationDate (SecureDownloadRef downloadRef, CFDateRef* date); int SecureDownloadGetDownloadSize (SecureDownloadRef downloadRef, long* downloadSize); int SecureDownloadUpdateWithData (SecureDownloadRef downloadRef, CFDataRef data); int SecureDownloadFinished (SecureDownloadRef downloadRef); int SecureDownloadRelease (SecureDownloadRef downloadRef); int SecureDownloadCopyTicketLocation (CFURLRef url, CFURLRef* ticketLocation); }