]>
git.saurik.com Git - apple/security.git/blob - Keychain/SecCFTypes.cpp
eaa73b851dc66544503ed837983a9aa6aa17575f
2 * Copyright (c) 2002 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.
19 // SecCFTypes.cpp - CF runtime interface
22 #include <Security/SecCFTypes.h>
23 #include <Security/SecRuntime.h>
28 namespace KeychainCore
34 static ModuleNexus
<SecCFTypes
> nexus
;
39 } // end namespace KeychainCore
41 } // end namespace Security
43 using namespace KeychainCore
;
45 SecCFTypes::SecCFTypes() :
48 Certificate("SecCertificate"),
49 CertificateRequest("SecCertificateRequest"),
50 Identity("SecIdentity"),
51 IdentityCursor("SecIdentitySearch"),
52 ItemImpl("SecKeychainItem"),
53 KCCursorImpl("SecKeychainSearch"),
54 KeychainImpl("SecKeychain"),
57 PolicyCursor("SecPolicySearch"),
59 TrustedApplication("SecTrustedApplication")
66 CFClass::CFClass(const char *name
)
68 // initialize the CFRuntimeClass structure
73 finalize
= finalizeType
;
76 copyFormattingDesc
= copyFormattingDescType
;
77 copyDebugDesc
= copyDebugDescType
;
80 typeID
= _CFRuntimeRegisterClass(this);
81 assert(typeID
!= _kCFRuntimeNotATypeID
);
85 CFClass::finalizeType(CFTypeRef cf
)
87 SecCFObject
*obj
= SecCFObject::optional(cf
);
93 CFClass::equalType(CFTypeRef cf1
, CFTypeRef cf2
)
95 // CF checks for pointer equality and ensures type equality already
96 return SecCFObject::optional(cf1
)->equal(*SecCFObject::optional(cf2
));
100 CFClass::hashType(CFTypeRef cf
)
102 return SecCFObject::optional(cf
)->hash();
106 CFClass::copyFormattingDescType(CFTypeRef cf
, CFDictionaryRef dict
)
108 return SecCFObject::optional(cf
)->copyFormattingDesc(dict
);
112 CFClass::copyDebugDescType(CFTypeRef cf
)
114 return SecCFObject::optional(cf
)->copyDebugDesc();