Update contrib.
2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Signer Abstract interface
26 #ifndef __CRYPTOAPI_SIGNER_H__
27 #define __CRYPTOAPI_SIGNER_H__
29 #include <cryptospi/cryptoplugin.h>
30 #include <cryptospi/keys.h>
35 The Signer definition. Intended to allow plug-ins to implement
36 extensible signature signer functionality, and to work with all
37 known existing signature algorithms, e.g. DSA, RSA etc
39 class MSignatureBase : public MPlugin
43 Set the padding mode for the signer or verifier. Reset() is called to reinitialise the cipher.
44 @param aPaddingMode The padding mode of the signer
45 @leave KErrNotSupported if the padding mode is not supported.
46 @leave ... Any of the crypto error codes defined in
47 cryptospi_errs.h or any of the system-wide error codes.
49 virtual void SetPaddingModeL(TUid aPaddingMode) = 0;
52 Set the private key for the signer or verifier. Reset() is called to reinitialise the cipher.
53 @param aPrivateKey The privatekey that used to sign
54 @leave KErrArgument if key is not of the expected type.
55 @leave KErrNotSupported if the key is not of valid length.
56 @leave ... Any of the crypto error codes defined in
57 cryptospi_errs.h or any of the system-wide error codes.
59 virtual void SetKeyL(const CKey& aPrivateKey) = 0;
62 Gets the maximum size of input accepted by this object.
63 @return The maximum length allowed in bytes
64 @leave ... Any of the crypto error codes defined in
65 cryptospi_errs.h or any of the system-wide error codes.
67 virtual TInt GetMaximumInputLengthL() const = 0;
70 Gets the maximum size of output that can be generated by this object.
71 @return The maximum output length in bytes
72 @leave ... Any of the crypto error codes defined in
73 cryptospi_errs.h or any of the system-wide error codes.
75 virtual TInt GetMaximumOutputLengthL() const = 0;
78 class MSigner : public MSignatureBase
84 @param aInput The hash of the message to sign
85 @param aSignature The signature of the hash
86 @leave ... Any of the crypto error codes defined in
87 cryptospi_errs.h or any of the system-wide error codes.
89 virtual void SignL(const TDesC8& aInput, CCryptoParams& aSignature) = 0;
93 class MAsyncSigner : public MSignatureBase
98 Set the public key for the signer
99 @param aInput The hash of the message to sign
100 @param aSignature The signature of the hash
101 @param aRequestStatus
102 @leave ... Any of the crypto error codes defined in
103 cryptospi_errs.h or any of the system-wide error codes.
105 virtual void SignL(const TDesC8& aInput, CCryptoParams& aSignature, TRequestStatus& aRequestStatus) = 0;
108 Cancel the outstanding request
110 virtual void Cancel() = 0;
114 } // namespace CryptoSpi
116 #endif //__CRYPTOAPI_SIGNER_H__