First public contribution.
2 * Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * This file contains the implementation of the ASN1 Numeric String class.
16 * This character set includes the digits 0,1,...,9 and the character <space>
23 EXPORT_C TASN1DecNumericString::TASN1DecNumericString(void)
27 EXPORT_C HBufC* TASN1DecNumericString::DecodeDERL(const TDesC8& aSource,TInt& aPos)
30 TPtrC8 Source=aSource.Mid(aPos);
31 TASN1DecGeneric gen(Source);
33 HBufC* res = DecodeContentsL(gen.GetContentDER());
37 HBufC* TASN1DecNumericString::DecodeContentsL(const TDesC8& aSource)
39 HBufC* res = HBufC::NewL(aSource.Length());
40 TPtr pRes = res->Des();
45 TInt TASN1DecNumericString::CheckValid(const TDesC8& aString)
49 for (i=0;i<aString.Length();i++)
51 if ((aString[i]<'0')||(aString[i]>'9'))