Examples of TblPcrManifest


Examples of com.intel.mtwilson.as.data.TblPcrManifest

    Collection<TblPcrManifest> tblPcrManifests = new ArrayList<TblPcrManifest>();

    if (mleManifests != null) {

      for (ManifestData manifestData : mleManifests) {
        TblPcrManifest pcrManifest = new TblPcrManifest();
        pcrManifest.setName(manifestData.getName());
        pcrManifest.setValue(manifestData.getValue());
        pcrManifest.setMleId(tblMle);
        pcrManifestJpaController.create(pcrManifest);
        tblPcrManifests.add(pcrManifest);
      }
    }
   
View Full Code Here

Examples of com.intel.mtwilson.as.data.TblPcrManifest

        }
      }
                       
      for (String pcrName : newPCRMap.keySet()) {

        TblPcrManifest pcrManifest = new TblPcrManifest();
        pcrManifest.setName(pcrName);
        pcrManifest.setValue(newPCRMap.get(pcrName));
        pcrManifest.setMleId(tblMle);

        log.info(String.format("Creating Pcr manifest value for mle %s  version %s pcr name %s",
          pcrManifest.getMleId().getName(), pcrManifest.getMleId().getVersion(),
                                        pcrManifest.getName()));

        pcrManifestJpaController.create(pcrManifest);
      }
    }
View Full Code Here

Examples of com.intel.mtwilson.as.data.TblPcrManifest

         * @param pcrData: White list data sent by the user
         * @return : true if the call is successful or else exception.
         */
  public String addPCRWhiteList(PCRWhiteList pcrData) {
                                TblMle tblMle;
                                TblPcrManifest tblPcr;
                                try {
                                  tblMle = getMleDetails(pcrData.getMleName(),
                                            pcrData.getMleVersion(), pcrData.getOsName(),
                                            pcrData.getOsVersion(), pcrData.getOemName());
                                  if (tblMle == null && pcrData.getOemName() != null) {
View Full Code Here

Examples of com.intel.mtwilson.as.data.TblPcrManifest

         * @param mle_id : Identity of the MLE
         * @param pcrName : Name of the PCR
         * @return : Data row containing the PCR manifest details.
         */
  private TblPcrManifest getPCRWhiteListDetails(Integer mle_id, String pcrName) {
                                TblPcrManifest tblPcr;
                                validateNull("pcrName", pcrName);
                                tblPcr = pcrManifestJpaController.findByMleIdName(mle_id, pcrName);
                                return tblPcr;
  }
View Full Code Here

Examples of com.intel.mtwilson.as.data.TblPcrManifest

         * @param pcrData: White list data sent by the user
         * @return : true if the call is successful or else exception.
         */
  public String updatePCRWhiteList(PCRWhiteList pcrData) {
                                TblMle tblMle;
                                TblPcrManifest tblPcr;

                                try {
                                  tblMle = getMleDetails(pcrData.getMleName(),
                                            pcrData.getMleVersion(), pcrData.getOsName(),
                                            pcrData.getOsVersion(), pcrData.getOemName());
                                  if (tblMle == null && pcrData.getOemName() != null) {
                                        throw new ASException(ErrorCode.WS_MLE_OEM_DOES_NOT_EXIST, pcrData.getMleName(), pcrData.getMleVersion(), pcrData.getOemName());
                                    }
                                    if (tblMle == null && pcrData.getOsName() != null) {
                                        throw new ASException(ErrorCode.WS_MLE_OS_DOES_NOT_EXIST, pcrData.getMleName(), pcrData.getMleVersion(), pcrData.getOsName(),pcrData.getOsVersion());
                                    }

                                    // Now we need to check if PCR is already configured. If yes, then
                                    // we ned to ask the user to use the Update option instead of create
                                    tblPcr = getPCRWhiteListDetails(tblMle.getId(), pcrData.getPcrName());
                                    if (tblPcr == null) {
                                         throw new ASException(ErrorCode.WS_PCR_WHITELIST_DOES_NOT_EXIST, pcrData.getPcrName());
                                    }
                                    // Now update the pcr in the database.
                                    tblPcr.setValue(pcrData.getPcrDigest());
                                    pcrManifestJpaController.edit(tblPcr);

                                } catch (ASException ase) {
                                    throw ase;
                                } catch (Exception e) {
View Full Code Here

Examples of com.intel.mtwilson.as.data.TblPcrManifest

         * @param oemName : OEM Name associated with the BIOS MLE
         * @return
         */
  public String deletePCRWhiteList(String pcrName, String mleName, String mleVersion, String osName,
      String osVersion, String oemName) {
                                TblPcrManifest tblPcr;
                                TblMle tblMle;
                                try {
                                  tblMle = getMleDetails(mleName, mleVersion, osName, osVersion,oemName);
                                  if (tblMle == null && oemName != null) {
                                        throw new ASException(ErrorCode.WS_MLE_OEM_DOES_NOT_EXIST, mleName, mleVersion, oemName);
                                    }
                                    if (tblMle == null && osName != null) {
                                        throw new ASException(ErrorCode.WS_MLE_OS_DOES_NOT_EXIST, mleName, mleVersion, osName, osVersion);
                                    }
                                   
                                    // Now we need to check if PCR value exists. If it does, then we do delete or else
                                    // we still return true since the data does not exist.
                                    tblPcr = getPCRWhiteListDetails(tblMle.getId(), pcrName);
                                    if (tblPcr == null) {
                                      return "true";
                                    }

                                    // Delete the PCR white list entry.
                                    pcrManifestJpaController.destroy(tblPcr.getId());

                                } catch (ASException ase) {
                                        throw ase;
                                } catch (Exception e) {
                                    throw new ASException(e);
View Full Code Here

Examples of com.intel.mtwilson.as.data.TblPcrManifest

        return attestationReport;
    }
   
    public PcrLogReport getPcrManifestLog(TblHosts tblHosts, TblTaLog log, Boolean failureOnly) throws NumberFormatException {
        TblPcrManifest tblPcrManifest = getPcrModuleManifest(tblHosts,log.getMleId(),log.getManifestName());
        PcrLogReport manifest = new PcrLogReport();
        manifest.setName(Integer.parseInt(log.getManifestName()));
        manifest.setValue(log.getManifestValue());
        manifest.setVerifiedOn(log.getUpdatedOn());
        manifest.setTrustStatus(getTrustStatus(log.getTrustStatus()));
        manifest.setWhiteListValue(tblPcrManifest.getValue());
        return manifest;
    }
View Full Code Here

Examples of com.intel.mtwilson.as.data.TblPcrManifest

    public void edit(TblPcrManifest tblPcrManifest) throws NonexistentEntityException, ASDataException {
        EntityManager em = getEntityManager();
        try {
            em.getTransaction().begin();
            TblPcrManifest persistentTblPcrManifest = em.find(TblPcrManifest.class, tblPcrManifest.getId());
            // @since 1.1 we are relying on the audit log for "created on", "created by", etc. type information
            /*
            TblDbPortalUser updatedByOld = persistentTblPcrManifest.getUpdatedBy();
            TblDbPortalUser updatedByNew = tblPcrManifest.getUpdatedBy();
            TblDbPortalUser createdByOld = persistentTblPcrManifest.getCreatedBy();
            TblDbPortalUser createdByNew = tblPcrManifest.getCreatedBy();
            */
            TblMle mleIdOld = persistentTblPcrManifest.getMleId();
            TblMle mleIdNew = tblPcrManifest.getMleId();
            // @since 1.1 we are relying on the audit log for "created on", "created by", etc. type information
            /*
            if (updatedByNew != null) {
                updatedByNew = em.getReference(updatedByNew.getClass(), updatedByNew.getId());
View Full Code Here

Examples of com.intel.mtwilson.as.data.TblPcrManifest

    public void destroy(Integer id) throws NonexistentEntityException {
      EntityManager em = getEntityManager();
      try {
            em.getTransaction().begin();
            TblPcrManifest tblPcrManifest;
            try {
                tblPcrManifest = em.getReference(TblPcrManifest.class, id);
                tblPcrManifest.getId();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The tblPcrManifest with id " + id + " no longer exists.", enfe);
            }
            // @since 1.1 we are relying on the audit log for "created on", "created by", etc. type information
            /*
            TblDbPortalUser updatedBy = tblPcrManifest.getUpdatedBy();
            if (updatedBy != null) {
                updatedBy.getTblPcrManifestCollection().remove(tblPcrManifest);
                em.merge(updatedBy);
            }
            TblDbPortalUser createdBy = tblPcrManifest.getCreatedBy();
            if (createdBy != null) {
                createdBy.getTblPcrManifestCollection().remove(tblPcrManifest);
                em.merge(createdBy);
            }
            */
            TblMle mleId = tblPcrManifest.getMleId();
            if (mleId != null) {
                mleId.getTblPcrManifestCollection().remove(tblPcrManifest);
                em.merge(mleId);
            }
            em.remove(tblPcrManifest);
View Full Code Here

Examples of com.intel.mtwilson.as.data.TblPcrManifest

            query.setParameter("id", id);

            query.setHint(QueryHints.REFRESH, HintValues.TRUE);
            query.setHint(QueryHints.CACHE_USAGE, CacheUsage.DoNotCheckCache);

            TblPcrManifest manifest = (TblPcrManifest) query.getSingleResult();
            return manifest;

        } finally {
            em.close();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.