]>
git.saurik.com Git - apple/security.git/blob - Keychain/DefaultKeychain.h
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.
19 // DefaultKeychain.h - Default Keychain singleton
21 #ifndef _SECURITY_DEFAULTKEYCHAIN_H_
22 #define _SECURITY_DEFAULTKEYCHAIN_H_
24 #include <Security/DLDBListCFPref.h>
25 #include <Security/Keychains.h>
30 namespace KeychainCore
33 //---------------------------------------------------------------------------------
36 // Note that this is strictly a user preference setting, indicating which keychain
37 // should be used to add items to. No validity checking should be done on it in
38 // this class, since it may not be available right now (e.g. on a network volume)
39 //----------------------------------------------------------------------------------
48 // Set/Get via DLDbIdentifier
49 void dLDbIdentifier(const DLDbIdentifier
& keychainID
);
50 DefaultKeychain
&operator =(const DLDbIdentifier
& keychainID
)
51 { dLDbIdentifier(keychainID
); return *this; }
53 void reload(bool force
= false);
54 DLDbIdentifier
dLDbIdentifier();
55 operator DLDbIdentifier () { return dLDbIdentifier(); }
57 // Remove if passed in DLDbIdentifier is currently the default
58 void remove(const DLDbIdentifier
& keychainID
);
60 // Set/Get via Keychain
61 void keychain(const Keychain
& keychain
);
62 DefaultKeychain
&operator =(const Keychain
& inKeychain
) { keychain(inKeychain
); return *this; }
65 operator Keychain () { return keychain(); }
67 void unset(); // Who needs a default keychain anyway.
71 DLDbIdentifier defaultID
;
74 } // end namespace KeychainCore
76 } // end namespace Security
78 #endif // !_SECURITY_DEFAULTKEYCHAIN_H_