os/security/cryptoservices/certificateandkeymgmt/asn1/videostrdec.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 1998-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 * This file contains the implementation of the videotex string ASN1 object.
    16 * The videotex string can include the following characters:
    17 * <the character contents of this string type are not yet known - awaiting 
    18 * ITU specifications>
    19 *
    20 */
    21 
    22 
    23 #include <asn1dec.h>
    24 
    25 EXPORT_C TASN1DecVideotexString::TASN1DecVideotexString(void)
    26 	{
    27 	}
    28 
    29 EXPORT_C TInt TASN1DecVideotexString::CheckValid(const TDesC8& /*aSource*/)
    30 
    31 	{
    32 	return KErrNone;
    33 	}
    34 
    35 EXPORT_C HBufC* TASN1DecVideotexString::DecodeDERL(const TDesC8& aSource,TInt& aPos)
    36 
    37 	{
    38 	TPtrC8 Source=aSource.Mid(aPos);
    39 	TASN1DecGeneric gen(Source);
    40 	gen.InitL();
    41 	HBufC* res = DecodeContentsL(gen.GetContentDER());
    42 	aPos+=gen.LengthDER();
    43 	return res;
    44 	}
    45 
    46 HBufC* TASN1DecVideotexString::DecodeContentsL(const TDesC8& aSource)
    47 	{
    48 	HBufC* res = HBufC::NewL(aSource.Length());
    49 	TPtr pRes = res->Des();
    50 	pRes.Copy(aSource);
    51 	return res;
    52 	}