Mercurial > projects > dstep
comparison dstep/security/SecImportExport.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.SecImportExport; | |
8 | |
9 import dstep.corefoundation.CoreFoundation; | |
10 import dstep.security.SecAccess; | |
11 import dstep.security.SecBase; | |
12 import dstep.security.SecKeychain; | |
13 import dstep.security.cssmtype; | |
14 //import dstep.stdint; | |
15 | |
16 alias uint SecExternalFormat; | |
17 alias uint SecExternalItemType; | |
18 alias uint SecItemImportExportFlags; | |
19 alias uint SecKeyImportExportFlags; | |
20 | |
21 enum | |
22 { | |
23 kSecFormatUnknown = 0, | |
24 kSecFormatOpenSSL, | |
25 kSecFormatSSH, | |
26 kSecFormatBSAFE, | |
27 kSecFormatRawKey, | |
28 kSecFormatWrappedPKCS8, | |
29 kSecFormatWrappedOpenSSL, | |
30 kSecFormatWrappedSSH, | |
31 kSecFormatWrappedLSH, | |
32 kSecFormatX509Cert, | |
33 kSecFormatPEMSequence, | |
34 kSecFormatPKCS7, | |
35 kSecFormatPKCS12, | |
36 kSecFormatNetscapeCertSequence, | |
37 kSecFormatSSHv2 | |
38 } | |
39 | |
40 enum | |
41 { | |
42 kSecItemTypeUnknown, | |
43 kSecItemTypePrivateKey, | |
44 kSecItemTypePublicKey, | |
45 kSecItemTypeSessionKey, | |
46 kSecItemTypeCertificate, | |
47 kSecItemTypeAggregate | |
48 } | |
49 | |
50 enum | |
51 { | |
52 kSecItemPemArmour = 0x00000001 | |
53 } | |
54 | |
55 enum | |
56 { | |
57 kSecKeyImportOnlyOne = 0x00000001, | |
58 kSecKeySecurePassphrase = 0x00000002, | |
59 kSecKeyNoAccessControl = 0x00000004 | |
60 } | |
61 | |
62 struct SecKeyImportExportParameters | |
63 { | |
64 uint version_; | |
65 uint flags; | |
66 CFTypeRef passphrase; | |
67 CFStringRef alertTitle; | |
68 CFStringRef alertPrompt; | |
69 SecAccessRef accessRef; | |
70 uint keyUsage; | |
71 uint keyAttributes; | |
72 } | |
73 | |
74 extern (C) | |
75 { | |
76 int SecKeychainItemExport (CFTypeRef keychainItemOrArray, uint outputFormat, uint flags, SecKeyImportExportParameters* keyParams, CFDataRef* exportedData); | |
77 int SecKeychainItemImport (CFDataRef importedData, CFStringRef fileNameOrExtension, SecExternalFormat* inputFormat, SecExternalItemType* itemType, uint flags, SecKeyImportExportParameters* keyParams, SecKeychainRef importKeychain, CFArrayRef* outItems); | |
78 } |