os/security/crypto/weakcrypto/test/tasymmetric/tvectorutils.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/crypto/weakcrypto/test/tasymmetric/tvectorutils.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,69 @@
     1.4 +/*
     1.5 +* Copyright (c) 1998-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 +#ifndef __TVECTORUTILS_H__
    1.23 +#define __TVECTORUTILS_H__
    1.24 +
    1.25 +#include <e32std.h>
    1.26 +#include "asymmetrickeys.h"
    1.27 +#include "asymmetric.h"
    1.28 +#include "bigint.h"
    1.29 +
    1.30 +/**
    1.31 + * Defines static utility methods used by the vector tests.
    1.32 + */
    1.33 +
    1.34 +class VectorUtils
    1.35 +    {
    1.36 +public:
    1.37 +
    1.38 +    /** Parse a hex string and return a new RInteger. */
    1.39 +    static RInteger ParseIntegerL(const TDesC8& aDes);
    1.40 +
    1.41 +    /** Parse a hex string and return a new descriptor containing the binary data. */
    1.42 +	static HBufC8* ParseBinaryL(const TDesC8& aDes);
    1.43 +
    1.44 +    /** Return a new descriptor containing the hex representation of an Integer. */
    1.45 +	static TDesC* PrintIntegerL(const TInteger& aInt);
    1.46 +
    1.47 +    /** Return a new descriptor containing the hex representation of a binary string. */
    1.48 +	static TDesC* PrintBinaryL(const TDesC8& aData);
    1.49 +
    1.50 +    /** Parse a string containg either "ETrue" or "EFalse" and return a TBool. */
    1.51 +    static TBool ParseBoolL(const TDesC8& aDes);
    1.52 +
    1.53 +    /** Create an RSA public key from from action data. */
    1.54 +    static CRSAPublicKey* ReadRSAPublicKeyL(const TDesC8& aData);
    1.55 +
    1.56 +    /** Create an RSA private key from from action data. */
    1.57 +    static CRSAPrivateKeyStandard* ReadRSAPrivateKeyL(const TDesC8& aData);
    1.58 +
    1.59 +	/** Create an RSA private key from by CRT */
    1.60 +	static CRSAPrivateKeyCRT* ReadRSAPrivateKeyCRTL(const TDesC8& aData);
    1.61 +
    1.62 +    /** Create a DSA public key from from action data. */
    1.63 +    static CDSAPublicKey* ReadDSAPublicKeyL(const TDesC8& aData);
    1.64 +
    1.65 +    /** Create a DSA private key from from action data. */
    1.66 +    static CDSAPrivateKey* ReadDSAPrivateKeyL(const TDesC8& aData);    
    1.67 +
    1.68 +    /** Create a DSA signature from from action data. */
    1.69 +	static CDSASignature* ReadDSASignatureL(const TDesC8& aData);
    1.70 +    };
    1.71 +
    1.72 +#endif