sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
/**
|
sl@0
|
20 |
@file
|
sl@0
|
21 |
@internalComponent
|
sl@0
|
22 |
@released
|
sl@0
|
23 |
*/
|
sl@0
|
24 |
#ifndef CDUMMYECCSIGNERIMPL_H
|
sl@0
|
25 |
#define CDUMMYECCSIGNERIMPL_H
|
sl@0
|
26 |
#include <e32base.h>
|
sl@0
|
27 |
#include <e32cmn.h>
|
sl@0
|
28 |
#include "keys.h"
|
sl@0
|
29 |
#include "signerplugin.h"
|
sl@0
|
30 |
|
sl@0
|
31 |
namespace DummyEccHwCrypto
|
sl@0
|
32 |
{
|
sl@0
|
33 |
using namespace CryptoSpi;
|
sl@0
|
34 |
|
sl@0
|
35 |
/**
|
sl@0
|
36 |
* Implements the MSigner interface.
|
sl@0
|
37 |
*
|
sl@0
|
38 |
* This should be used to create the signer object to perform
|
sl@0
|
39 |
* signing using ECC.
|
sl@0
|
40 |
*/
|
sl@0
|
41 |
NONSHARABLE_CLASS(CDummyECCSignerImpl) : public CBase, public MSigner
|
sl@0
|
42 |
{
|
sl@0
|
43 |
public:
|
sl@0
|
44 |
static CDummyECCSignerImpl* NewL(const CryptoSpi::CKey& aKey,
|
sl@0
|
45 |
TUid aPaddingMode);
|
sl@0
|
46 |
static CDummyECCSignerImpl* NewLC(const CryptoSpi::CKey& aKey,
|
sl@0
|
47 |
TUid aPaddingMode);
|
sl@0
|
48 |
|
sl@0
|
49 |
// MPlugin Interface
|
sl@0
|
50 |
void Close();
|
sl@0
|
51 |
void Reset();
|
sl@0
|
52 |
void GetCharacteristicsL(const TCharacteristics*& aPluginCharacteristics);
|
sl@0
|
53 |
const CExtendedCharacteristics* GetExtendedCharacteristicsL();
|
sl@0
|
54 |
TAny* GetExtension(TUid aExtensionId);
|
sl@0
|
55 |
// End of MPlugin Interface
|
sl@0
|
56 |
|
sl@0
|
57 |
// MSignatureBase inteface
|
sl@0
|
58 |
void SetPaddingModeL(TUid aPaddingMode);
|
sl@0
|
59 |
void SetKeyL(const CKey& aPrivateKey);
|
sl@0
|
60 |
TInt GetMaximumInputLengthL() const;
|
sl@0
|
61 |
TInt GetMaximumOutputLengthL() const;
|
sl@0
|
62 |
// End of MSignatureBase inteface
|
sl@0
|
63 |
|
sl@0
|
64 |
// MSigner interface
|
sl@0
|
65 |
void SignL(const TDesC8& aInput, CCryptoParams& aSignature);
|
sl@0
|
66 |
|
sl@0
|
67 |
TUid ImplementationUid() const;
|
sl@0
|
68 |
/// Destructor
|
sl@0
|
69 |
~CDummyECCSignerImpl();
|
sl@0
|
70 |
|
sl@0
|
71 |
private:
|
sl@0
|
72 |
CDummyECCSignerImpl(TUid aPaddingMode);
|
sl@0
|
73 |
void ConstructL(const CryptoSpi::CKey& aKey);
|
sl@0
|
74 |
|
sl@0
|
75 |
private:
|
sl@0
|
76 |
/* The key extracted from a CKey object. This would just have
|
sl@0
|
77 |
* a handle to the key stored in hardware. Hence the actual key
|
sl@0
|
78 |
* would not be available to the user of this cryptoSPI plugin.
|
sl@0
|
79 |
*/
|
sl@0
|
80 |
CKey* iKey;
|
sl@0
|
81 |
TUid iPaddingMode;
|
sl@0
|
82 |
};
|
sl@0
|
83 |
}
|
sl@0
|
84 |
|
sl@0
|
85 |
#endif //CDUMMYECCSIGNERIMPL_H
|