LogDebug("Insert certinfo to pkgmgr structure");
ValidationCore::CertificateCollection chain;
+
if (false == chain.load(*it)) {
LogError("Chain is broken");
ThrowMsg(Exceptions::SetCertificateInfoFailed,
pkgmgr_instcert_type instCertType;
if (source == SIGNATURE_DISTRIBUTOR) {
- std::string
- Name(DPL::ToUTF8String(*(*certIt)->getOrganizationName()));
- size_t found = Name.find("Tizen");
+ bool distributor1 = false;
+ if (!(*certIt)->getCommonName().IsNull()) {
+ std::string
+ Name(DPL::ToUTF8String(*(*certIt)->getCommonName()));
+ std::string tizenStr("Tizen");
+ if (0 == Name.compare(0, tizenStr.length(), tizenStr)) {
+ distributor1 = true;
+ }
+ }
- if (found != std::string::npos) {
+ if (distributor1) {
LogDebug("Set SIGNATURE_DISTRIBUTOR");
if ((*certIt)->isRootCert()) {
instCertType = PM_SET_DISTRIBUTOR_ROOT_CERT;