sl@0: /* sl@0: * Copyright (c) 1998-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: * sl@0: */ sl@0: sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include "pkixCertChainHelper.h" sl@0: sl@0: //**********************************************************************************// sl@0: EXPORT_C CPKIXCertChain* CPKIXCertChain::NewL(RFs& aFs, sl@0: const TPtrC8& aEncodedCerts, sl@0: const TUid aClient) sl@0: { sl@0: CPKIXCertChain* self = CPKIXCertChain::NewLC(aFs, aEncodedCerts, aClient); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: EXPORT_C CPKIXCertChain* CPKIXCertChain::NewLC(RFs& aFs, sl@0: const TPtrC8& aEncodedCerts, sl@0: const TUid aClient) sl@0: { sl@0: CPKIXCertChain* self = new(ELeave) CPKIXCertChain(); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aFs, aEncodedCerts, aClient); sl@0: return self; sl@0: } sl@0: sl@0: EXPORT_C CPKIXCertChain* CPKIXCertChain::NewL(RFs& aFs, sl@0: const TPtrC8& aEncodedCerts, sl@0: const RPointerArray& aRootCerts) sl@0: { sl@0: CPKIXCertChain* self = CPKIXCertChain::NewLC(aFs, aEncodedCerts, aRootCerts); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: EXPORT_C CPKIXCertChain* CPKIXCertChain::NewLC(RFs& aFs, sl@0: const TPtrC8& aEncodedCerts, sl@0: const RPointerArray& aRootCerts) sl@0: { sl@0: CPKIXCertChain* self = new(ELeave) CPKIXCertChain(); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aFs, aEncodedCerts, aRootCerts); sl@0: return self; sl@0: } sl@0: sl@0: CPKIXCertChain::CPKIXCertChain() : sl@0: CPKIXCertChainBase() sl@0: { sl@0: } sl@0: sl@0: void CPKIXCertChain::ConstructL(RFs& aFs, const TPtrC8& aEncodedCerts, TUid aClient) sl@0: { sl@0: iHelper = CPKIXCertChainHelper::NewL(aFs); sl@0: CPKIXCertChainBase::ConstructL(iHelper->CertStore(), aEncodedCerts, aClient); sl@0: } sl@0: sl@0: void CPKIXCertChain::ConstructL(RFs& aFs, const TPtrC8& aEncodedCerts, sl@0: const RPointerArray& aRootCerts) sl@0: { sl@0: iHelper = CPKIXCertChainHelper::NewL(aFs); sl@0: CPKIXCertChainBase::ConstructL(iHelper->CertStore(), aEncodedCerts, aRootCerts); sl@0: } sl@0: sl@0: EXPORT_C CPKIXCertChain::~CPKIXCertChain() sl@0: { sl@0: delete iHelper; sl@0: } sl@0: sl@0: EXPORT_C void CPKIXCertChain::ValidateL(CPKIXValidationResult& aValidationResult, sl@0: const TTime& aValidationTime, sl@0: TRequestStatus& aStatus) sl@0: { sl@0: // L in function name is to preserve BC - this can't leave sl@0: iHelper->Validate(*this, aValidationResult, aValidationTime, aStatus); sl@0: } sl@0: sl@0: EXPORT_C void CPKIXCertChain::ValidateL(CPKIXValidationResult& aValidationResult, sl@0: const TTime& aValidationTime, sl@0: const CArrayPtr& aInitialPolicies, sl@0: TRequestStatus& aStatus) sl@0: { sl@0: // L in function name is to preserve BC - this can't leave sl@0: iHelper->Validate(*this, aValidationResult, aValidationTime, aInitialPolicies, aStatus); sl@0: } sl@0: sl@0: EXPORT_C void CPKIXCertChain::CancelValidate() sl@0: { sl@0: iHelper->CancelValidate(); sl@0: } sl@0: sl@0: EXPORT_C TBool CPKIXCertChain::ChainHasRoot() const sl@0: { sl@0: // This method is necessary to preserve BC sl@0: return CPKIXCertChainBase::ChainHasRoot(); sl@0: } sl@0: sl@0: EXPORT_C void CPKIXCertChain::AddCertL(const TPtrC8& aEncodedCerts) sl@0: { sl@0: // This method is necessary to preserve BC sl@0: CPKIXCertChainBase::AddCertL(aEncodedCerts); sl@0: } sl@0: sl@0: EXPORT_C const RPointerArray& CPKIXCertChain::SupportedCriticalExtensions() const sl@0: { sl@0: return CPKIXCertChainBase::SupportedCriticalExtensions(); sl@0: } sl@0: sl@0: EXPORT_C void CPKIXCertChain::AddSupportedCriticalExtensionsL(const RPointerArray& aCriticalExtOids) sl@0: { sl@0: CPKIXCertChainBase::AddSupportedCriticalExtensionsL(aCriticalExtOids); sl@0: } sl@0: sl@0: EXPORT_C void CPKIXCertChain::RemoveSupportedCriticalExtensions(const RPointerArray& aCriticalExtOids) sl@0: { sl@0: CPKIXCertChainBase::RemoveSupportedCriticalExtensions(aCriticalExtOids); sl@0: } sl@0: sl@0: EXPORT_C void CPKIXCertChain::SetSupportedCriticalExtensionsL(const RPointerArray& aCriticalExtOids) sl@0: { sl@0: CPKIXCertChainBase::SetSupportedCriticalExtensionsL(aCriticalExtOids); sl@0: } sl@0: sl@0: EXPORT_C void CPKIXCertChain::ResetSupportedCriticalExtsToDefaultL() sl@0: { sl@0: CPKIXCertChainBase::ResetSupportedCriticalExtsToDefaultL(); sl@0: } sl@0: sl@0: EXPORT_C void CPKIXCertChain::SetValidityPeriodCheckFatal(TBool aIsFatal) sl@0: { sl@0: CPKIXCertChainBase::SetValidityPeriodCheckFatal(aIsFatal); sl@0: }