]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cssm/lib/cssmdli.h
Security-57336.10.29.tar.gz
[apple/security.git] / OSX / libsecurity_cssm / lib / cssmdli.h
1 /*
2 * Copyright (c) 1999-2001,2004,2011,2014 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 *
23 * cssmdli.h -- Service Provider Interface for Data Store Modules
24 */
25
26 #ifndef _CSSMDLI_H_
27 #define _CSSMDLI_H_ 1
28
29 #include <Security/cssmtype.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 typedef struct cssm_spi_dl_funcs {
36 CSSM_RETURN (CSSMDLI *DbOpen)
37 (CSSM_DL_HANDLE DLHandle,
38 const char *DbName,
39 const CSSM_NET_ADDRESS *DbLocation,
40 CSSM_DB_ACCESS_TYPE AccessRequest,
41 const CSSM_ACCESS_CREDENTIALS *AccessCred,
42 const void *OpenParameters,
43 CSSM_DB_HANDLE *DbHandle);
44 CSSM_RETURN (CSSMDLI *DbClose)
45 (CSSM_DL_DB_HANDLE DLDBHandle);
46 CSSM_RETURN (CSSMDLI *DbCreate)
47 (CSSM_DL_HANDLE DLHandle,
48 const char *DbName,
49 const CSSM_NET_ADDRESS *DbLocation,
50 const CSSM_DBINFO *DBInfo,
51 CSSM_DB_ACCESS_TYPE AccessRequest,
52 const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
53 const void *OpenParameters,
54 CSSM_DB_HANDLE *DbHandle);
55 CSSM_RETURN (CSSMDLI *DbDelete)
56 (CSSM_DL_HANDLE DLHandle,
57 const char *DbName,
58 const CSSM_NET_ADDRESS *DbLocation,
59 const CSSM_ACCESS_CREDENTIALS *AccessCred);
60 CSSM_RETURN (CSSMDLI *CreateRelation)
61 (CSSM_DL_DB_HANDLE DLDBHandle,
62 CSSM_DB_RECORDTYPE RelationID,
63 const char *RelationName,
64 uint32 NumberOfAttributes,
65 const CSSM_DB_SCHEMA_ATTRIBUTE_INFO *pAttributeInfo,
66 uint32 NumberOfIndexes,
67 const CSSM_DB_SCHEMA_INDEX_INFO *pIndexInfo);
68 CSSM_RETURN (CSSMDLI *DestroyRelation)
69 (CSSM_DL_DB_HANDLE DLDBHandle,
70 CSSM_DB_RECORDTYPE RelationID);
71 CSSM_RETURN (CSSMDLI *Authenticate)
72 (CSSM_DL_DB_HANDLE DLDBHandle,
73 CSSM_DB_ACCESS_TYPE AccessRequest,
74 const CSSM_ACCESS_CREDENTIALS *AccessCred);
75 CSSM_RETURN (CSSMDLI *GetDbAcl)
76 (CSSM_DL_DB_HANDLE DLDBHandle,
77 const CSSM_STRING *SelectionTag,
78 uint32 *NumberOfAclInfos,
79 CSSM_ACL_ENTRY_INFO_PTR *AclInfos);
80 CSSM_RETURN (CSSMDLI *ChangeDbAcl)
81 (CSSM_DL_DB_HANDLE DLDBHandle,
82 const CSSM_ACCESS_CREDENTIALS *AccessCred,
83 const CSSM_ACL_EDIT *AclEdit);
84 CSSM_RETURN (CSSMDLI *GetDbOwner)
85 (CSSM_DL_DB_HANDLE DLDBHandle,
86 CSSM_ACL_OWNER_PROTOTYPE_PTR Owner);
87 CSSM_RETURN (CSSMDLI *ChangeDbOwner)
88 (CSSM_DL_DB_HANDLE DLDBHandle,
89 const CSSM_ACCESS_CREDENTIALS *AccessCred,
90 const CSSM_ACL_OWNER_PROTOTYPE *NewOwner);
91 CSSM_RETURN (CSSMDLI *GetDbNames)
92 (CSSM_DL_HANDLE DLHandle,
93 CSSM_NAME_LIST_PTR *NameList);
94 CSSM_RETURN (CSSMDLI *GetDbNameFromHandle)
95 (CSSM_DL_DB_HANDLE DLDBHandle,
96 char **DbName);
97 CSSM_RETURN (CSSMDLI *FreeNameList)
98 (CSSM_DL_HANDLE DLHandle,
99 CSSM_NAME_LIST_PTR NameList);
100 CSSM_RETURN (CSSMDLI *DataInsert)
101 (CSSM_DL_DB_HANDLE DLDBHandle,
102 CSSM_DB_RECORDTYPE RecordType,
103 const CSSM_DB_RECORD_ATTRIBUTE_DATA *Attributes,
104 const CSSM_DATA *Data,
105 CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
106 CSSM_RETURN (CSSMDLI *DataDelete)
107 (CSSM_DL_DB_HANDLE DLDBHandle,
108 const CSSM_DB_UNIQUE_RECORD *UniqueRecordIdentifier);
109 CSSM_RETURN (CSSMDLI *DataModify)
110 (CSSM_DL_DB_HANDLE DLDBHandle,
111 CSSM_DB_RECORDTYPE RecordType,
112 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier,
113 const CSSM_DB_RECORD_ATTRIBUTE_DATA *AttributesToBeModified,
114 const CSSM_DATA *DataToBeModified,
115 CSSM_DB_MODIFY_MODE ModifyMode);
116 CSSM_RETURN (CSSMDLI *DataGetFirst)
117 (CSSM_DL_DB_HANDLE DLDBHandle,
118 const CSSM_QUERY *Query,
119 CSSM_HANDLE_PTR ResultsHandle,
120 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
121 CSSM_DATA_PTR Data,
122 CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
123 CSSM_RETURN (CSSMDLI *DataGetNext)
124 (CSSM_DL_DB_HANDLE DLDBHandle,
125 CSSM_HANDLE ResultsHandle,
126 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
127 CSSM_DATA_PTR Data,
128 CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
129 CSSM_RETURN (CSSMDLI *DataAbortQuery)
130 (CSSM_DL_DB_HANDLE DLDBHandle,
131 CSSM_HANDLE ResultsHandle);
132 CSSM_RETURN (CSSMDLI *DataGetFromUniqueRecordId)
133 (CSSM_DL_DB_HANDLE DLDBHandle,
134 const CSSM_DB_UNIQUE_RECORD *UniqueRecord,
135 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
136 CSSM_DATA_PTR Data);
137 CSSM_RETURN (CSSMDLI *FreeUniqueRecord)
138 (CSSM_DL_DB_HANDLE DLDBHandle,
139 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord);
140 CSSM_RETURN (CSSMDLI *PassThrough)
141 (CSSM_DL_DB_HANDLE DLDBHandle,
142 uint32 PassThroughId,
143 const void *InputParams,
144 void **OutputParams);
145 } CSSM_SPI_DL_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_SPI_DL_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
146
147 #ifdef __cplusplus
148 }
149 #endif
150
151 #endif /* _CSSMDLI_H_ */