Update contrib.
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * crypto keys definition - including symmetric & asymmetric keys
26 #ifndef __CRYPTOAPI_KEYS_H__
27 #define __CRYPTOAPI_KEYS_H__
30 #include <cryptospi/cryptoparams.h>
36 The key property definition.
42 Algorithm UID of this Key
47 Implementation ID of the key generator
49 TUid iImplementationUid;
66 NONSHARABLE_CLASS(CKey) : public CBase
71 Creates a new key from a key property and key parameters.
72 @param aKeyProperty The key property for the new key
73 @param aKeyParameters The list of the key parameters
74 @return A pointer to a CKey instance
76 IMPORT_C static CKey* NewL(const TKeyProperty& aKeyProperty, const CCryptoParams& aKeyParameters);
79 Creates a new key from a key property and key parameters.
80 Leave the Ckey pointer on the cleanup stack.
81 @param aKeyProperty The key property for the new key
82 @param aKeyParameters The list of the key parameters
83 @return A pointer to a CKey instance
85 IMPORT_C static CKey* NewLC(const TKeyProperty& aKeyProperty, const CCryptoParams& aKeyParameters);
88 Creates a new key from a CKey object.
89 @param aKey the source CKey object.
90 @return A pointer to a CKey instance
92 IMPORT_C static CKey* NewL(const CKey& aKey);
95 Creates a new key from a CKey object.
96 Leave the Ckey pointer on the cleanup stack.
97 @param aKey the source CKey object.
98 @return A pointer to a CKey instance
100 IMPORT_C static CKey* NewLC(const CKey& aKey);
108 Retrieve the key property
109 @return The reference of the key property
111 IMPORT_C const TKeyProperty& KeyProperty() const;
114 Retrieve the Key Parameter according to the UID of the parameter
115 @param aUid The UID of the key parameter
117 IMPORT_C const TInteger& GetBigIntL(TUid aUid) const;
118 IMPORT_C TInt GetTIntL(TUid aUid) const;
119 IMPORT_C const TDesC8& GetTDesC8L(TUid aUid) const;
121 IMPORT_C TBool IsPresent(TUid aUid) const;
124 Retrieve the key property and key parameter
125 @param aKeyProperty The key property
126 @return The key parameters
128 IMPORT_C const CCryptoParams& KeyParameters() const;
134 CKey(const TKeyProperty& aKeyProperty);
137 2nd Phase Constructor
139 void ConstructL(const CCryptoParams& aKeyParameters);
143 The Key Parameters of this object
145 CCryptoParams* iKeyParameters;
150 TKeyProperty iKeyProperty;
153 } // namespace CryptoSpi
155 #endif //__CRYPTOAPI_KEYS_H__