2 * Copyright (c) 2000-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.
20 * SecKeychainAPIPriv.h
22 #ifndef _SECURITY_KEYCHAINAPIPRIV_H_
23 #define _SECURITY_KEYCHAINAPIPRIV_H_
25 #include <Security/SecBase.h>
27 #if defined(__cplusplus)
31 /* Private keychain item attributes */
34 kSecClassItemAttr
= 'clas', /* Item class (KCItemClass) */
35 kSecAliasItemAttr
= 'alis', /* Alias attribute (required by CDSA). */
36 kSecProtectedDataItemAttr
= 'prot', /* Item's data is protected (encrypted) (Boolean) */
39 /* Temporary: CRL attributes */
42 kSecCrlTypeItemAttr
= 'crtp',
43 kSecCrlEncodingItemAttr
= 'cren',
44 kSecThisUpdateItemAttr
= 'crtu',
45 kSecNextUpdateItemAttr
= 'crnu',
46 kSecUriItemAttr
= 'curi', // URI from which it came
47 kSecCrlNumberItemAttr
= 'crnm',
48 kSecDeltaCrlNumberItemAttr
= 'dlcr'
52 Note: the comments that appear after these errors are used to create SecErrorMessages.strings.
53 The comments must not be multi-line, and should be in a form meaningful to an end user. If
54 a different or additional comment is needed, it can be put in the header doc format, or on a
55 line that does not start with errZZZ.
58 /* Definitions for miscellaneous OS errors that can be returned (with appropriate error strings) */
61 errSecMisc_dskFulErr
= -34, /* The disk is full. */
62 errSecMisc_nsvErr
= -35, /* The disk couldn't be found. It may have been ejected. */
63 errSecMisc_bdNamErr
= -37, /* Tried to open a file whose name contains an illegal character. */
64 errSecMisc_fnfErr
= -43, /* The file could not be found. */
65 errSecMisc_wPrErr
= -44, /* The disk is write-protected. */
66 errSecMisc_fLckdErr
= -45, /* The file is locked. */
67 errSecMisc_vLckdErr
= -46, /* The volume is locked. */
68 errSecMisc_fBsyErr
= -47, /* The file is busy. It may be in use by another application. */
69 errSecMisc_dupFNErr
= -48, /* A file with the same name already exists. */
70 errSecMisc_opWrErr
= -49, /* The file is already open with write permission. */
71 errSecMisc_volOffLinErr
= -53, /* The volume is no longer available. It may have been ejected. */
72 errSecMisc_permErr
= -54, /* The file could not be opened. It may be in use by another application. */
73 errSecMisc_extFSErr
= -58, /* This volume does not appear to be compatible. */
74 errSecMisc_wrPermErr
= -61, /* Could not write to the file. It may have been opened with insufficient access privileges. */
75 errSecMisc_offLinErr
= -65, /* The storage device is no longer available. It may have been ejected. */
76 errSecMisc_memFullErr
= -108, /* There was not enough memory to perform the operation. */
77 errSecMisc_dirNFErr
= -120, /* The directory could not be found. */
78 errSecMisc_volGoneErr
= -124, /* The server volume is no longer available. It may have been disconnected. */
79 errSecMisc_resNotFound
= -192, /* A required resource could not be found. */
80 errSecMisc_resFNotFound
= -193, /* A required resource is missing or damaged. */
81 errSecMisc_icNoURLErr
= -673, /* The specified location (URL) is an unknown type, or does not contain enough information. */
82 errSecMisc_icConfigNotFoundErr
= -674, /* A helper application to open the specified URL could not be found. */
83 errSecMisc_cantGetFlavorErr
= -1854, /* The location (URL) of this item is missing or improperly formatted. */
84 errSecMisc_afpAccessDenied
= -5000, /* Access to this item was denied. */
85 errSecMisc_afpUserNotAuth
= -5023, /* Authentication failed. The password for this server may have changed since the item was added to the keychain. */
86 errSecMisc_afpPwdPolicyErr
= -5046 /* This AppleShare IP server is configured to not allow users to save passwords for automatic login. Contact the server administrator for more information. */
90 SecKeychainListGetCount(void);
93 SecKeychainListCopyKeychainAtIndex(UInt16 index
, SecKeychainRef
*keychainRef
);
96 SecKeychainListRemoveKeychain(SecKeychainRef
*keychainRef
);
98 OSStatus
SecKeychainChangePassword(SecKeychainRef keychainRef
, UInt32 oldPasswordLength
, const void *oldPassword
, UInt32 newPasswordLength
, const void *newPassword
);
100 OSStatus
SecKeychainCopyLogin(SecKeychainRef
*keychainRef
);
102 OSStatus
SecKeychainLogin(UInt32 nameLength
, void* name
, UInt32 passwordLength
, void* password
);
104 OSStatus
SecKeychainLogout();
106 OSStatus
SecKeychainResetLogin(UInt32 passwordLength
, const void* password
, Boolean resetSearchList
);
108 CFStringRef
SecCopyErrorMessageString(OSStatus status
, void *reserved
);
110 #if defined(__cplusplus)
114 #endif /* !_SECURITY_KEYCHAINAPIPRIV_H_ */