comparison dstep/security/eisl.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.eisl;
8
9 import dstep.security.cssmconfig;
10
11 alias void* ISL_ITERATOR_PTR;
12 alias void* ISL_VERIFIED_SIGNATURE_ROOT_PTR;
13 alias void* ISL_VERIFIED_CERTIFICATE_CHAIN_PTR;
14 alias void* ISL_VERIFIED_CERTIFICATE_PTR;
15 alias void* ISL_MANIFEST_SECTION_PTR;
16 alias void* ISL_VERIFIED_MODULE_PTR;
17 alias ISL_CONST_DATA* ISL_CONST_DATA_PTR;
18
19 extern (C)
20 {
21 alias void function () ISL_FUNCTION_PTR;
22 }
23
24 enum isl_status
25 {
26 ISL_OK = 0,
27 ISL_FAIL = -1
28 }
29
30 struct ISL_DATA
31 {
32 uint Length;
33 char* Data;
34 }
35
36
37 struct ISL_CONST_DATA
38 {
39 uint Length;
40 char* Data;
41 }
42
43 extern (C)
44 {
45 ISL_VERIFIED_MODULE_PTR EISL_SelfCheck ();
46 ISL_VERIFIED_MODULE_PTR EISL_VerifyAndLoadModuleAndCredentialData (ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA PublicKey);
47 ISL_VERIFIED_MODULE_PTR EISL_VerifyAndLoadModuleAndCredentialDataWithCertificate (ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA Certificate);
48 ISL_VERIFIED_MODULE_PTR EISL_VerifyAndLoadModuleAndCredentials (ISL_CONST_DATA Credentials, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA PublicKey);
49 ISL_VERIFIED_MODULE_PTR EISL_VerifyAndLoadModuleAndCredentialsWithCertificate (ISL_CONST_DATA Credentials, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA Certificate);
50 ISL_VERIFIED_MODULE_PTR EISL_VerifyLoadedModuleAndCredentialData (ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA PublicKey);
51 ISL_VERIFIED_MODULE_PTR EISL_VerifyLoadedModuleAndCredentialDataWithCertificate (ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA Certificate);
52 ISL_VERIFIED_MODULE_PTR EISL_VerifyLoadedModuleAndCredentials (ISL_CONST_DATA Credentials, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA PublicKey);
53 ISL_VERIFIED_MODULE_PTR EISL_VerifyLoadedModuleAndCredentialsWithCertificate (ISL_CONST_DATA Credentials, ISL_CONST_DATA Name, ISL_CONST_DATA Signer, ISL_CONST_DATA Certificate);
54 ISL_VERIFIED_CERTIFICATE_CHAIN_PTR EISL_GetCertificateChain (ISL_VERIFIED_MODULE_PTR Module);
55 uint EISL_ContinueVerification (ISL_VERIFIED_MODULE_PTR Module, uint WorkFactor);
56 ISL_VERIFIED_MODULE_PTR EISL_DuplicateVerifiedModulePtr (ISL_VERIFIED_MODULE_PTR Module);
57 int EISL_RecycleVerifiedModuleCredentials (ISL_VERIFIED_MODULE_PTR Verification);
58 ISL_VERIFIED_SIGNATURE_ROOT_PTR EISL_CreateVerifiedSignatureRootWithCredentialData (ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath, ISL_CONST_DATA Signer, ISL_CONST_DATA PublicKey);
59 ISL_VERIFIED_SIGNATURE_ROOT_PTR EISL_CreateVerifiedSignatureRootWithCredentialDataAndCertificate (ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath, ISL_VERIFIED_CERTIFICATE_PTR Cert);
60 ISL_VERIFIED_SIGNATURE_ROOT_PTR EISL_CreateVerfiedSignatureRoot (ISL_CONST_DATA Credentials, ISL_CONST_DATA Signer, ISL_CONST_DATA PublicKey);
61 ISL_VERIFIED_SIGNATURE_ROOT_PTR EISL_CreateVerfiedSignatureRootWithCertificate (ISL_CONST_DATA Credentials, ISL_VERIFIED_CERTIFICATE_PTR Cert);
62 ISL_MANIFEST_SECTION_PTR EISL_FindManifestSection (ISL_VERIFIED_SIGNATURE_ROOT_PTR Root, ISL_CONST_DATA Name);
63 ISL_ITERATOR_PTR EISL_CreateManifestSectionEnumerator (ISL_VERIFIED_SIGNATURE_ROOT_PTR Root);
64 ISL_MANIFEST_SECTION_PTR EISL_GetNextManifestSection (ISL_ITERATOR_PTR Iterator);
65 int EISL_RecycleManifestSectionEnumerator (ISL_ITERATOR_PTR Iterator);
66 int EISL_FindManifestAttribute (ISL_VERIFIED_SIGNATURE_ROOT_PTR Context, ISL_CONST_DATA Name, ISL_CONST_DATA_PTR Value);
67 ISL_ITERATOR_PTR EISL_CreateManifestAttributeEnumerator (ISL_VERIFIED_SIGNATURE_ROOT_PTR Context);
68 int EISL_FindSignerInfoAttribute (ISL_VERIFIED_SIGNATURE_ROOT_PTR Context, ISL_CONST_DATA Name, ISL_CONST_DATA_PTR Value);
69 ISL_ITERATOR_PTR EISL_CreateSignerInfoAttributeEnumerator (ISL_VERIFIED_SIGNATURE_ROOT_PTR Context);
70 int EISL_GetNextAttribute (ISL_ITERATOR_PTR Iterator, ISL_CONST_DATA_PTR Name, ISL_CONST_DATA_PTR Value);
71 int EISL_RecycleAttributeEnumerator (ISL_ITERATOR_PTR Iterator);
72 int EISL_FindSignatureAttribute (ISL_VERIFIED_SIGNATURE_ROOT_PTR Root, ISL_CONST_DATA Name, ISL_CONST_DATA_PTR Value);
73 ISL_ITERATOR_PTR EISL_CreateSignatureAttributeEnumerator (ISL_VERIFIED_SIGNATURE_ROOT_PTR Root);
74 int EISL_GetNextSignatureAttribute (ISL_ITERATOR_PTR Iterator, ISL_CONST_DATA_PTR Name, ISL_CONST_DATA_PTR Value);
75 int EISL_RecycleSignatureAttributeEnumerator (ISL_ITERATOR_PTR Iterator);
76 int EISL_RecycleVerifiedSignatureRoot (ISL_VERIFIED_SIGNATURE_ROOT_PTR Root);
77 ISL_VERIFIED_CERTIFICATE_CHAIN_PTR EISL_CreateCertificateChainWithCredentialData (ISL_CONST_DATA RootIssuer, ISL_CONST_DATA PublicKey, ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath);
78 ISL_VERIFIED_CERTIFICATE_CHAIN_PTR EISL_CreateCertificateChainWithCredentialDataAndCertificate (ISL_CONST_DATA Certificate, ISL_CONST_DATA CredentialsImage, ISL_CONST_DATA ModuleSearchPath);
79 ISL_VERIFIED_CERTIFICATE_CHAIN_PTR EISL_CreateCertificateChain (ISL_CONST_DATA RootIssuer, ISL_CONST_DATA PublicKey, ISL_CONST_DATA Credential);
80 ISL_VERIFIED_CERTIFICATE_CHAIN_PTR EISL_CreateCertificateChainWithCertificate (ISL_CONST_DATA Certificate, ISL_CONST_DATA Credential);
81 uint EISL_CopyCertificateChain (ISL_VERIFIED_CERTIFICATE_CHAIN_PTR Verification, ISL_VERIFIED_CERTIFICATE_PTR* Certs, uint MaxCertificates);
82 int EISL_RecycleVerifiedCertificateChain (ISL_VERIFIED_CERTIFICATE_CHAIN_PTR Chain);
83 int EISL_FindCertificateAttribute (ISL_VERIFIED_CERTIFICATE_PTR Cert, ISL_CONST_DATA Name, ISL_CONST_DATA_PTR Value);
84 ISL_ITERATOR_PTR EISL_CreateCertificateAttributeEnumerator (ISL_VERIFIED_CERTIFICATE_PTR Cert);
85 int EISL_GetNextCertificateAttribute (ISL_ITERATOR_PTR CertIterator, ISL_CONST_DATA_PTR Name, ISL_CONST_DATA_PTR Value);
86 int EISL_RecycleCertificateAttributeEnumerator (ISL_ITERATOR_PTR CertIterator);
87 ISL_VERIFIED_SIGNATURE_ROOT_PTR EISL_GetManifestSignatureRoot (ISL_MANIFEST_SECTION_PTR Section);
88 ISL_VERIFIED_MODULE_PTR EISL_VerifyAndLoadModule (ISL_MANIFEST_SECTION_PTR Section);
89 ISL_VERIFIED_MODULE_PTR EISL_VerifyLoadedModule (ISL_MANIFEST_SECTION_PTR Section);
90 int EISL_FindManifestSectionAttribute (ISL_MANIFEST_SECTION_PTR Section, ISL_CONST_DATA Name, ISL_CONST_DATA_PTR Value);
91 ISL_ITERATOR_PTR EISL_CreateManifestSectionAttributeEnumerator (ISL_MANIFEST_SECTION_PTR Section);
92 int EISL_GetNextManifestSectionAttribute (ISL_ITERATOR_PTR Iterator, ISL_CONST_DATA_PTR Name, ISL_CONST_DATA_PTR Value);
93 int EISL_RecycleManifestSectionAttributeEnumerator (ISL_ITERATOR_PTR Iterator);
94 ISL_MANIFEST_SECTION_PTR EISL_GetModuleManifestSection (ISL_VERIFIED_MODULE_PTR Module);
95 ISL_FUNCTION_PTR EISL_LocateProcedureAddress (ISL_VERIFIED_MODULE_PTR Module, ISL_CONST_DATA Name);
96 int EISL_CheckAddressWithinModule (ISL_VERIFIED_MODULE_PTR Verification, ISL_FUNCTION_PTR Address);
97 int EISL_CheckDataAddressWithinModule (ISL_VERIFIED_MODULE_PTR Verification, void* Address);
98 void* EISL_GetLibHandle (ISL_VERIFIED_MODULE_PTR Verification);
99 }