|
1 /* |
|
2 * Copyright (c) 2005-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 |
|
20 |
|
21 |
|
22 |
|
23 /** |
|
24 @file |
|
25 */ |
|
26 |
|
27 #ifndef __TSIGNATUREINPUT_H__ |
|
28 #define __TSIGNATUREINPUT_H__ |
|
29 |
|
30 #include <e32base.h> |
|
31 #include <hash.h> |
|
32 /** An abstract class capable of representing a message to be signed or |
|
33 * verified. |
|
34 * @publishedPartner |
|
35 * @released |
|
36 */ |
|
37 class CSignatureInput : public CBase |
|
38 { |
|
39 public: |
|
40 virtual void Update(const TDesC8& aInput) = 0; |
|
41 virtual TPtrC8 Final(void) = 0; |
|
42 protected: |
|
43 CSignatureInput(void) {} |
|
44 private: |
|
45 CSignatureInput(const CSignatureInput&); |
|
46 CSignatureInput& operator=(const CSignatureInput&); |
|
47 }; |
|
48 |
|
49 /** |
|
50 * @publishedPartner |
|
51 * @released |
|
52 */ |
|
53 class CHashingSignatureInput : public CSignatureInput |
|
54 { |
|
55 public: |
|
56 static CHashingSignatureInput* NewL(CMessageDigest::THashId aHashId); |
|
57 static CHashingSignatureInput* NewLC(CMessageDigest::THashId aHashId); |
|
58 virtual void Update(const TDesC8& aInput); |
|
59 virtual TPtrC8 Final(void); |
|
60 ~CHashingSignatureInput(void); |
|
61 protected: |
|
62 CHashingSignatureInput(void); |
|
63 void ConstructL(CMessageDigest::THashId aHashId); |
|
64 private: |
|
65 CMessageDigest* iHash; |
|
66 private: |
|
67 CHashingSignatureInput(const CHashingSignatureInput&); |
|
68 CHashingSignatureInput& operator=(const CHashingSignatureInput&); |
|
69 }; |
|
70 |
|
71 #endif |