]>
git.saurik.com Git - apple/security.git/blob - Keychain/DefaultKeychain.h
2 * Copyright (c) 2000-2001 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 File: DefaultKeychain.h
22 Contains: User preference for default keychain
24 Written by: John Hurley
26 Copyright: 2000 by Apple Computer, Inc., all rights reserved.
31 #ifndef _H_KEYCHAINCORE_DEFAULTKEYCHAIN__
32 #define _H_KEYCHAINCORE_DEFAULTKEYCHAIN__
34 #include <Security/DLDBListCFPref.h>
35 #include <Security/Keychains.h>
40 namespace KeychainCore
43 //---------------------------------------------------------------------------------
46 // Note that this is strictly a user preference setting, indicating which keychain
47 // should be used to add items to. No validity checking should be done on it in
48 // this class, since it may not be available right now (e.g. on a network volume)
49 //----------------------------------------------------------------------------------
58 // Set/Get via DLDbIdentifier
59 void dLDbIdentifier(const DLDbIdentifier
& keychainID
);
60 DefaultKeychain
&operator =(const DLDbIdentifier
& keychainID
)
61 { dLDbIdentifier(keychainID
); return *this; }
63 void reload(bool force
= false);
64 DLDbIdentifier
dLDbIdentifier();
65 operator DLDbIdentifier () { return dLDbIdentifier(); }
67 // Remove if passed in DLDbIdentifier is currently the default
68 void remove(const DLDbIdentifier
& keychainID
);
70 // Set/Get via Keychain
71 void keychain(const Keychain
& keychain
);
72 DefaultKeychain
&operator =(const Keychain
& inKeychain
) { keychain(inKeychain
); return *this; }
75 operator Keychain () { return keychain(); }
77 void unset(); // Who needs a default keychain anyway.
81 DLDbIdentifier defaultID
;
84 }; // end namespace KeychainCore
86 } // end namespace Security
88 #endif /* _H_KEYCHAINCORE_DEFAULTKEYCHAIN__ */