Mercurial > projects > dstep
comparison dstep/security/SecKey.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.SecKey; | |
8 | |
9 import dstep.security.SecBase; | |
10 import dstep.security.cssmtype; | |
11 | |
12 alias uint SecCredentialType; | |
13 | |
14 enum | |
15 { | |
16 kSecKeyKeyClass = 0, | |
17 kSecKeyPrintName = 1, | |
18 kSecKeyAlias = 2, | |
19 kSecKeyPermanent = 3, | |
20 kSecKeyPrivate = 4, | |
21 kSecKeyModifiable = 5, | |
22 kSecKeyLabel = 6, | |
23 kSecKeyApplicationTag = 7, | |
24 kSecKeyKeyCreator = 8, | |
25 kSecKeyKeyType = 9, | |
26 kSecKeyKeySizeInBits = 10, | |
27 kSecKeyEffectiveKeySize = 11, | |
28 kSecKeyStartDate = 12, | |
29 kSecKeyEndDate = 13, | |
30 kSecKeySensitive = 14, | |
31 kSecKeyAlwaysSensitive = 15, | |
32 kSecKeyExtractable = 16, | |
33 kSecKeyNeverExtractable = 17, | |
34 kSecKeyEncrypt = 18, | |
35 kSecKeyDecrypt = 19, | |
36 kSecKeyDerive = 20, | |
37 kSecKeySign = 21, | |
38 kSecKeyVerify = 22, | |
39 kSecKeySignRecover = 23, | |
40 kSecKeyVerifyRecover = 24, | |
41 kSecKeyWrap = 25, | |
42 kSecKeyUnwrap = 26 | |
43 } | |
44 | |
45 enum | |
46 { | |
47 kSecCredentialTypeDefault = 0, | |
48 kSecCredentialTypeWithUI, | |
49 kSecCredentialTypeNoUI | |
50 } | |
51 | |
52 extern (C) | |
53 { | |
54 uint SecKeyGetTypeID (); | |
55 int SecKeyCreatePair (SecKeychainRef keychainRef, uint algorithm, uint keySizeInBits, ulong contextHandle, uint publicKeyUsage, uint publicKeyAttr, uint privateKeyUsage, uint privateKeyAttr, SecAccessRef initialAccess, SecKeyRef* publicKey, SecKeyRef* privateKey); | |
56 int SecKeyGenerate (SecKeychainRef keychainRef, uint algorithm, uint keySizeInBits, ulong contextHandle, uint keyUsage, uint keyAttr, SecAccessRef initialAccess, SecKeyRef* keyRef); | |
57 int SecKeyGetCSSMKey (SecKeyRef key, CSSM_KEY** cssmKey); | |
58 int SecKeyGetCSPHandle (SecKeyRef keyRef, CSSM_CSP_HANDLE* cspHandle); | |
59 int SecKeyGetCredentials (SecKeyRef keyRef, int operation, uint credentialType, CSSM_ACCESS_CREDENTIALS** outCredentials); | |
60 } |