1divert(-1)
2changecom(/*, */)
3/*
4 * Copyright (c) 2000-2002 Apple Inc. All Rights Reserved.
5 * 
6 * The contents of this file constitute Original Code as defined in and are
7 * subject to the Apple Public Source License Version 1.2 (the 'License').
8 * You may not use this file except in compliance with the License. Please obtain
9 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * using this file.
11 * 
12 * This Original Code and all software distributed under the License are
13 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
14 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
15 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
17 * specific language governing rights and limitations under the License.
18 */
19
20define(`startClass',
21`define(`indexIndex', 0)dnl
22define(`class', $1)dnl
23divert(2)dnl
24// $1 attributes
25const CSSM_DB_SCHEMA_ATTRIBUTE_INFO $1SchemaAttributeList[] =
26{
27divert(3)dnl
28// $1 indices
29const CSSM_DB_SCHEMA_INDEX_INFO $1SchemaIndexList[] =
30{')
31
32define(`endClass',
33`divert(2)dnl
34};
35
36const uint32 class()SchemaAttributeCount = sizeof(class()SchemaAttributeList) / sizeof(CSSM_DB_SCHEMA_ATTRIBUTE_INFO);
37
38divert(3)dnl
39`    // Unique (primary) index'
40undivert(5)
41`    // Secondary indices'
42undivert(6)dnl
43};
44
45const uint32 class()SchemaIndexCount = sizeof(class()SchemaIndexList) / sizeof(CSSM_DB_SCHEMA_INDEX_INFO);
46
47undivert(4)dnl
48divert(0)dnl
49undivert(1)dnl
50undivert(2)dnl
51undivert(3)dnl')
52
53define(`attributeBody',
54`{
55ifelse(index(`$1',`s'),-1,
56`    CSSM_DB_ATTRIBUTE_NAME_AS_INTEGER,
57    {(char *)((uint64_t)$3<<32|$3)},',
58`    CSSM_DB_ATTRIBUTE_NAME_AS_STRING,
59    {$4},')
60    CSSM_DB_ATTRIBUTE_FORMAT_$7
61}')
62
63define(`simpleAttribute',
64`const CSSM_DB_ATTRIBUTE_INFO $2 =
65attributeBody($*);
66')
67
68define(`attribute',
69`divert(2)dnl
70    { $3, (char*) $4, { $5, $6 }, CSSM_DB_ATTRIBUTE_FORMAT_$7 },
71divert(-1)
72ifelse(index(`$1',`S'),-1,`',
73`divert(4)dnl
74simpleAttribute($*)
75divert(-1)')dnl
76
77ifelse(index(`$1',`U'),-1,`',
78`divert(5)dnl
79    { $3, 0, CSSM_DB_INDEX_UNIQUE, CSSM_DB_INDEX_ON_ATTRIBUTE },
80divert(-1)')dnl
81ifelse(index(`$1',`I'),-1,`',
82`define(`indexIndex', incr(indexIndex))dnl
83divert(6)dnl
84    { $3, indexIndex(), CSSM_DB_INDEX_NONUNIQUE, CSSM_DB_INDEX_ON_ATTRIBUTE },
85divert(-1)')')
86
87/* Start of actual output */
88divert(0)dnl
89/*
90 * Generated by m4 from KeySchema.m4 please do not edit this file.
91 */
92
93`#include <security_cdsa_utilities/KeySchema.h>'
94#include <Security/SecKey.h>
95
96namespace KeySchema {
97
98divert(-1)
99startClass(Key)
100attribute(`  Ss', KeyClass, kSecKeyKeyClass, (char*) "KeyClass", 0, NULL, UINT32)
101attribute(`  Ss', PrintName, kSecKeyPrintName, (char*) "PrintName", 0, NULL, BLOB)
102attribute(`  Ss', Alias, kSecKeyAlias, (char*) "Alias", 0, NULL, BLOB)
103attribute(`  Ss', Permanent, kSecKeyPermanent, (char*) "Permanent", 0, NULL, UINT32)
104attribute(`  Ss', Private, kSecKeyPrivate, (char*) "Private", 0, NULL, UINT32)
105attribute(`  Ss', Modifiable, kSecKeyModifiable, (char*) "Modifiable", 0, NULL, UINT32)
106attribute(`UISs', Label, kSecKeyLabel, (char*) "Label", 0, NULL, BLOB)
107attribute(`U Ss', ApplicationTag, kSecKeyApplicationTag, (char*) "ApplicationTag", 0, NULL, BLOB)
108attribute(`U Ss', KeyCreator, kSecKeyKeyCreator, (char*) "KeyCreator", 0, NULL, BLOB)
109attribute(`U Ss', KeyType, kSecKeyKeyType, (char*) "KeyType", 0, NULL, UINT32)
110attribute(`U Ss', KeySizeInBits, kSecKeyKeySizeInBits, (char*) "KeySizeInBits", 0, NULL, UINT32)
111attribute(`U Ss', EffectiveKeySize, kSecKeyEffectiveKeySize, (char*) "EffectiveKeySize", 0, NULL, UINT32)
112attribute(`U Ss', StartDate, kSecKeyStartDate, (char*) "StartDate", 0, NULL, BLOB)
113attribute(`U Ss', EndDate, kSecKeyEndDate, (char*) "EndDate", 0, NULL, BLOB)
114attribute(`  Ss', Sensitive, kSecKeySensitive, (char*) "Sensitive", 0, NULL, UINT32)
115attribute(`  Ss', AlwaysSensitive, kSecKeyAlwaysSensitive, (char*) "AlwaysSensitive", 0, NULL, UINT32)
116attribute(`  Ss', Extractable, kSecKeyExtractable, (char*) "Extractable", 0, NULL, UINT32)
117attribute(`  Ss', NeverExtractable, kSecKeyNeverExtractable, (char*) "NeverExtractable", 0, NULL, UINT32)
118attribute(` ISs', Encrypt, kSecKeyEncrypt, (char*) "Encrypt", 0, NULL, UINT32)
119attribute(` ISs', Decrypt, kSecKeyDecrypt, (char*) "Decrypt", 0, NULL, UINT32)
120attribute(` ISs', Derive, kSecKeyDerive, (char*) "Derive", 0, NULL, UINT32)
121attribute(` ISs', Sign, kSecKeySign, (char*) "Sign", 0, NULL, UINT32)
122attribute(` ISs', Verify, kSecKeyVerify, (char*) "Verify", 0, NULL, UINT32)
123attribute(` ISs', SignRecover, kSecKeySignRecover, (char*) "SignRecover", 0, NULL, UINT32)
124attribute(` ISs', VerifyRecover, kSecKeyVerifyRecover, (char*) "VerifyRecover", 0, NULL, UINT32)
125attribute(` ISs', Wrap, kSecKeyWrap, (char*) "Wrap", 0, NULL, UINT32)
126attribute(` ISs', Unwrap, kSecKeyUnwrap, (char*) "Unwrap", 0, NULL, UINT32)
127endClass()
128
129} // end namespace KeySchema
130