2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file widget_security.h
18 * @author Krzysztof Jackiewicz(k.jackiewicz@samsung.com)
23 #ifndef WACSECURITY_H_
24 #define WACSECURITY_H_
26 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
27 #include <vcore/Certificate.h>
28 #include <vcore/CertificateCollection.h>
31 namespace WidgetInstall {
32 class WidgetSecurity : public WrtDB::IWidgetSecurity
37 mDistributorSigned(false)
40 // from IWidgetSecurity
41 virtual const WrtDB::WidgetCertificateDataList& getCertificateList() const
43 return mCertificateList;
46 virtual bool isRecognized() const
51 virtual bool isDistributorSigned() const
53 return mDistributorSigned;
56 virtual void getCertificateChainList(
57 WrtDB::CertificateChainList& list,
58 WrtDB::CertificateSource source) const;
60 void setRecognized(bool recognized)
62 mRecognized = recognized;
64 void setDistributorSigned(bool distributorSigned)
66 mDistributorSigned = distributorSigned;
68 void setAuthorCertificatePtr(ValidationCore::CertificatePtr certPtr)
70 mAuthorCertificate = certPtr;
73 ValidationCore::CertificatePtr getAuthorCertificatePtr() const
75 return mAuthorCertificate;
78 ValidationCore::CertificateCollectionList& getCertificateChainListRef()
80 return mCertificateChainList;
83 ValidationCore::CertificateCollectionList& getCertificateChainList2Ref()
85 return mCertificateChainList2;
88 ValidationCore::CertificateCollectionList&
89 getAuthorsCertificateChainListRef()
91 return mAuthorsCertificateChainList;
94 WrtDB::WidgetCertificateDataList& getCertificateListRef()
96 return mCertificateList;
100 // This data are used to evaluate policy
101 WrtDB::WidgetCertificateDataList mCertificateList;
103 // author signature verified
106 bool mDistributorSigned;
107 // Author end entity certificate.
108 // Information from this certificate are shown to user
109 // during installation process.
110 ValidationCore::CertificatePtr mAuthorCertificate;
111 // This certificates are used by OCSP/CRL
112 ValidationCore::CertificateCollectionList mCertificateChainList;
113 // This certificates are for distributor2
114 ValidationCore::CertificateCollectionList mCertificateChainList2;
115 // This authors certificates are used by tizen
116 ValidationCore::CertificateCollectionList mAuthorsCertificateChainList;
118 } // namespace WidgetInstall
121 #endif /* WACSECURITY_H_ */