]>
git.saurik.com Git - apple/security.git/blob - AppleX509TP/rootCerts.h
ec514882780654cbb3e641af49c38cb340bc8e59
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_
34 * As of 3/18/02, use of the built-in root certs is disabled by default.
35 * Their use is enabled at in CSSM_TP_CertGroupVerify by the use of the
36 * CSSM_TP_USE_INTERNAL_ROOT_CERTS bit in
37 * CSSM_APPLE_TP_ACTION_DATA.ActionFlags. The presence of the root certs
38 * at all (at compile time) is controlled TP_ROOT_CERT_ENABLE.
40 #define TP_ROOT_CERT_ENABLE 0
42 #if TP_ROOT_CERT_ENABLE
44 #include <Security/cssmtype.h>
45 #include <Security/globalizer.h>
46 #include <Security/threading.h>
47 #include "TPCertInfo.h"
50 * Each one of these represents one known root cert.
53 CSSM_DATA subjectName
; // normalized and DER-encoded
54 CSSM_DATA publicKey
; // DER-encoded
58 /* One of these per process which caches the roots in tpRootCert format */
62 TPRootStore() : mRootCerts(NULL
), mNumRootCerts(0) { }
64 const tpRootCert
*rootCerts(
65 CSSM_CL_HANDLE clHand
,
66 unsigned &numRootCerts
);
67 static ModuleNexus
<TPRootStore
> tpGlobalRoots
;
70 tpRootCert
*mRootCerts
;
71 unsigned mNumRootCerts
;
77 * Compare a root cert to a list of known embedded roots.
81 CSSM_BOOL
tp_isKnownRootCert(
82 TPCertInfo
*rootCert
, // raw cert to compare
83 CSSM_CL_HANDLE clHand
);
85 CSSM_BOOL
tp_verifyWithKnownRoots(
86 CSSM_CL_HANDLE clHand
,
87 CSSM_CSP_HANDLE cspHand
,
88 TPCertInfo
*certToVfy
); // last in chain, not root
92 #endif /* TP_ROOT_CERT_ENABLE */
94 #endif /* _TP_ROOT_CERTS_H_ */