|
1 /* |
|
2 * Copyright (c) 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 @file |
|
21 @internalComponent |
|
22 @released |
|
23 */ |
|
24 #ifndef CCRYPTOSPIHAI_H |
|
25 #define CCRYPTOSPIHAI_H |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <e32cmn.h> |
|
29 #include <cryptospi/cryptospidef.h> |
|
30 #include <cryptospi/cryptoparams.h> |
|
31 |
|
32 namespace CryptoSpiHai |
|
33 { |
|
34 /** |
|
35 * This class forms the hardware abstraction interface part of the |
|
36 * cryptoSPI. In the production code, this should be replaced by a |
|
37 * device driver. This layer abstracts the hardware from a cryptoSPI |
|
38 * plugin. It interacts with the HAI of crypto token to get the actual |
|
39 * key and performs the operations. This layer should be implemented in |
|
40 * kernel space. |
|
41 */ |
|
42 NONSHARABLE_CLASS(CCryptoSpiHai) : public CBase |
|
43 { |
|
44 public: |
|
45 /** |
|
46 * Performs the signing operation. |
|
47 * |
|
48 * A cryptoSPI plugin uses this, when it does not have access |
|
49 * to the actual key. |
|
50 * |
|
51 * @param aKeyHandle The key handle retrieved from hw crypto |
|
52 * token |
|
53 * @param aInput The text which has to be signed. |
|
54 * @param aSignature Output param. The cryptoSPI signature. |
|
55 * |
|
56 * @leave Can leave with all the leave codes present in HAI of |
|
57 * reference crypto token implementation. |
|
58 */ |
|
59 IMPORT_C static void SignL(TInt aKeyHandle, |
|
60 const TDesC8& aInput, CryptoSpi::CCryptoParams& aSignature); |
|
61 |
|
62 /** |
|
63 * Performs the decryption operation. |
|
64 * |
|
65 * A cryptoSPI plugin uses this, when it does not have access |
|
66 * to the actual key. |
|
67 * |
|
68 * @param aKeyHandle The key handle retrieved from hw crypto |
|
69 * token |
|
70 * @param aInput The cipher text. |
|
71 * @param aOutput Output param. The decrypted plain text |
|
72 * |
|
73 * @leave Can leave with all the leave codes present in HAI of |
|
74 * reference crypto token implementation. |
|
75 */ |
|
76 IMPORT_C static void DecryptL(TInt aKeyHandle, |
|
77 const TDesC8& aInput, TDes8& aOuput); |
|
78 }; |
|
79 } |
|
80 |
|
81 #endif // CCRYPTOSPIHAI_H |