]> git.saurik.com Git - apple/security.git/blob - Keychain/KeyItem.h
Security-54.1.tar.gz
[apple/security.git] / Keychain / KeyItem.h
1 /*
2 * Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
3 *
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
8 * using this file.
9 *
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.
16 */
17
18 //
19 // KeyItem.h
20 //
21 #ifndef _SECURITY_KEYITEM_H_
22 #define _SECURITY_KEYITEM_H_
23
24 #include <Security/Item.h>
25
26 namespace Security
27 {
28
29 namespace KeychainCore
30 {
31
32 class KeyItem : public ItemImpl
33 {
34 NOCOPY(KeyItem)
35 public:
36 // db item contstructor
37 KeyItem(const Keychain &keychain, const PrimaryKey &primaryKey, const CssmClient::DbUniqueRecord &uniqueId);
38
39 // PrimaryKey item contstructor
40 KeyItem(const Keychain &keychain, const PrimaryKey &primaryKey);
41
42 KeyItem(KeyItem &keyItem);
43
44 virtual ~KeyItem();
45
46 virtual void update();
47 virtual Item copyTo(const Keychain &keychain);
48 virtual void didModify();
49
50 CssmClient::SSDbUniqueRecord ssDbUniqueRecord();
51 const CssmKey &cssmKey();
52
53 protected:
54 virtual PrimaryKey add(Keychain &keychain);
55 private:
56 CssmKey *mKey;
57 };
58
59 } // end namespace KeychainCore
60
61 } // end namespace Security
62
63 #endif // !_SECURITY_KEYITEM_H_