]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cdsa_utilities/lib/Schema.h
Security-59306.101.1.tar.gz
[apple/security.git] / OSX / libsecurity_cdsa_utilities / lib / Schema.h
1 /*
2 * Copyright (c) 2000-2004,2006,2011,2014 Apple 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 //
26 // Schema.h
27 //
28 #ifndef _SECURITY_SCHEMA_H_
29 #define _SECURITY_SCHEMA_H_
30
31 #include <Security/SecKeychainItem.h>
32
33 namespace Security {
34
35 namespace KeychainCore {
36
37 namespace Schema {
38
39 CSSM_DB_RECORDTYPE recordTypeFor(SecItemClass itemClass);
40 SecItemClass itemClassFor(CSSM_DB_RECORDTYPE recordType);
41 bool haveAttributeInfo(SecKeychainAttrType attrType);
42 const CSSM_DB_ATTRIBUTE_INFO &attributeInfo(SecKeychainAttrType attrType);
43
44 extern const CSSM_DB_ATTRIBUTE_INFO RelationID;
45 extern const CSSM_DB_ATTRIBUTE_INFO RelationName;
46 extern const CSSM_DB_ATTRIBUTE_INFO AttributeID;
47 extern const CSSM_DB_ATTRIBUTE_INFO AttributeNameFormat;
48 extern const CSSM_DB_ATTRIBUTE_INFO AttributeName;
49 extern const CSSM_DB_ATTRIBUTE_INFO AttributeNameID;
50 extern const CSSM_DB_ATTRIBUTE_INFO AttributeFormat;
51 extern const CSSM_DB_ATTRIBUTE_INFO IndexType;
52
53 extern const CSSM_DBINFO DBInfo;
54
55 // Certificate attributes and schema
56 extern const CSSM_DB_ATTRIBUTE_INFO kX509CertificateCertType;
57 extern const CSSM_DB_ATTRIBUTE_INFO kX509CertificateCertEncoding;
58 extern const CSSM_DB_ATTRIBUTE_INFO kX509CertificatePrintName;
59 extern const CSSM_DB_ATTRIBUTE_INFO kX509CertificateAlias;
60 extern const CSSM_DB_ATTRIBUTE_INFO kX509CertificateSubject;
61 extern const CSSM_DB_ATTRIBUTE_INFO kX509CertificateIssuer;
62 extern const CSSM_DB_ATTRIBUTE_INFO kX509CertificateSerialNumber;
63 extern const CSSM_DB_ATTRIBUTE_INFO kX509CertificateSubjectKeyIdentifier;
64 extern const CSSM_DB_ATTRIBUTE_INFO kX509CertificatePublicKeyHash;
65
66 extern const CSSM_DB_SCHEMA_ATTRIBUTE_INFO X509CertificateSchemaAttributeList[];
67 extern const CSSM_DB_SCHEMA_INDEX_INFO X509CertificateSchemaIndexList[];
68 extern const uint32 X509CertificateSchemaAttributeCount;
69 extern const uint32 X509CertificateSchemaIndexCount;
70
71 // CRL attributes and schema
72 extern const CSSM_DB_ATTRIBUTE_INFO kX509CrlCrlType;
73 extern const CSSM_DB_ATTRIBUTE_INFO kX509CrlCrlEncoding;
74 extern const CSSM_DB_ATTRIBUTE_INFO kX509CrlPrintName;
75 extern const CSSM_DB_ATTRIBUTE_INFO kX509CrlAlias;
76 extern const CSSM_DB_ATTRIBUTE_INFO kX509CrlIssuer;
77 extern const CSSM_DB_ATTRIBUTE_INFO kX509CrlSerialNumber;
78 extern const CSSM_DB_ATTRIBUTE_INFO kX509CrlThisUpdate;
79 extern const CSSM_DB_ATTRIBUTE_INFO kX509CrlNextUpdate;
80
81 extern const CSSM_DB_SCHEMA_ATTRIBUTE_INFO X509CrlSchemaAttributeList[];
82 extern const CSSM_DB_SCHEMA_INDEX_INFO X509CrlSchemaIndexList[];
83 extern const uint32 X509CrlSchemaAttributeCount;
84 extern const uint32 X509CrlSchemaIndexCount;
85
86 // UserTrust records attributes and schema
87 extern const CSSM_DB_ATTRIBUTE_INFO kUserTrustTrustedCertificate;
88 extern const CSSM_DB_ATTRIBUTE_INFO kUserTrustTrustedPolicy;
89
90 extern const CSSM_DB_SCHEMA_ATTRIBUTE_INFO UserTrustSchemaAttributeList[];
91 extern const CSSM_DB_SCHEMA_INDEX_INFO UserTrustSchemaIndexList[];
92 extern const uint32 UserTrustSchemaAttributeCount;
93 extern const uint32 UserTrustSchemaIndexCount;
94
95 // UnlockReferral records attributes and schema
96 extern const CSSM_DB_ATTRIBUTE_INFO kUnlockReferralType;
97 extern const CSSM_DB_ATTRIBUTE_INFO kUnlockReferralDbName;
98 extern const CSSM_DB_ATTRIBUTE_INFO kUnlockReferralDbGuid;
99 extern const CSSM_DB_ATTRIBUTE_INFO kUnlockReferralDbSSID;
100 extern const CSSM_DB_ATTRIBUTE_INFO kUnlockReferralDbSSType;
101 extern const CSSM_DB_ATTRIBUTE_INFO kUnlockReferralDbNetname;
102 extern const CSSM_DB_ATTRIBUTE_INFO kUnlockReferralKeyLabel;
103 extern const CSSM_DB_ATTRIBUTE_INFO kUnlockReferralKeyAppTag;
104 extern const CSSM_DB_ATTRIBUTE_INFO kUnlockReferralPrintName;
105 extern const CSSM_DB_ATTRIBUTE_INFO kUnlockReferralAlias;
106
107 extern const CSSM_DB_SCHEMA_ATTRIBUTE_INFO UnlockReferralSchemaAttributeList[];
108 extern const CSSM_DB_SCHEMA_INDEX_INFO UnlockReferralSchemaIndexList[];
109 extern const uint32 UnlockReferralSchemaAttributeCount;
110 extern const uint32 UnlockReferralSchemaIndexCount;
111
112 // Extended Attribute record attributes and schema
113 extern const CSSM_DB_ATTRIBUTE_INFO kExtendedAttributeRecordType;
114 extern const CSSM_DB_ATTRIBUTE_INFO kExtendedAttributeItemID;
115 extern const CSSM_DB_ATTRIBUTE_INFO kExtendedAttributeAttributeName;
116 extern const CSSM_DB_ATTRIBUTE_INFO kExtendedAttributeModDate;
117 extern const CSSM_DB_ATTRIBUTE_INFO kExtendedAttributeAttributeValue;
118
119 extern const CSSM_DB_SCHEMA_ATTRIBUTE_INFO ExtendedAttributeSchemaAttributeList[];
120 extern const CSSM_DB_SCHEMA_INDEX_INFO ExtendedAttributeSchemaIndexList[];
121 extern const uint32 ExtendedAttributeSchemaAttributeCount;
122 extern const uint32 ExtendedAttributeSchemaIndexCount;
123
124 } // end namespace Schema
125
126 } // end namespace KeychainCore
127
128 } // end namespace Security
129
130 #endif // !_SECURITY_SCHEMA_H_