First public contribution.
2 * Copyright (c) 2001-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 * Implementation for DER encoding of Booleans
22 const TUint8 KTrueEncodingDER = 0xFF;
23 const TUint8 KFalseEncodingDER = 0x00;
25 EXPORT_C CASN1EncBoolean* CASN1EncBoolean::NewLC(const TBool aBool)
27 CASN1EncBoolean* self = new (ELeave) CASN1EncBoolean(aBool);
28 CleanupStack::PushL(self);
33 EXPORT_C CASN1EncBoolean* CASN1EncBoolean::NewL(const TBool aBool)
35 CASN1EncBoolean* self = NewLC(aBool);
36 CleanupStack::Pop(self);
40 CASN1EncBoolean::CASN1EncBoolean(const TBool aBool)
41 : CASN1EncPrimitive(EASN1Boolean), iBool(aBool)
46 void CASN1EncBoolean::CalculateContentsLengthDER()
48 iContentsLengthDER = 1;
52 void CASN1EncBoolean::WriteContentsDERL(TDes8& aBuf) const
56 aBuf[0] = KTrueEncodingDER;
60 aBuf[0] = KFalseEncodingDER;