os/security/crypto/weakcryptospi/source/asymmetric/asymmetric.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/crypto/weakcryptospi/source/asymmetric/asymmetric.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,124 @@
     1.4 +/*
     1.5 +* Copyright (c) 2003-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 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#include <asymmetric.h>
    1.23 +#include <bigint.h>
    1.24 +
    1.25 +/* MCryptoSystem */
    1.26 +
    1.27 +EXPORT_C MCryptoSystem::MCryptoSystem(void)
    1.28 +	{
    1.29 +	}
    1.30 +
    1.31 +/* CEncryptor */
    1.32 +
    1.33 +EXPORT_C CEncryptor::CEncryptor(void)
    1.34 +	{
    1.35 +	}
    1.36 +
    1.37 +/* CDecryptor */
    1.38 +
    1.39 +EXPORT_C CDecryptor::CDecryptor(void)
    1.40 +	{
    1.41 +	}
    1.42 +
    1.43 +/* MSignatureSystem */
    1.44 +
    1.45 +EXPORT_C MSignatureSystem::MSignatureSystem(void)
    1.46 +	{
    1.47 +	}
    1.48 +
    1.49 +/* CRSASignature */ 
    1.50 +
    1.51 +EXPORT_C CRSASignature* CRSASignature::NewL(RInteger& aS)
    1.52 +	{
    1.53 +	CRSASignature* self = new(ELeave)CRSASignature(aS);
    1.54 +	return self;
    1.55 +	}
    1.56 +
    1.57 +EXPORT_C CRSASignature* CRSASignature::NewLC(RInteger& aS)
    1.58 +	{
    1.59 +	CRSASignature* self = NewL(aS);
    1.60 +	CleanupStack::PushL(self);
    1.61 +	return self;
    1.62 +	}
    1.63 +
    1.64 +EXPORT_C const TInteger& CRSASignature::S(void) const
    1.65 +	{
    1.66 +	return iS;
    1.67 +	}
    1.68 +
    1.69 +EXPORT_C TBool CRSASignature::operator==(const CRSASignature& aSig) const
    1.70 +	{
    1.71 +	return ( S() == aSig.S() );
    1.72 +	}
    1.73 +
    1.74 +EXPORT_C CRSASignature::~CRSASignature(void)
    1.75 +	{
    1.76 +	iS.Close();
    1.77 +	}
    1.78 +
    1.79 +EXPORT_C CRSASignature::CRSASignature(RInteger& aS) : iS(aS)
    1.80 +	{
    1.81 +	}
    1.82 +
    1.83 +/* CDSASignature */
    1.84 +
    1.85 +EXPORT_C CDSASignature* CDSASignature::NewL(RInteger& aR, RInteger& aS)
    1.86 +	{
    1.87 +	CDSASignature* self = new(ELeave)CDSASignature(aR, aS);
    1.88 +	return self;
    1.89 +	}
    1.90 +
    1.91 +EXPORT_C CDSASignature* CDSASignature::NewLC(RInteger& aR, RInteger& aS)
    1.92 +	{
    1.93 +	CDSASignature* self = NewL(aR, aS);
    1.94 +	CleanupStack::PushL(self);
    1.95 +	return self;
    1.96 +	}
    1.97 +
    1.98 +EXPORT_C const TInteger& CDSASignature::R(void) const
    1.99 +	{
   1.100 +	return iR;
   1.101 +	}
   1.102 +
   1.103 +EXPORT_C const TInteger& CDSASignature::S(void) const
   1.104 +	{
   1.105 +	return iS;
   1.106 +	}
   1.107 +
   1.108 +EXPORT_C TBool CDSASignature::operator==(const CDSASignature& aSig) const
   1.109 +	{
   1.110 +	return ( R() == aSig.R() && S() == aSig.S() );
   1.111 +	}
   1.112 +
   1.113 +EXPORT_C CDSASignature::~CDSASignature(void)
   1.114 +	{
   1.115 +	iR.Close();
   1.116 +	iS.Close();
   1.117 +	}
   1.118 +
   1.119 +EXPORT_C CDSASignature::CDSASignature()
   1.120 +	{
   1.121 +	}
   1.122 +
   1.123 +EXPORT_C CDSASignature::CDSASignature(RInteger& aR, RInteger& aS) 
   1.124 +	: iR(aR), iS(aS)
   1.125 +	{
   1.126 +	}
   1.127 +