sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <pkixcertchain.h>
|
sl@0
|
20 |
#include <unifiedcertstore.h>
|
sl@0
|
21 |
#include <x509certext.h>
|
sl@0
|
22 |
#include "pkixCertChainHelper.h"
|
sl@0
|
23 |
|
sl@0
|
24 |
//**********************************************************************************//
|
sl@0
|
25 |
EXPORT_C CPKIXCertChain* CPKIXCertChain::NewL(RFs& aFs,
|
sl@0
|
26 |
const TPtrC8& aEncodedCerts,
|
sl@0
|
27 |
const TUid aClient)
|
sl@0
|
28 |
{
|
sl@0
|
29 |
CPKIXCertChain* self = CPKIXCertChain::NewLC(aFs, aEncodedCerts, aClient);
|
sl@0
|
30 |
CleanupStack::Pop(self);
|
sl@0
|
31 |
return self;
|
sl@0
|
32 |
}
|
sl@0
|
33 |
|
sl@0
|
34 |
EXPORT_C CPKIXCertChain* CPKIXCertChain::NewLC(RFs& aFs,
|
sl@0
|
35 |
const TPtrC8& aEncodedCerts,
|
sl@0
|
36 |
const TUid aClient)
|
sl@0
|
37 |
{
|
sl@0
|
38 |
CPKIXCertChain* self = new(ELeave) CPKIXCertChain();
|
sl@0
|
39 |
CleanupStack::PushL(self);
|
sl@0
|
40 |
self->ConstructL(aFs, aEncodedCerts, aClient);
|
sl@0
|
41 |
return self;
|
sl@0
|
42 |
}
|
sl@0
|
43 |
|
sl@0
|
44 |
EXPORT_C CPKIXCertChain* CPKIXCertChain::NewL(RFs& aFs,
|
sl@0
|
45 |
const TPtrC8& aEncodedCerts,
|
sl@0
|
46 |
const RPointerArray<CX509Certificate>& aRootCerts)
|
sl@0
|
47 |
{
|
sl@0
|
48 |
CPKIXCertChain* self = CPKIXCertChain::NewLC(aFs, aEncodedCerts, aRootCerts);
|
sl@0
|
49 |
CleanupStack::Pop(self);
|
sl@0
|
50 |
return self;
|
sl@0
|
51 |
}
|
sl@0
|
52 |
|
sl@0
|
53 |
EXPORT_C CPKIXCertChain* CPKIXCertChain::NewLC(RFs& aFs,
|
sl@0
|
54 |
const TPtrC8& aEncodedCerts,
|
sl@0
|
55 |
const RPointerArray<CX509Certificate>& aRootCerts)
|
sl@0
|
56 |
{
|
sl@0
|
57 |
CPKIXCertChain* self = new(ELeave) CPKIXCertChain();
|
sl@0
|
58 |
CleanupStack::PushL(self);
|
sl@0
|
59 |
self->ConstructL(aFs, aEncodedCerts, aRootCerts);
|
sl@0
|
60 |
return self;
|
sl@0
|
61 |
}
|
sl@0
|
62 |
|
sl@0
|
63 |
CPKIXCertChain::CPKIXCertChain() :
|
sl@0
|
64 |
CPKIXCertChainBase()
|
sl@0
|
65 |
{
|
sl@0
|
66 |
}
|
sl@0
|
67 |
|
sl@0
|
68 |
void CPKIXCertChain::ConstructL(RFs& aFs, const TPtrC8& aEncodedCerts, TUid aClient)
|
sl@0
|
69 |
{
|
sl@0
|
70 |
iHelper = CPKIXCertChainHelper::NewL(aFs);
|
sl@0
|
71 |
CPKIXCertChainBase::ConstructL(iHelper->CertStore(), aEncodedCerts, aClient);
|
sl@0
|
72 |
}
|
sl@0
|
73 |
|
sl@0
|
74 |
void CPKIXCertChain::ConstructL(RFs& aFs, const TPtrC8& aEncodedCerts,
|
sl@0
|
75 |
const RPointerArray<CX509Certificate>& aRootCerts)
|
sl@0
|
76 |
{
|
sl@0
|
77 |
iHelper = CPKIXCertChainHelper::NewL(aFs);
|
sl@0
|
78 |
CPKIXCertChainBase::ConstructL(iHelper->CertStore(), aEncodedCerts, aRootCerts);
|
sl@0
|
79 |
}
|
sl@0
|
80 |
|
sl@0
|
81 |
EXPORT_C CPKIXCertChain::~CPKIXCertChain()
|
sl@0
|
82 |
{
|
sl@0
|
83 |
delete iHelper;
|
sl@0
|
84 |
}
|
sl@0
|
85 |
|
sl@0
|
86 |
EXPORT_C void CPKIXCertChain::ValidateL(CPKIXValidationResult& aValidationResult,
|
sl@0
|
87 |
const TTime& aValidationTime,
|
sl@0
|
88 |
TRequestStatus& aStatus)
|
sl@0
|
89 |
{
|
sl@0
|
90 |
// L in function name is to preserve BC - this can't leave
|
sl@0
|
91 |
iHelper->Validate(*this, aValidationResult, aValidationTime, aStatus);
|
sl@0
|
92 |
}
|
sl@0
|
93 |
|
sl@0
|
94 |
EXPORT_C void CPKIXCertChain::ValidateL(CPKIXValidationResult& aValidationResult,
|
sl@0
|
95 |
const TTime& aValidationTime,
|
sl@0
|
96 |
const CArrayPtr<HBufC>& aInitialPolicies,
|
sl@0
|
97 |
TRequestStatus& aStatus)
|
sl@0
|
98 |
{
|
sl@0
|
99 |
// L in function name is to preserve BC - this can't leave
|
sl@0
|
100 |
iHelper->Validate(*this, aValidationResult, aValidationTime, aInitialPolicies, aStatus);
|
sl@0
|
101 |
}
|
sl@0
|
102 |
|
sl@0
|
103 |
EXPORT_C void CPKIXCertChain::CancelValidate()
|
sl@0
|
104 |
{
|
sl@0
|
105 |
iHelper->CancelValidate();
|
sl@0
|
106 |
}
|
sl@0
|
107 |
|
sl@0
|
108 |
EXPORT_C TBool CPKIXCertChain::ChainHasRoot() const
|
sl@0
|
109 |
{
|
sl@0
|
110 |
// This method is necessary to preserve BC
|
sl@0
|
111 |
return CPKIXCertChainBase::ChainHasRoot();
|
sl@0
|
112 |
}
|
sl@0
|
113 |
|
sl@0
|
114 |
EXPORT_C void CPKIXCertChain::AddCertL(const TPtrC8& aEncodedCerts)
|
sl@0
|
115 |
{
|
sl@0
|
116 |
// This method is necessary to preserve BC
|
sl@0
|
117 |
CPKIXCertChainBase::AddCertL(aEncodedCerts);
|
sl@0
|
118 |
}
|
sl@0
|
119 |
|
sl@0
|
120 |
EXPORT_C const RPointerArray<TDesC>& CPKIXCertChain::SupportedCriticalExtensions() const
|
sl@0
|
121 |
{
|
sl@0
|
122 |
return CPKIXCertChainBase::SupportedCriticalExtensions();
|
sl@0
|
123 |
}
|
sl@0
|
124 |
|
sl@0
|
125 |
EXPORT_C void CPKIXCertChain::AddSupportedCriticalExtensionsL(const RPointerArray<TDesC>& aCriticalExtOids)
|
sl@0
|
126 |
{
|
sl@0
|
127 |
CPKIXCertChainBase::AddSupportedCriticalExtensionsL(aCriticalExtOids);
|
sl@0
|
128 |
}
|
sl@0
|
129 |
|
sl@0
|
130 |
EXPORT_C void CPKIXCertChain::RemoveSupportedCriticalExtensions(const RPointerArray<TDesC>& aCriticalExtOids)
|
sl@0
|
131 |
{
|
sl@0
|
132 |
CPKIXCertChainBase::RemoveSupportedCriticalExtensions(aCriticalExtOids);
|
sl@0
|
133 |
}
|
sl@0
|
134 |
|
sl@0
|
135 |
EXPORT_C void CPKIXCertChain::SetSupportedCriticalExtensionsL(const RPointerArray<TDesC>& aCriticalExtOids)
|
sl@0
|
136 |
{
|
sl@0
|
137 |
CPKIXCertChainBase::SetSupportedCriticalExtensionsL(aCriticalExtOids);
|
sl@0
|
138 |
}
|
sl@0
|
139 |
|
sl@0
|
140 |
EXPORT_C void CPKIXCertChain::ResetSupportedCriticalExtsToDefaultL()
|
sl@0
|
141 |
{
|
sl@0
|
142 |
CPKIXCertChainBase::ResetSupportedCriticalExtsToDefaultL();
|
sl@0
|
143 |
}
|
sl@0
|
144 |
|
sl@0
|
145 |
EXPORT_C void CPKIXCertChain::SetValidityPeriodCheckFatal(TBool aIsFatal)
|
sl@0
|
146 |
{
|
sl@0
|
147 |
CPKIXCertChainBase::SetValidityPeriodCheckFatal(aIsFatal);
|
sl@0
|
148 |
}
|