]>
Commit | Line | Data |
---|---|---|
b1ab9ed8 A |
1 | /* |
2 | * Copyright (c) 2003-2004 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 | #ifndef _SECURITY_SECKEYCHAINPRIV_H_ | |
25 | #define _SECURITY_SECKEYCHAINPRIV_H_ | |
26 | ||
27 | #include <Security/Security.h> | |
28 | #include <Security/SecBasePriv.h> | |
29 | #include <CoreFoundation/CoreFoundation.h> | |
30 | ||
31 | #if defined(__cplusplus) | |
32 | extern "C" { | |
33 | #endif | |
34 | ||
35 | enum {kSecKeychainEnteredBatchModeEvent = 14, | |
36 | kSecKeychainLeftBatchModeEvent = 15}; | |
37 | enum {kSecKeychainEnteredBatchModeEventMask = 1 << kSecKeychainEnteredBatchModeEvent, | |
38 | kSecKeychainLeftBatchModeEventMask = 1 << kSecKeychainLeftBatchModeEvent}; | |
39 | ||
40 | ||
41 | /* Keychain management */ | |
42 | OSStatus SecKeychainCreateNew(SecKeychainRef keychainRef, UInt32 passwordLength, const char* inPassword); | |
43 | OSStatus SecKeychainMakeFromFullPath(const char *fullPathName, SecKeychainRef *keychainRef); | |
44 | OSStatus SecKeychainIsValid(SecKeychainRef keychainRef, Boolean* isValid); | |
45 | OSStatus SecKeychainChangePassword(SecKeychainRef keychainRef, UInt32 oldPasswordLength, const void *oldPassword, UInt32 newPasswordLength, const void *newPassword); | |
46 | OSStatus SecKeychainOpenWithGuid(const CSSM_GUID *guid, uint32 subserviceId, uint32 subserviceType, const char* dbName, const CSSM_NET_ADDRESS *dbLocation, SecKeychainRef *keychain); | |
47 | OSStatus SecKeychainSetBatchMode (SecKeychainRef kcRef, Boolean mode, Boolean rollback); | |
48 | ||
49 | /* Keychain list management */ | |
50 | UInt16 SecKeychainListGetCount(void); | |
51 | OSStatus SecKeychainListCopyKeychainAtIndex(UInt16 index, SecKeychainRef *keychainRef); | |
52 | OSStatus SecKeychainListRemoveKeychain(SecKeychainRef *keychainRef); | |
53 | OSStatus SecKeychainRemoveFromSearchList(SecKeychainRef keychainRef); | |
54 | ||
55 | /* Login keychain support */ | |
56 | OSStatus SecKeychainLogin(UInt32 nameLength, const void* name, UInt32 passwordLength, const void* password); | |
427c49bc | 57 | OSStatus SecKeychainStash(); |
b1ab9ed8 A |
58 | OSStatus SecKeychainLogout(); |
59 | OSStatus SecKeychainCopyLogin(SecKeychainRef *keychainRef); | |
60 | OSStatus SecKeychainResetLogin(UInt32 passwordLength, const void* password, Boolean resetSearchList); | |
61 | ||
427c49bc A |
62 | OSStatus SecKeychainVerifyKeyStorePassphrase(uint32_t retries); |
63 | OSStatus SecKeychainChangeKeyStorePassphrase(); | |
64 | ||
b1ab9ed8 A |
65 | /* Keychain synchronization */ |
66 | enum { | |
67 | kSecKeychainNotSynchronized = 0, | |
68 | kSecKeychainSynchronizedWithDotMac = 1 | |
69 | }; | |
70 | typedef UInt32 SecKeychainSyncState; | |
71 | ||
72 | OSStatus SecKeychainCopySignature(SecKeychainRef keychainRef, CFDataRef *keychainSignature); | |
73 | OSStatus SecKeychainCopyBlob(SecKeychainRef keychainRef, CFDataRef *dbBlob); | |
74 | OSStatus SecKeychainRecodeKeychain(SecKeychainRef keychainRef, CFArrayRef dbBlobArray, CFDataRef extraData); | |
75 | OSStatus SecKeychainCreateWithBlob(const char* fullPathName, CFDataRef dbBlob, SecKeychainRef *kcRef); | |
76 | ||
77 | /* Keychain list manipulation */ | |
78 | OSStatus SecKeychainAddDBToKeychainList (SecPreferencesDomain domain, const char* dbName, const CSSM_GUID *guid, uint32 subServiceType); | |
79 | OSStatus SecKeychainDBIsInKeychainList (SecPreferencesDomain domain, const char* dbName, const CSSM_GUID *guid, uint32 subServiceType); | |
80 | OSStatus SecKeychainRemoveDBFromKeychainList (SecPreferencesDomain domain, const char* dbName, const CSSM_GUID *guid, uint32 subServiceType); | |
81 | ||
82 | /* server operation (keychain inhibit) */ | |
83 | void SecKeychainSetServerMode(); | |
84 | ||
85 | /* special calls */ | |
86 | OSStatus SecKeychainCleanupHandles(); | |
87 | OSStatus SecKeychainSystemKeychainCheckWouldDeadlock(); | |
88 | ||
89 | #if defined(__cplusplus) | |
90 | } | |
91 | #endif | |
92 | ||
93 | #endif /* !_SECURITY_SECKEYCHAINPRIV_H_ */ |