Update contrib.
2 * Copyright (c) 2006-2009 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 * DSA shim classes definition
29 #include <asymmetric.h>
38 NONSHARABLE_CLASS(CDsaSignerShim) : public CDSASigner
42 Creates an CDsaSignerShim object which has the same interface
43 as CDSASigner but delegates all work to a Crypto SPI plug-in.
45 @param aKey The signing key
46 @return A pointer to a CDsaSignerShim instance
48 static CDsaSignerShim* NewL(const CDSAPrivateKey& aKey);
51 Creates an CDsaSignerShim object which has the same interface
52 as CDSASigner but delegates all work to a Crypto SPI plug-in.
54 A pointer to the new object is placed on the cleanup stack
56 @param aKey The signing key
57 @return A pointer to a CDsaSignerShim instance
59 static CDsaSignerShim* NewLC(const CDSAPrivateKey& aKey);
62 Digitally signs the specified input message
63 Note that in order to be interoperable and compliant with the DSS, aInput
64 must be the result of a SHA-1 hash.
66 @param aInput A SHA-1 hash of the message to sign
67 @return A pointer to a new CSignature object
68 @panic ECryptoPanicInputTooLarge If aInput is larger than MaxInputLength(),
69 which is likely to happen if the caller
70 has passed in something that has not been hashed.
72 virtual CDSASignature* SignL(const TDesC8& aInput) const;
74 //From MSignatureSystem
75 virtual TInt MaxInputLength() const;
82 CDsaSignerShim(const CDSAPrivateKey& aKey);
83 void ConstructL(const CDSAPrivateKey& aKey);
87 CryptoSpi::CSigner* iSignerImpl;
89 /// SPI requires all key to passed as key-objects
90 CryptoSpi::CKey* iKey;
93 NONSHARABLE_CLASS(CDsaVerifierShim) : public CDSAVerifier
97 Creates an CDsaVerifierShim object which has the same interface
98 as CDSAVerifier but delegates all work to a Crypto SPI plug-in.
100 @param aKey The verification key
101 @return A pointer to a CDsaVerifierShim instance
103 static CDsaVerifierShim* NewL(const CDSAPublicKey& aKey);
106 Creates an CDsaVerifierShim object which has the same interface
107 as CDSAVerifier but delegates all work to a Crypto SPI plug-in.
109 A pointer to the new object is placed on the cleanup stack
111 @param aKey The verification key
112 @return A pointer to a CDsaVerifierShim instance
114 static CDsaVerifierShim* NewLC(const CDSAPublicKey& aKey);
117 virtual TBool VerifyL(const TDesC8& aInput, const CDSASignature& aSignature) const;
119 //From MSignatureSystem
120 virtual TInt MaxInputLength() const;
127 CDsaVerifierShim(const CDSAPublicKey& aKey);
128 void ConstructL(const CDSAPublicKey& aKey);
132 CryptoSpi::CVerifier* iVerifierImpl;
134 /// SPI requires all key to passed as key-objects
135 CryptoSpi::CKey* iKey;
138 #endif // __DSASHIM_H__