sl@0: /* sl@0: * Copyright (c) 2001-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: * Implementation for class encoding octet strings in ASN1 DER sl@0: * sl@0: */ sl@0: sl@0: sl@0: #include sl@0: sl@0: EXPORT_C CASN1EncOctetString* CASN1EncOctetString::NewLC(const TDesC8& aStr) sl@0: { sl@0: CASN1EncOctetString* self = new (ELeave) CASN1EncOctetString(); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aStr); sl@0: return self; sl@0: } sl@0: sl@0: EXPORT_C CASN1EncOctetString* CASN1EncOctetString::NewL(const TDesC8& aStr) sl@0: { sl@0: CASN1EncOctetString* self = NewLC(aStr); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: EXPORT_C CASN1EncOctetString::~CASN1EncOctetString() sl@0: { sl@0: delete iContents; sl@0: } sl@0: sl@0: sl@0: CASN1EncOctetString::CASN1EncOctetString() sl@0: : CASN1EncPrimitive(EASN1OctetString) sl@0: { sl@0: } sl@0: sl@0: sl@0: void CASN1EncOctetString::ConstructL(const TDesC8& aStr) sl@0: { sl@0: iContents = aStr.AllocL(); sl@0: CASN1EncPrimitive::ConstructL(); sl@0: } sl@0: sl@0: sl@0: void CASN1EncOctetString::CalculateContentsLengthDER() sl@0: { sl@0: iContentsLengthDER = iContents->Length(); sl@0: } sl@0: sl@0: sl@0: void CASN1EncOctetString::WriteContentsDERL(TDes8& aBuf) const sl@0: { sl@0: aBuf.Copy(*iContents); sl@0: }