1/*
2 * Copyright (c) 2002-2004 Apple Computer, 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
24/*!
25	@header SecCertificateBundle
26	The functions provided in SecCertificateBundle implement a way to issue a certificate request to a
27	certificate authority.
28*/
29
30#ifndef _SECURITY_SECCERTIFICATEBUNDLE_H_
31#define _SECURITY_SECCERTIFICATEBUNDLE_H_
32
33#include <Security/SecBase.h>
34#include <Security/cssmtype.h>
35#include <CoreFoundation/CFArray.h>
36
37#if defined(__cplusplus)
38extern "C" {
39#endif
40
41/*!
42	@function SecCertificateBundleImport
43	@abstract Imports one or more certificates into a keychain with the specified encoding and bundle type.
44    @param keychain The destination keychain for the import. Specify NULL for the default keychain.
45    @param bundle A pointer to the bundle data.
46    @param type The bundle type as defined in cssmtype.h.
47    @param encodingType The bundle encoding type as defined in cssmtype.h.
48    @param keychainListToSkipDuplicates A reference to an array of keychains.  These keychains contain certificates that shouldn't be duplicated during the import.
49    @result A result code.  See "Security Error Codes" (SecBase.h).
50*/
51OSStatus SecCertificateBundleImport(
52        SecKeychainRef keychain,
53        const CSSM_CERT_BUNDLE* bundle,
54        CSSM_CERT_BUNDLE_TYPE type,
55        CSSM_CERT_BUNDLE_ENCODING encodingType,
56        CFArrayRef keychainListToSkipDuplicates);
57
58/*!
59	@function SecCertificateBundleExport
60	@abstract Exports one or more certificates into a bundle with the specified encoding and bundle type.
61    @param certificates An array of certificate and keychain items used to help build the bundle.
62    @param type The bundle type as defined in cssmtype.h. If the bundle type is unknown, an attempt will be made to determine the type for you.
63    @param encodingType The encoding type as defined in cssmtype.h.
64    @param data A pointer to data.  On return, this points to the bundle data.
65    @result A result code.  See "Security Error Codes" (SecBase.h).
66*/
67OSStatus SecCertificateBundleExport(
68        CFArrayRef certificates,
69        CSSM_CERT_BUNDLE_TYPE type,
70        CSSM_CERT_BUNDLE_ENCODING encodingType,
71        CSSM_DATA* data);
72
73#if defined(__cplusplus)
74}
75#endif
76
77#endif /* !_SECURITY_SECCERTIFICATEBUNDLE_H_ */
78