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