2 * Copyright (c) 2002-2003,2011,2014 Apple Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please
7 * obtain a copy of the License at http://www.apple.com/publicsource and
8 * read it before using this file.
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
12 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
13 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
15 * Please see the License for the specific language governing rights and
16 * limitations under the License.
22 Description: CDSA DB access utilities
27 #ifndef _CU_DB_UTILS_H_
28 #define _CU_DB_UTILS_H_
30 #include <Security/cssm.h>
37 * Add a certificate to an open DLDB.
39 CSSM_RETURN
cuAddCertToDb(
40 CSSM_DL_DB_HANDLE dlDbHand
,
41 const CSSM_DATA
*cert
,
42 CSSM_CERT_TYPE certType
,
43 CSSM_CERT_ENCODING certEncoding
,
44 const char *printName
, // C string
45 const CSSM_DATA
*publicKeyHash
); // ??
48 * Add a CRL to an open DL/DB.
50 CSSM_RETURN
cuAddCrlToDb(
51 CSSM_DL_DB_HANDLE dlDbHand
,
52 CSSM_CL_HANDLE clHand
,
54 const CSSM_DATA
*URI
); // optional
57 * Search DB for all records of type CRL or cert, calling appropriate
58 * parse/print routine for each record.
60 CSSM_RETURN
cuDumpCrlsCerts(
61 CSSM_DL_DB_HANDLE dlDbHand
,
62 CSSM_CL_HANDLE clHand
,
64 unsigned &numItems
, // returned
71 #endif /* _CU_DB_UTILS_H_ */