|
1 /* |
|
2 * Copyright (c) 2004-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 * Note: This file may contain code to generate corrupt files for test purposes. |
|
16 * Such code is excluded from production builds by use of compiler defines; |
|
17 * it is recommended that such code should be removed if this code is ever published publicly. |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 /** |
|
23 @file |
|
24 @internalComponent |
|
25 @released |
|
26 */ |
|
27 |
|
28 #ifndef __SIGNATURECERTCHAINDATA_H__ |
|
29 #define __SIGNATURECERTCHAINDATA_H__ |
|
30 |
|
31 #include "signaturedata.h" |
|
32 #include "certchaindata.h" |
|
33 #include "sisarray.h" |
|
34 |
|
35 |
|
36 class CSISController; |
|
37 |
|
38 |
|
39 class CSignatureCertChainData : public CStructure <CSISFieldRoot::ESISSignatureCertificateChain> |
|
40 { |
|
41 private: |
|
42 void InsertMembers (); |
|
43 |
|
44 public: |
|
45 CSignatureCertChainData (); |
|
46 CSignatureCertChainData (const CSignatureCertChainData& aInitialiser); |
|
47 |
|
48 virtual std::string Name () const; |
|
49 |
|
50 public: |
|
51 inline CSISArray <CSignatureData, CSISFieldRoot::ESISSignature> & Signatures(); |
|
52 inline const CCertChainData& CertificateChain() const; |
|
53 inline void AddSignature(CSignatureData& aSignature); |
|
54 void AddPackageEntry(std::wostream& aStream, bool aVerbose) const; |
|
55 |
|
56 protected: |
|
57 CSISArray <CSignatureData, CSISFieldRoot::ESISSignature> iSignatures; |
|
58 CCertChainData iCertificateChain; |
|
59 }; |
|
60 |
|
61 |
|
62 |
|
63 inline CSISArray <CSignatureData, CSISFieldRoot::ESISSignature>& CSignatureCertChainData::Signatures() |
|
64 { |
|
65 return iSignatures; |
|
66 } |
|
67 |
|
68 inline void CSignatureCertChainData::InsertMembers () |
|
69 { |
|
70 InsertMember (iSignatures); |
|
71 InsertMember (iCertificateChain); |
|
72 } |
|
73 |
|
74 |
|
75 inline CSignatureCertChainData::CSignatureCertChainData () |
|
76 { |
|
77 InsertMembers (); |
|
78 } |
|
79 |
|
80 |
|
81 inline CSignatureCertChainData::CSignatureCertChainData (const CSignatureCertChainData& aInitialiser) : |
|
82 CStructure <CSISFieldRoot::ESISSignatureCertificateChain> (aInitialiser), |
|
83 iSignatures (aInitialiser.iSignatures), |
|
84 iCertificateChain (aInitialiser.iCertificateChain) |
|
85 { |
|
86 InsertMembers (); |
|
87 } |
|
88 |
|
89 |
|
90 inline std::string CSignatureCertChainData::Name () const |
|
91 { |
|
92 return "Signature Certificate Chain"; |
|
93 } |
|
94 |
|
95 inline const CCertChainData& CSignatureCertChainData::CertificateChain() const |
|
96 { |
|
97 return iCertificateChain; |
|
98 } |
|
99 |
|
100 inline void CSignatureCertChainData::AddSignature(CSignatureData& aSignature) |
|
101 { |
|
102 iSignatures.Push(aSignature); |
|
103 } |
|
104 |
|
105 inline void CSignatureCertChainData::AddPackageEntry(std::wostream& aStream, bool aVerbose) const |
|
106 { |
|
107 if (aVerbose) |
|
108 { |
|
109 aStream << L"; Signing chain:" << std::endl; |
|
110 iCertificateChain.AddPackageEntry(aStream, aVerbose); |
|
111 iSignatures.AddPackageEntry(aStream, aVerbose); |
|
112 } |
|
113 } |
|
114 |
|
115 #endif // __SIGNATURECERTCHAINDATA_H__ |
|
116 |