annotate dstep/security/SecCertificate.d @ 16:19885b43130e

Huge update, the bridge actually works now
author Jacob Carlborg <doob@me.com>
date Sun, 03 Jan 2010 22:06:11 +0100
parents 07194b026fa4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
1 /**
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
3 * Authors: Jacob Carlborg
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
4 * Version: Initial created: Jul 22, 2009
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
6 */
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
7 module dstep.security.SecCertificate;
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
8
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
9 import dstep.corefoundation.CFArray;
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
10 import dstep.corefoundation.CFBase;
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
11 import dstep.corefoundation.CFDate;
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
12 import dstep.objc.bridge.TypeEncoding;
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
13 import dstep.security.SecBase;
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
14 import dstep.security.cssmtype;
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
15 import dstep.security.x509defs;
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
16
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
17 // This is needed otherwise the enums will fail compiling with gdc
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
18 version (GNU)
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
19 {
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
20 private
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
21 {
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
22 const __kSecSubjectItemAttr = getOSType!("subj");
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
23 const __kSecIssuerItemAttr = getOSType!("issu");
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
24 const __kSecSerialNumberItemAttr = getOSType!("snbr");
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
25 const __kSecPublicKeyHashItemAttr = getOSType!("hpky");
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
26 const __kSecSubjectKeyIdentifierItemAttr = getOSType!("skid");
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
27 const __kSecCertTypeItemAttr = getOSType!("ctyp");
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
28 const __kSecCertEncodingItemAttr = getOSType!("cenc");
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
29 }
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
30 }
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
31
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
32 enum
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
33 {
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
34 kSecSubjectItemAttr = getOSType!("subj"),
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
35 kSecIssuerItemAttr = getOSType!("issu"),
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
36 kSecSerialNumberItemAttr = getOSType!("snbr"),
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
37 kSecPublicKeyHashItemAttr = getOSType!("hpky"),
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
38 kSecSubjectKeyIdentifierItemAttr = getOSType!("skid"),
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
39 kSecCertTypeItemAttr = getOSType!("ctyp"),
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
40 kSecCertEncodingItemAttr = getOSType!("cenc")
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
41 }
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
42
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
43 extern (C)
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
44 {
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
45 uint SecCertificateGetTypeID ();
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
46 int SecCertificateCreateFromData (CSSM_DATA* data, uint type, uint encoding, SecCertificateRef* certificate);
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
47 int SecCertificateAddToKeychain (SecCertificateRef certificate, SecKeychainRef keychain);
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
48 int SecCertificateGetData (SecCertificateRef certificate, CSSM_DATA_PTR data);
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
49 int SecCertificateGetType (SecCertificateRef certificate, CSSM_CERT_TYPE* certificateType);
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
50 int SecCertificateGetSubject (SecCertificateRef certificate, CSSM_X509_NAME** subject);
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
51 int SecCertificateGetIssuer (SecCertificateRef certificate, CSSM_X509_NAME** issuer);
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
52 int SecCertificateGetCLHandle (SecCertificateRef certificate, CSSM_CL_HANDLE* clHandle);
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
53 int SecCertificateGetAlgorithmID (SecCertificateRef certificate, CSSM_X509_ALGORITHM_IDENTIFIER** algid);
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
54 int SecCertificateCopyPublicKey (SecCertificateRef certificate, SecKeyRef* key);
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
55 int SecCertificateCopyCommonName (SecCertificateRef certificate, CFStringRef* commonName);
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
56 int SecCertificateCopyEmailAddresses (SecCertificateRef certificate, CFArrayRef* emailAddresses);
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
57 int SecCertificateCopyPreference (CFStringRef name, uint keyUsage, SecCertificateRef* certificate);
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
58 int SecCertificateSetPreference (SecCertificateRef certificate, CFStringRef name, uint keyUsage, CFDateRef date);
07194b026fa4 Added bindings to a couple of frameworks, new license + some other things
Jacob Carlborg <doob@me.com>
parents:
diff changeset
59 }