sl@0: /* sl@0: * Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef __TVECTORUTILS_H__ sl@0: #define __TVECTORUTILS_H__ sl@0: sl@0: #include sl@0: #include "asymmetrickeys.h" sl@0: #include "asymmetric.h" sl@0: #include "bigint.h" sl@0: sl@0: /** sl@0: * Defines static utility methods used by the vector tests. sl@0: */ sl@0: sl@0: class VectorUtils sl@0: { sl@0: public: sl@0: sl@0: /** Parse a hex string and return a new RInteger. */ sl@0: static RInteger ParseIntegerL(const TDesC8& aDes); sl@0: sl@0: /** Parse a hex string and return a new descriptor containing the binary data. */ sl@0: static HBufC8* ParseBinaryL(const TDesC8& aDes); sl@0: sl@0: /** Return a new descriptor containing the hex representation of an Integer. */ sl@0: static TDesC* PrintIntegerL(const TInteger& aInt); sl@0: sl@0: /** Return a new descriptor containing the hex representation of a binary string. */ sl@0: static TDesC* PrintBinaryL(const TDesC8& aData); sl@0: sl@0: /** Parse a string containg either "ETrue" or "EFalse" and return a TBool. */ sl@0: static TBool ParseBoolL(const TDesC8& aDes); sl@0: sl@0: /** Create an RSA public key from from action data. */ sl@0: static CRSAPublicKey* ReadRSAPublicKeyL(const TDesC8& aData); sl@0: sl@0: /** Create an RSA private key from from action data. */ sl@0: static CRSAPrivateKeyStandard* ReadRSAPrivateKeyL(const TDesC8& aData); sl@0: sl@0: /** Create an RSA private key from by CRT */ sl@0: static CRSAPrivateKeyCRT* ReadRSAPrivateKeyCRTL(const TDesC8& aData); sl@0: sl@0: /** Create a DSA public key from from action data. */ sl@0: static CDSAPublicKey* ReadDSAPublicKeyL(const TDesC8& aData); sl@0: sl@0: /** Create a DSA private key from from action data. */ sl@0: static CDSAPrivateKey* ReadDSAPrivateKeyL(const TDesC8& aData); sl@0: sl@0: /** Create a DSA signature from from action data. */ sl@0: static CDSASignature* ReadDSASignatureL(const TDesC8& aData); sl@0: }; sl@0: sl@0: #endif