sl@0: /* sl@0: * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalComponent sl@0: @released sl@0: */ sl@0: #ifndef CCRYPTOSPIHAI_H sl@0: #define CCRYPTOSPIHAI_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: namespace CryptoSpiHai sl@0: { sl@0: /** sl@0: * This class forms the hardware abstraction interface part of the sl@0: * cryptoSPI. In the production code, this should be replaced by a sl@0: * device driver. This layer abstracts the hardware from a cryptoSPI sl@0: * plugin. It interacts with the HAI of crypto token to get the actual sl@0: * key and performs the operations. This layer should be implemented in sl@0: * kernel space. sl@0: */ sl@0: NONSHARABLE_CLASS(CCryptoSpiHai) : public CBase sl@0: { sl@0: public: sl@0: /** sl@0: * Performs the signing operation. sl@0: * sl@0: * A cryptoSPI plugin uses this, when it does not have access sl@0: * to the actual key. sl@0: * sl@0: * @param aKeyHandle The key handle retrieved from hw crypto sl@0: * token sl@0: * @param aInput The text which has to be signed. sl@0: * @param aSignature Output param. The cryptoSPI signature. sl@0: * sl@0: * @leave Can leave with all the leave codes present in HAI of sl@0: * reference crypto token implementation. sl@0: */ sl@0: IMPORT_C static void SignL(TInt aKeyHandle, sl@0: const TDesC8& aInput, CryptoSpi::CCryptoParams& aSignature); sl@0: sl@0: /** sl@0: * Performs the decryption operation. sl@0: * sl@0: * A cryptoSPI plugin uses this, when it does not have access sl@0: * to the actual key. sl@0: * sl@0: * @param aKeyHandle The key handle retrieved from hw crypto sl@0: * token sl@0: * @param aInput The cipher text. sl@0: * @param aOutput Output param. The decrypted plain text sl@0: * sl@0: * @leave Can leave with all the leave codes present in HAI of sl@0: * reference crypto token implementation. sl@0: */ sl@0: IMPORT_C static void DecryptL(TInt aKeyHandle, sl@0: const TDesC8& aInput, TDes8& aOuput); sl@0: }; sl@0: } sl@0: sl@0: #endif // CCRYPTOSPIHAI_H