First public contribution.
2 * Copyright (c) 2003-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.
19 #include <pkcs7excert.h>
20 #include "pkcs7asn1.h"
25 //Implementation of PKCS7 Extended Certificate Set
27 CPKCS7ExtendedCertificateOrCertificate* CPKCS7ExtendedCertificateOrCertificate::NewL(const TDesC8& aRawData)
29 CPKCS7ExtendedCertificateOrCertificate* self = new (ELeave) CPKCS7ExtendedCertificateOrCertificate();
30 CleanupStack::PushL(self);
31 self->ConstructL(aRawData);
32 CleanupStack::Pop(self);
36 CPKCS7ExtendedCertificateOrCertificate::~CPKCS7ExtendedCertificateOrCertificate()
41 CPKCS7ExtendedCertificateOrCertificate::CPKCS7ExtendedCertificateOrCertificate()
45 void CPKCS7ExtendedCertificateOrCertificate::ConstructL(const TDesC8& aRawData)
47 TASN1DecGeneric decGen(aRawData);
50 if (decGen.Tag()==EASN1Sequence && decGen.Class()==EUniversal)
53 iCertificate = CX509Certificate::NewL(aRawData);
55 else if (decGen.Tag()==0 && decGen.Class()==EContextSpecific)
57 // extended certificates not supported
58 User::Leave(KErrNotSupported);
62 User::Leave(KErrArgument);
66 EXPORT_C const CX509Certificate& CPKCS7ExtendedCertificateOrCertificate::Certificate(void) const