os/security/cryptoplugins/cryptospiplugins/test/dummyecchwplugin/src/cryptospihai.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/cryptoplugins/cryptospiplugins/test/dummyecchwplugin/src/cryptospihai.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,81 @@
1.4 +/*
1.5 +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +/**
1.23 + @file
1.24 + @internalComponent
1.25 + @released
1.26 + */
1.27 +#ifndef CCRYPTOSPIHAI_H
1.28 +#define CCRYPTOSPIHAI_H
1.29 +
1.30 +#include <e32base.h>
1.31 +#include <e32cmn.h>
1.32 +#include <cryptospi/cryptospidef.h>
1.33 +#include <cryptospi/cryptoparams.h>
1.34 +
1.35 +namespace CryptoSpiHai
1.36 + {
1.37 + /**
1.38 + * This class forms the hardware abstraction interface part of the
1.39 + * cryptoSPI. In the production code, this should be replaced by a
1.40 + * device driver. This layer abstracts the hardware from a cryptoSPI
1.41 + * plugin. It interacts with the HAI of crypto token to get the actual
1.42 + * key and performs the operations. This layer should be implemented in
1.43 + * kernel space.
1.44 + */
1.45 + NONSHARABLE_CLASS(CCryptoSpiHai) : public CBase
1.46 + {
1.47 + public:
1.48 + /**
1.49 + * Performs the signing operation.
1.50 + *
1.51 + * A cryptoSPI plugin uses this, when it does not have access
1.52 + * to the actual key.
1.53 + *
1.54 + * @param aKeyHandle The key handle retrieved from hw crypto
1.55 + * token
1.56 + * @param aInput The text which has to be signed.
1.57 + * @param aSignature Output param. The cryptoSPI signature.
1.58 + *
1.59 + * @leave Can leave with all the leave codes present in HAI of
1.60 + * reference crypto token implementation.
1.61 + */
1.62 + IMPORT_C static void SignL(TInt aKeyHandle,
1.63 + const TDesC8& aInput, CryptoSpi::CCryptoParams& aSignature);
1.64 +
1.65 + /**
1.66 + * Performs the decryption operation.
1.67 + *
1.68 + * A cryptoSPI plugin uses this, when it does not have access
1.69 + * to the actual key.
1.70 + *
1.71 + * @param aKeyHandle The key handle retrieved from hw crypto
1.72 + * token
1.73 + * @param aInput The cipher text.
1.74 + * @param aOutput Output param. The decrypted plain text
1.75 + *
1.76 + * @leave Can leave with all the leave codes present in HAI of
1.77 + * reference crypto token implementation.
1.78 + */
1.79 + IMPORT_C static void DecryptL(TInt aKeyHandle,
1.80 + const TDesC8& aInput, TDes8& aOuput);
1.81 + };
1.82 + }
1.83 +
1.84 +#endif // CCRYPTOSPIHAI_H