cryptoservices/filebasedcertificateandkeystores/source/shared/DHParams.cpp
changeset 0 2c201484c85f
child 8 35751d3474b7
equal deleted inserted replaced
-1:000000000000 0:2c201484c85f
       
     1 /*
       
     2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * CDHParams.cpp
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include "fsdatatypes.h"
       
    21 
       
    22 EXPORT_C CDHParams::~CDHParams()
       
    23 	{
       
    24 	iN.Close();
       
    25 	iG.Close();
       
    26 	}
       
    27 
       
    28 EXPORT_C CDHParams::CDHParams(RInteger aN, RInteger aG)
       
    29 	: iN(aN), iG(aG)
       
    30 	{
       
    31 	}
       
    32 
       
    33 EXPORT_C CDHParams* CDHParams::NewL(const TInteger& aN, const TInteger& aG)
       
    34 	{
       
    35 	RInteger n = RInteger::NewL(aN);
       
    36 	CleanupStack::PushL(n);
       
    37 	RInteger g = RInteger::NewL(aG);
       
    38 	CleanupStack::PushL(g);
       
    39 	CDHParams* self = new (ELeave) CDHParams(n, g);
       
    40 	CleanupStack::Pop(2); // g, n
       
    41 	return self;
       
    42 	}
       
    43 
       
    44 EXPORT_C RInteger CDHParams::TakeN()
       
    45 	{
       
    46 	RInteger result = iN;
       
    47 	iN = RInteger();
       
    48 	return result;
       
    49 	}
       
    50 
       
    51 EXPORT_C RInteger CDHParams::TakeG()
       
    52 	{
       
    53 	RInteger result = iG;
       
    54 	iG = RInteger();
       
    55 	return result;
       
    56 	}