]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_keychain/lib/SecItemConstants.c
Security-59306.101.1.tar.gz
[apple/security.git] / OSX / libsecurity_keychain / lib / SecItemConstants.c
1 /*
2 * Copyright (c) 2006-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 #define __CONSTANT_CFSTRINGS__ 1
25 #include <CoreFoundation/CFString.h>
26
27 /* String constant declarations */
28
29 #define SEC_CONST_DECL(k,v) const CFStringRef k = CFSTR(v);
30
31 // See the other SecItemContants.c for actual definitions
32
33 /* Class Key Constant */
34 //SEC_CONST_DECL (kSecClass, "class");
35
36 /* Class Value Constants */
37 //SEC_CONST_DECL (kSecClassGenericPassword, "genp");
38 //SEC_CONST_DECL (kSecClassInternetPassword, "inet");
39 //SEC_CONST_DECL (kSecClassAppleSharePassword, "apls");
40 //SEC_CONST_DECL (kSecClassCertificate, "cert");
41 //SEC_CONST_DECL (kSecClassKey, "keys");
42 //SEC_CONST_DECL (kSecClassIdentity, "idnt");
43
44 /* Attribute Key Constants */
45 //SEC_CONST_DECL (kSecAttrAccessible, "pdmn");
46 //SEC_CONST_DECL (kSecAttrAccessGroup, "agrp");
47 SEC_CONST_DECL (kSecAttrAccess, "acls");
48 //SEC_CONST_DECL (kSecAttrCreationDate, "cdat");
49 //SEC_CONST_DECL (kSecAttrModificationDate, "mdat");
50 //SEC_CONST_DECL (kSecAttrDescription, "desc");
51 //SEC_CONST_DECL (kSecAttrComment, "icmt");
52 //SEC_CONST_DECL (kSecAttrCreator, "crtr");
53 //SEC_CONST_DECL (kSecAttrType, "type");
54 //SEC_CONST_DECL (kSecAttrLabel, "labl");
55 //SEC_CONST_DECL (kSecAttrIsInvisible, "invi");
56 //SEC_CONST_DECL (kSecAttrIsNegative, "nega");
57 //SEC_CONST_DECL (kSecAttrAccount, "acct");
58 //SEC_CONST_DECL (kSecAttrService, "svce");
59 //SEC_CONST_DECL (kSecAttrGeneric, "gena");
60 //SEC_CONST_DECL (kSecAttrSecurityDomain, "sdmn");
61 //SEC_CONST_DECL (kSecAttrServer, "srvr");
62 //SEC_CONST_DECL (kSecAttrProtocol, "ptcl");
63 //SEC_CONST_DECL (kSecAttrAuthenticationType, "atyp");
64 //SEC_CONST_DECL (kSecAttrPort, "port");
65 //SEC_CONST_DECL (kSecAttrPath, "path");
66 //SEC_CONST_DECL (kSecAttrVolume, "volm");
67 //SEC_CONST_DECL (kSecAttrAddress, "addr");
68 //SEC_CONST_DECL (kSecAttrAFPServerSignature, "afps");
69 //SEC_CONST_DECL (kSecAttrAlias, "alis");
70 //SEC_CONST_DECL (kSecAttrSubject, "subj");
71 //SEC_CONST_DECL (kSecAttrIssuer, "issr");
72 //SEC_CONST_DECL (kSecAttrSerialNumber, "slnr");
73 //SEC_CONST_DECL (kSecAttrSubjectKeyID, "skid");
74 //SEC_CONST_DECL (kSecAttrPublicKeyHash, "pkhh");
75 //SEC_CONST_DECL (kSecAttrCertificateType, "ctyp");
76 //SEC_CONST_DECL (kSecAttrCertificateEncoding, "cenc");
77 //SEC_CONST_DECL (kSecAttrKeyClass, "kcls");
78 //SEC_CONST_DECL (kSecAttrApplicationLabel, "klbl");
79 //SEC_CONST_DECL (kSecAttrIsPermanent, "perm");
80 //SEC_CONST_DECL (kSecAttrIsModifiable, "modi");
81 //SEC_CONST_DECL (kSecAttrIsPrivate, "priv");
82 //SEC_CONST_DECL (kSecAttrApplicationTag, "atag");
83 //SEC_CONST_DECL (kSecAttrKeyCreator, "crtr");
84 //SEC_CONST_DECL (kSecAttrKeyType, "type");
85 SEC_CONST_DECL (kSecAttrPRF, "prf");
86 SEC_CONST_DECL (kSecAttrSalt, "salt");
87 SEC_CONST_DECL (kSecAttrRounds, "rounds");
88 //SEC_CONST_DECL (kSecAttrKeySizeInBits, "bsiz");
89 //SEC_CONST_DECL (kSecAttrEffectiveKeySize, "esiz");
90 //SEC_CONST_DECL (kSecAttrStartDate, "sdat");
91 //SEC_CONST_DECL (kSecAttrEndDate, "edat");
92 //SEC_CONST_DECL (kSecAttrIsSensitive, "sens");
93 //SEC_CONST_DECL (kSecAttrWasAlwaysSensitive, "asen");
94 //SEC_CONST_DECL (kSecAttrIsExtractable, "extr");
95 //SEC_CONST_DECL (kSecAttrWasNeverExtractable, "next");
96 //SEC_CONST_DECL (kSecAttrCanEncrypt, "encr");
97 //SEC_CONST_DECL (kSecAttrCanDecrypt, "decr");
98 //SEC_CONST_DECL (kSecAttrCanDerive, "drve");
99 //SEC_CONST_DECL (kSecAttrCanSign, "sign");
100 //SEC_CONST_DECL (kSecAttrCanVerify, "vrfy");
101 //SEC_CONST_DECL (kSecAttrCanSignRecover, "snrc");
102 //SEC_CONST_DECL (kSecAttrCanVerifyRecover, "vyrc");
103 //SEC_CONST_DECL (kSecAttrCanWrap, "wrap");
104 //SEC_CONST_DECL (kSecAttrCanUnwrap, "unwp");
105 //SEC_CONST_DECL (kSecAttrSyncViewHint, "vwht");
106 //SEC_CONST_DECL (kSecAttrTokenID, "tkid");
107 /* Attribute Constants (Private) */
108 //SEC_CONST_DECL (kSecAttrScriptCode, "scrp");
109 //SEC_CONST_DECL (kSecAttrHasCustomIcon, "cusi");
110 //SEC_CONST_DECL (kSecAttrCRLType, "crlt");
111 //SEC_CONST_DECL (kSecAttrCRLEncoding, "crle");
112 //SEC_CONST_DECL (kSecAttrSynchronizable, "sync");
113 //SEC_CONST_DECL (kSecAttrSynchronizableAny, "syna");
114 //SEC_CONST_DECL (kSecAttrTombstone, "tomb");
115 //SEC_CONST_DECL (kSecAttrNoLegacy, "nleg");
116 //SEC_CONST_DECL (kSecAttrMultiUser, "musr");
117 //SEC_CONST_DECL (kSecAttrTokenOID, "toid");
118 //SEC_CONST_DECL (kSecAttrUUID, "UUID");
119 //SEC_CONST_DECL (kSecAttrPersistantReference, "persistref");
120 //SEC_CONST_DECL (kSecAttrPersistentReference, "persistref");
121 //SEC_CONST_DECL (kSecAttrSysBound, "sysb");
122 //SEC_CONST_DECL (kSecAttrSHA1, "sha1");
123 //
124 //SEC_CONST_DECL (kSecAttrDeriveSyncIDFromItemAttributes, "dspk");
125 //SEC_CONST_DECL (kSecAttrPCSPlaintextServiceIdentifier, "pcss");
126 //SEC_CONST_DECL (kSecAttrPCSPlaintextPublicKey, "pcsk");
127 //SEC_CONST_DECL (kSecAttrPCSPlaintextPublicIdentity, "pcsi");
128
129 /* Predefined access groups constants */
130 //SEC_CONST_DECL (kSecAttrAccessGroupToken, "com.apple.token");
131
132 /* Search Constants */
133 //SEC_CONST_DECL (kSecMatchPolicy, "m_Policy");
134 //SEC_CONST_DECL (kSecMatchItemList, "m_ItemList");
135 //SEC_CONST_DECL (kSecMatchSearchList, "m_SearchList");
136 //SEC_CONST_DECL (kSecMatchIssuers, "m_Issuers");
137 //SEC_CONST_DECL (kSecMatchEmailAddressIfPresent, "m_EmailAddressIfPresent");
138 //SEC_CONST_DECL (kSecMatchSubjectContains, "m_SubjectContains");
139 SEC_CONST_DECL (kSecMatchSubjectStartsWith, "m_SubjectStartsWith");
140 SEC_CONST_DECL (kSecMatchSubjectEndsWith, "m_SubjectEndsWith");
141 SEC_CONST_DECL (kSecMatchSubjectWholeString, "m_SubjectWholeString");
142 //SEC_CONST_DECL (kSecMatchCaseInsensitive, "m_CaseInsensitive");
143 SEC_CONST_DECL (kSecMatchDiacriticInsensitive, "m_DiacriticInsensitive");
144 SEC_CONST_DECL (kSecMatchWidthInsensitive, "m_WidthInsensitive");
145 //SEC_CONST_DECL (kSecMatchTrustedOnly, "m_TrustedOnly");
146 //SEC_CONST_DECL (kSecMatchValidOnDate, "m_ValidOnDate");
147 //SEC_CONST_DECL (kSecMatchLimit, "m_Limit");
148 /* Could just use kCFBooleanTrue and kCFBooleanFalse for these 2. */
149 //SEC_CONST_DECL (kSecMatchLimitOne, "m_LimitOne");
150 //SEC_CONST_DECL (kSecMatchLimitAll, "m_LimitAll");
151
152 /* Return Type Key Constants */
153 //SEC_CONST_DECL (kSecReturnData, "r_Data");
154 //SEC_CONST_DECL (kSecReturnAttributes, "r_Attributes");
155 //SEC_CONST_DECL (kSecReturnRef, "r_Ref");
156 //SEC_CONST_DECL (kSecReturnPersistentRef, "r_PersistentRef");
157
158 /* Value Type Key Constants */
159 //SEC_CONST_DECL (kSecValueData, "v_Data");
160 //SEC_CONST_DECL (kSecValueRef, "v_Ref");
161 //SEC_CONST_DECL (kSecValuePersistentRef, "v_PersistentRef");
162
163 /* Other Constants */
164 //SEC_CONST_DECL (kSecUseItemList, "u_ItemList");
165 SEC_CONST_DECL (kSecUseKeychain, "u_Keychain");
166 //SEC_CONST_DECL (kSecUseSystemKeychain, "u_SystemKeychain");
167 //SEC_CONST_DECL (kSecUseSyncBubbleKeychain, "u_SyncBubbleKeychain");
168
169 /* kSecAttrAccessible Value Constants. */
170 //SEC_CONST_DECL (kSecAttrAccessibleWhenUnlocked, "ak");
171 //SEC_CONST_DECL (kSecAttrAccessibleAfterFirstUnlock, "ck");
172 //SEC_CONST_DECL (kSecAttrAccessibleAlways, "dk");
173 //SEC_CONST_DECL (kSecAttrAccessibleWhenUnlockedThisDeviceOnly, "aku");
174 //SEC_CONST_DECL (kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly, "cku");
175 //SEC_CONST_DECL (kSecAttrAccessibleAlwaysThisDeviceOnly, "dku");
176 //SEC_CONST_DECL (kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, "akpu");
177 /* kSecAttrAccessible Value Constants (Private). */
178 //SEC_CONST_DECL (kSecAttrAccessibleAlwaysPrivate, "dk");
179 //SEC_CONST_DECL (kSecAttrAccessibleAlwaysThisDeviceOnlyPrivate, "dku");
180
181 /* kSecAttrProtocol Value Constants. */
182 //SEC_CONST_DECL (kSecAttrProtocolFTP, "ftp ");
183 //SEC_CONST_DECL (kSecAttrProtocolFTPAccount, "ftpa");
184 //SEC_CONST_DECL (kSecAttrProtocolHTTP, "http");
185 //SEC_CONST_DECL (kSecAttrProtocolIRC, "irc ");
186 //SEC_CONST_DECL (kSecAttrProtocolNNTP, "nntp");
187 //SEC_CONST_DECL (kSecAttrProtocolPOP3, "pop3");
188 //SEC_CONST_DECL (kSecAttrProtocolSMTP, "smtp");
189 //SEC_CONST_DECL (kSecAttrProtocolSOCKS, "sox ");
190 //SEC_CONST_DECL (kSecAttrProtocolIMAP, "imap");
191 //SEC_CONST_DECL (kSecAttrProtocolLDAP, "ldap");
192 //SEC_CONST_DECL (kSecAttrProtocolAppleTalk, "atlk");
193 //SEC_CONST_DECL (kSecAttrProtocolAFP, "afp ");
194 //SEC_CONST_DECL (kSecAttrProtocolTelnet, "teln");
195 //SEC_CONST_DECL (kSecAttrProtocolSSH, "ssh ");
196 //SEC_CONST_DECL (kSecAttrProtocolFTPS, "ftps");
197 //SEC_CONST_DECL (kSecAttrProtocolHTTPS, "htps");
198 //SEC_CONST_DECL (kSecAttrProtocolHTTPProxy, "htpx");
199 //SEC_CONST_DECL (kSecAttrProtocolHTTPSProxy, "htsx");
200 //SEC_CONST_DECL (kSecAttrProtocolFTPProxy, "ftpx");
201 //SEC_CONST_DECL (kSecAttrProtocolSMB, "smb ");
202 //SEC_CONST_DECL (kSecAttrProtocolRTSP, "rtsp");
203 //SEC_CONST_DECL (kSecAttrProtocolRTSPProxy, "rtsx");
204 //SEC_CONST_DECL (kSecAttrProtocolDAAP, "daap");
205 //SEC_CONST_DECL (kSecAttrProtocolEPPC, "eppc");
206 //SEC_CONST_DECL (kSecAttrProtocolIPP, "ipp ");
207 //SEC_CONST_DECL (kSecAttrProtocolNNTPS, "ntps");
208 //SEC_CONST_DECL (kSecAttrProtocolLDAPS, "ldps");
209 //SEC_CONST_DECL (kSecAttrProtocolTelnetS, "tels");
210 //SEC_CONST_DECL (kSecAttrProtocolIMAPS, "imps");
211 //SEC_CONST_DECL (kSecAttrProtocolIRCS, "ircs");
212 //SEC_CONST_DECL (kSecAttrProtocolPOP3S, "pops");
213
214 /* kSecAttrAuthenticationType Value Constants. */
215 //SEC_CONST_DECL (kSecAttrAuthenticationTypeNTLM, "ntlm");
216 //SEC_CONST_DECL (kSecAttrAuthenticationTypeMSN, "msna");
217 //SEC_CONST_DECL (kSecAttrAuthenticationTypeDPA, "dpaa");
218 //SEC_CONST_DECL (kSecAttrAuthenticationTypeRPA, "rpaa");
219 //SEC_CONST_DECL (kSecAttrAuthenticationTypeHTTPBasic, "http");
220 //SEC_CONST_DECL (kSecAttrAuthenticationTypeHTTPDigest, "httd");
221 //SEC_CONST_DECL (kSecAttrAuthenticationTypeHTMLForm, "form");
222 //SEC_CONST_DECL (kSecAttrAuthenticationTypeDefault, "dflt");
223
224 /* kSecAttrKeyClass Value Constants. Based on <Security/cssmtype.h>
225 CSSM_KEYCLASS_PUBLIC_KEY = 0,
226 CSSM_KEYCLASS_PRIVATE_KEY = 1,
227 CSSM_KEYCLASS_SESSION_KEY = 2,
228 */
229 //SEC_CONST_DECL (kSecAttrKeyClassPublic, "0");
230 //SEC_CONST_DECL (kSecAttrKeyClassPrivate, "1");
231 //SEC_CONST_DECL (kSecAttrKeyClassSymmetric, "2");
232
233 /* kSecAttrKeyType Value Constants. Based on CSSM_ALGORITHMS. */
234 SEC_CONST_DECL (kSecAttrKeyTypeDES, "14");
235 SEC_CONST_DECL (kSecAttrKeyType3DES, "17");
236 SEC_CONST_DECL (kSecAttrKeyTypeRC2, "23");
237 SEC_CONST_DECL (kSecAttrKeyTypeRC4, "25");
238
239 //SEC_CONST_DECL (kSecAttrKeyTypeRSA, "42");
240 SEC_CONST_DECL (kSecAttrKeyTypeDSA, "43");
241 SEC_CONST_DECL (kSecAttrKeyTypeCAST, "56");
242 SEC_CONST_DECL (kSecAttrKeyTypeECDSA, "73"); /**/
243 //SEC_CONST_DECL (kSecAttrKeyTypeEC, "73"); /* rdar://13326326 */
244 //SEC_CONST_DECL (kSecAttrKeyTypeECSECPrimeRandom, "73");
245 SEC_CONST_DECL (kSecAttrKeyTypeAES, "2147483649"); /* <Security/cssmapple.h> */
246 //SEC_CONST_DECL (kSecAttrKeyTypeECSECPrimeRandomPKA, "2147483678"); /* <Security/cssmapple.h> CSSM_ALGID__FIRST_UNUSED */
247 //SEC_CONST_DECL (kSecAttrKeyTypeSecureEnclaveAttestation, "2147483679"); /* <Security/cssmapple.h> CSSM_ALGID__FIRST_UNUSED + 1 */
248
249 SEC_CONST_DECL (kSecAttrPRFHmacAlgSHA1, "hsha1");
250 SEC_CONST_DECL (kSecAttrPRFHmacAlgSHA224, "hsha224");
251 SEC_CONST_DECL (kSecAttrPRFHmacAlgSHA256, "hsha256");
252 SEC_CONST_DECL (kSecAttrPRFHmacAlgSHA384, "hsha384");
253 SEC_CONST_DECL (kSecAttrPRFHmacAlgSHA512, "hsha512");
254
255
256 /* Constants used by SecKeyGeneratePair() - in SecKey.h. Never used in
257 any SecItem apis directly. */
258 //SEC_CONST_DECL (kSecPrivateKeyAttrs, "private");
259 //SEC_CONST_DECL (kSecPublicKeyAttrs, "public");
260 /* Used for SecKeyGenerateSymmetric */
261 SEC_CONST_DECL (kSecSymmetricKeyAttrs, "symmetric");