]>
git.saurik.com Git - apple/security.git/blob - AppleX509TP/rootCerts.h
2 * Copyright (c) 2000-2001 Apple Computer, 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 obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
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 EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
22 Contains: Interface to local cache of system-wide trusted root certs
24 Written by: Doug Mitchell.
26 Copyright: Copyright 1999 by Apple Computer, Inc., all rights reserved.
30 #ifndef _TP_ROOT_CERTS_H_
31 #define _TP_ROOT_CERTS_H_
33 #include <Security/cssmtype.h>
34 #include <Security/globalizer.h>
35 #include <Security/threading.h>
38 * As of 3/18/02, use of the built-in root certs is disabled by default.
39 * Their use is enabled at in CSSM_TP_CertGroupVerify by the use of a
40 * private bit in CSSM_APPLE_TP_ACTION_DATA.ActionFlags.
41 * The presence of the root certs at all (at compile time) is controlled
42 * TP_ROOT_CERT_ENABLE.
44 #define TP_ROOT_CERT_ENABLE 1
46 #if TP_ROOT_CERT_ENABLE
49 * Each one of these represents one known root cert.
52 CSSM_DATA subjectName
; // normalized and DER-encoded
53 CSSM_DATA publicKey
; // DER-encoded
57 /* One of these per process which caches the roots in tpRootCert format */
61 TPRootStore() : mRootCerts(NULL
), mNumRootCerts(0) { }
63 const tpRootCert
*rootCerts(
64 CSSM_CL_HANDLE clHand
,
65 unsigned &numRootCerts
);
66 static ModuleNexus
<TPRootStore
> tpGlobalRoots
;
69 tpRootCert
*mRootCerts
;
70 unsigned mNumRootCerts
;
74 #endif /* TP_ROOT_CERT_ENABLE */
76 #endif /* _TP_ROOT_CERTS_H_ */