os/security/cryptoplugins/cryptospiplugins/source/softwarecrypto/dsakeypairgenimpl.h
First public contribution.
2 * Copyright (c) 2007-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.
19 #ifndef __DSAKEYPAIRGENIMPL_H__
20 #define __DSAKEYPAIRGENIMPL_H__
30 #include "keypairgenimpl.h"
31 //#include <asymmetrickeys.h>
34 * Implementation of DSA key pair generation.
36 namespace SoftwareCrypto
38 NONSHARABLE_CLASS(CDSAPrimeCertificate) : public CBase
42 Creates a new DSA prime certificate from a specified
43 seed and counter value.
45 @param aSeed The seed from a DSA key generation process
46 @param aCounter The counter value from a DSA key generation process
47 @return A pointer to a CDSAPrimeCertificate instance
49 static CDSAPrimeCertificate* NewL(const TDesC8& aSeed, TUint aCounter);
52 Creates a new DSA prime certificate from a specified
53 seed and counter value.
55 The returned pointer is put onto the cleanup stack.
57 @param aSeed The seed from a DSA key generation process
58 @param aCounter The counter value from a DSA key generation process
59 @return A pointer to a CDSAPrimeCertificate instance
61 static CDSAPrimeCertificate* NewLC(const TDesC8& aSeed, TUint aCounter);
64 Gets the seed of the DSA prime certificate
67 const TDesC8& Seed() const;
70 Gets the counter value of the DSA prime certificate
72 @return The counter's value
74 TUint Counter() const;
79 ~CDSAPrimeCertificate();
84 @param aCounter The DSA key generation counter
86 CDSAPrimeCertificate(TUint aCounter);
91 CDSAPrimeCertificate();
93 void ConstructL(const TDesC8& aSeed);
97 The DSA key generation seed
101 The DSA key generation counter
105 CDSAPrimeCertificate(const CDSAPrimeCertificate&);
106 CDSAPrimeCertificate& operator=(const CDSAPrimeCertificate&);
109 NONSHARABLE_CLASS(CDSAKeyPairGenImpl) : public CKeyPairGenImpl
113 static CDSAKeyPairGenImpl* NewL();
114 static CDSAKeyPairGenImpl* NewLC();
119 // from MKeyPairGenerator
120 void GenerateKeyPairL(TInt aKeySize, const CCryptoParams& aKeyParameters, CKeyPair*& aKeyPair);
122 // Override CKeyPairGenImpl virtual functions
123 TUid ImplementationUid() const;
125 const CExtendedCharacteristics* GetExtendedCharacteristicsL();
126 static CExtendedCharacteristics* CreateExtendedCharacteristicsL();
129 ~CDSAKeyPairGenImpl();
131 static TBool GeneratePrimesL(const TDesC8& aSeed,
136 TBool aUseInputCounter=EFalse);
138 static TBool ValidPrimeLength(TUint aPrimeBits);
144 CDSAKeyPairGenImpl();
146 /// second phase of construction
149 CDSAPrimeCertificate* iPrimeCertificate;
153 #endif // __DSAKEYPAIRGENIMPL_H__