|
1 /* |
|
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __DSAVERIFYIMPL_H__ |
|
20 #define __DSAVERIFYIMPL_H__ |
|
21 |
|
22 /** |
|
23 @file |
|
24 @internalComponent |
|
25 @released |
|
26 */ |
|
27 |
|
28 #include <e32base.h> |
|
29 #include <e32cmn.h> |
|
30 #include <cryptospi/cryptospidef.h> |
|
31 |
|
32 #include "verifierimpl.h" |
|
33 #include "common/inlines.h" |
|
34 |
|
35 /** |
|
36 * Implementation of DSA verification |
|
37 */ |
|
38 namespace SoftwareCrypto |
|
39 { |
|
40 using namespace CryptoSpi; |
|
41 |
|
42 NONSHARABLE_CLASS(CDSAVerifierImpl) : public CVerifierImpl |
|
43 { |
|
44 public: |
|
45 /** |
|
46 Creates an instance of a DSA verifier plug-in. |
|
47 @param aKey The key |
|
48 @return A pointer to a CDSAVerifierImpl instance |
|
49 */ |
|
50 static CDSAVerifierImpl* NewL(const CKey& aKey); |
|
51 |
|
52 /** |
|
53 Creates an instance of a DSA verifier plug-in. |
|
54 @param aKey The key |
|
55 @return A pointer to a CDSAVerifierImpl instance |
|
56 */ |
|
57 static CDSAVerifierImpl* NewLC(const CKey& aKey); |
|
58 |
|
59 // Override CVerifierImpl virtual functions |
|
60 TUid ImplementationUid() const; |
|
61 // End of CVerifierImpl |
|
62 |
|
63 // Override MSignatureBase virtual functions |
|
64 void SetKeyL(const CKey& aPublicKey); |
|
65 virtual TInt GetMaximumInputLengthL() const; |
|
66 |
|
67 // End of MSignatureBase |
|
68 |
|
69 // Override MSigner virtual functions |
|
70 void VerifyL(const TDesC8& aInput, const CCryptoParams& aSignature, TBool& aVerificationResult); |
|
71 void InverseSignL(HBufC8*& aOutput, const CCryptoParams& aSignature); |
|
72 // End of MSigner |
|
73 |
|
74 const CExtendedCharacteristics* GetExtendedCharacteristicsL(); |
|
75 static CExtendedCharacteristics* CreateExtendedCharacteristicsL(); |
|
76 |
|
77 /// Destructor |
|
78 ~CDSAVerifierImpl(); |
|
79 |
|
80 protected: |
|
81 /// Constructor |
|
82 CDSAVerifierImpl(); |
|
83 |
|
84 /// second phase of construction |
|
85 virtual void ConstructL(const CKey& aKey); |
|
86 |
|
87 private: |
|
88 static const TUint KSha1HashLength = 20; |
|
89 }; |
|
90 } |
|
91 |
|
92 #endif // __DSAVERIFYIMPL_H__ |