os/security/cryptoservices/filebasedcertificateandkeystores/source/shared/DHParams.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/cryptoservices/filebasedcertificateandkeystores/source/shared/DHParams.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,57 @@
     1.4 +/*
     1.5 +* Copyright (c) 2004-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 +* CDHParams.cpp
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#include "fsdatatypes.h"
    1.24 +
    1.25 +EXPORT_C CDHParams::~CDHParams()
    1.26 +	{
    1.27 +	iN.Close();
    1.28 +	iG.Close();
    1.29 +	}
    1.30 +
    1.31 +EXPORT_C CDHParams::CDHParams(const RInteger aN, const RInteger aG)
    1.32 +	: iN(aN), iG(aG)
    1.33 +	{
    1.34 +	}
    1.35 +
    1.36 +EXPORT_C CDHParams* CDHParams::NewL(const TInteger& aN, const TInteger& aG)
    1.37 +	{
    1.38 +	RInteger n = RInteger::NewL(aN);
    1.39 +	CleanupStack::PushL(n);
    1.40 +	RInteger g = RInteger::NewL(aG);
    1.41 +	CleanupStack::PushL(g);
    1.42 +	CDHParams* self = new (ELeave) CDHParams(n, g);
    1.43 +	CleanupStack::Pop(2); // g, n
    1.44 +	return self;
    1.45 +	}
    1.46 +
    1.47 +EXPORT_C RInteger CDHParams::TakeN()
    1.48 +	{
    1.49 +	RInteger result = iN;
    1.50 +	iN = RInteger();
    1.51 +	return result;
    1.52 +	}
    1.53 +
    1.54 +EXPORT_C RInteger CDHParams::TakeG()
    1.55 +	{
    1.56 +	RInteger result = iG;
    1.57 +	iG = RInteger();
    1.58 +	return result;
    1.59 +	}
    1.60 +