cryptoservices/certificateandkeymgmt/asn1/octetstrdec.cpp
changeset 0 2c201484c85f
child 8 35751d3474b7
equal deleted inserted replaced
-1:000000000000 0:2c201484c85f
       
     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 Octet String ASN1 class.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include "asn1dec.h"
       
    21 
       
    22 EXPORT_C TASN1DecOctetString::TASN1DecOctetString(void)
       
    23 	{
       
    24 	}
       
    25 
       
    26 EXPORT_C HBufC8* TASN1DecOctetString::DecodeDERL(const TDesC8& aSource,TInt& aPos)
       
    27 
       
    28 	{
       
    29 	TPtrC8 Source=aSource.Mid(aPos);
       
    30 	TASN1DecGeneric gen(Source);
       
    31 	gen.InitL();
       
    32 	HBufC8* res = gen.GetContentDER().AllocL();
       
    33 	aPos+=gen.LengthDER();
       
    34 	return res;
       
    35 	}
       
    36 
       
    37 EXPORT_C HBufC8* TASN1DecOctetString::DecodeDERL(const TASN1DecGeneric& aSource)
       
    38 	{
       
    39 	return aSource.GetContentDER().AllocL();
       
    40 	}
       
    41 
       
    42 EXPORT_C TInt TASN1DecOctetString::CheckValid(const TDesC8& /*aSource*/)
       
    43 	{
       
    44 	return KErrNone;
       
    45 	}