|
1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * sistruststatus.h |
|
16 * TSisTrustStatus definition |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 /** |
|
22 @file |
|
23 @released |
|
24 @publishedPartner |
|
25 */ |
|
26 |
|
27 #include <swi/sistruststatus.h> |
|
28 #include <s32strm.h> |
|
29 |
|
30 using namespace Swi; |
|
31 |
|
32 EXPORT_C TSisTrustStatus::TSisTrustStatus() : |
|
33 iValidationStatus(EUnknown), |
|
34 iRevocationStatus(EUnknown2), |
|
35 iResultDate(0), |
|
36 iLastCheckDate(0), |
|
37 iQuarantined(false), |
|
38 iQuarantinedDate(0) |
|
39 { |
|
40 } |
|
41 |
|
42 EXPORT_C TSisTrustStatus::TSisTrustStatus( |
|
43 TValidationStatus aValidation, |
|
44 TRevocationStatus aRevocation, |
|
45 TTime aResultDate, |
|
46 TTime aCheckDate) : |
|
47 iValidationStatus(aValidation), |
|
48 iRevocationStatus(aRevocation), |
|
49 iResultDate(aResultDate), |
|
50 iLastCheckDate(aCheckDate), |
|
51 iQuarantined(false), |
|
52 iQuarantinedDate(0) |
|
53 { |
|
54 } |
|
55 |
|
56 EXPORT_C void TSisTrustStatus::InternalizeL(RReadStream& aStream) |
|
57 { |
|
58 iValidationStatus = static_cast<TValidationStatus>(aStream.ReadInt32L()); |
|
59 iRevocationStatus = static_cast<TRevocationStatus>(aStream.ReadInt32L()); |
|
60 |
|
61 TPckg <TTime> timePckg(iResultDate); |
|
62 aStream.ReadL(timePckg, timePckg.MaxLength()); |
|
63 |
|
64 TPckg <TTime> timePckg2(iLastCheckDate); |
|
65 aStream.ReadL(timePckg2, timePckg2.MaxLength()); |
|
66 |
|
67 iQuarantined = static_cast<TBool>(aStream.ReadInt32L()); |
|
68 |
|
69 TPckg <TTime> timePckg3(iQuarantinedDate); |
|
70 aStream.ReadL(timePckg3, timePckg3.MaxLength()); |
|
71 } |
|
72 |
|
73 EXPORT_C void TSisTrustStatus::ExternalizeL(RWriteStream& aStream) const |
|
74 { |
|
75 aStream.WriteInt32L(iValidationStatus); |
|
76 aStream.WriteInt32L(iRevocationStatus); |
|
77 |
|
78 TPckg <TTime> timePckg(iResultDate); |
|
79 aStream.WriteL(timePckg, timePckg.MaxLength()); |
|
80 |
|
81 TPckg <TTime> timePckg2(iLastCheckDate); |
|
82 aStream.WriteL(timePckg2, timePckg2.MaxLength()); |
|
83 |
|
84 aStream.WriteInt32L(iQuarantined); |
|
85 |
|
86 TPckg <TTime> timePckg3(iQuarantinedDate); |
|
87 aStream.WriteL(timePckg3, timePckg3.MaxLength()); |
|
88 } |
|
89 |
|
90 EXPORT_C TBool TSisTrustStatus::IsTrusted() const |
|
91 { |
|
92 return (iValidationStatus == EPackageInRom) || |
|
93 (iValidationStatus >= EValidatedToAnchor && |
|
94 iRevocationStatus >= EOcspTransient); |
|
95 } |
|
96 |