Mercurial > projects > dstep
comparison dstep/security/CMSEncoder.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 |
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.CMSEncoder; | |
8 | |
9 import dstep.corefoundation.CoreFoundation; | |
10 import dstep.security.Security; | |
11 //import dstep.stdint; | |
12 | |
13 struct _CMSEncoder; | |
14 | |
15 alias _CMSEncoder* CMSEncoderRef; | |
16 alias uint CMSSignedAttributes; | |
17 alias uint CMSCertificateChainMode; | |
18 | |
19 enum | |
20 { | |
21 kCMSAttrNone = 0x0000, | |
22 kCMSAttrSmimeCapabilities = 0x0001, | |
23 kCMSAttrSmimeEncryptionKeyPrefs = 0x0002, | |
24 kCMSAttrSmimeMSEncryptionKeyPrefs = 0x0004, | |
25 kCMSAttrSigningTime = 0x0008 | |
26 } | |
27 | |
28 enum | |
29 { | |
30 kCMSCertificateNone = 0, | |
31 kCMSCertificateSignerOnly, | |
32 kCMSCertificateChain, | |
33 kCMSCertificateChainWithRoot | |
34 } | |
35 | |
36 extern (C) | |
37 { | |
38 uint CMSEncoderGetTypeID (); | |
39 int CMSEncoderCreate (CMSEncoderRef* cmsEncoderOut); | |
40 int CMSEncoderAddSigners (CMSEncoderRef cmsEncoder, CFTypeRef signerOrArray); | |
41 int CMSEncoderCopySigners (CMSEncoderRef cmsEncoder, CFArrayRef* signersOut); | |
42 int CMSEncoderAddRecipients (CMSEncoderRef cmsEncoder, CFTypeRef recipientOrArray); | |
43 int CMSEncoderCopyRecipients (CMSEncoderRef cmsEncoder, CFArrayRef* recipientsOut); | |
44 int CMSEncoderSetHasDetachedContent (CMSEncoderRef cmsEncoder, ubyte detachedContent); | |
45 int CMSEncoderGetHasDetachedContent (CMSEncoderRef cmsEncoder, char* detachedContentOut); | |
46 int CMSEncoderSetEncapsulatedContentType (CMSEncoderRef cmsEncoder, CSSM_OID* eContentType); | |
47 int CMSEncoderCopyEncapsulatedContentType (CMSEncoderRef cmsEncoder, CFDataRef* eContentTypeOut); | |
48 int CMSEncoderAddSupportingCerts (CMSEncoderRef cmsEncoder, CFTypeRef certOrArray); | |
49 int CMSEncoderCopySupportingCerts (CMSEncoderRef cmsEncoder, CFArrayRef* certsOut); | |
50 int CMSEncoderAddSignedAttributes (CMSEncoderRef cmsEncoder, uint signedAttributes); | |
51 int CMSEncoderSetCertificateChainMode (CMSEncoderRef cmsEncoder, uint chainMode); | |
52 int CMSEncoderGetCertificateChainMode (CMSEncoderRef cmsEncoder, CMSCertificateChainMode* chainModeOut); | |
53 int CMSEncoderUpdateContent (CMSEncoderRef cmsEncoder, void* content, uint contentLen); | |
54 int CMSEncoderCopyEncodedContent (CMSEncoderRef cmsEncoder, CFDataRef* encodedContentOut); | |
55 int CMSEncode (CFTypeRef signers, CFTypeRef recipients, CSSM_OID* eContentType, ubyte detachedContent, uint signedAttributes, void* content, uint contentLen, CFDataRef* encodedContentOut); | |
56 } |