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