コード例 #1
0
ファイル: POEExtraction.java プロジェクト: rvillido/dss
 private String getCertificateIdByDigest(
     XmlDigestAlgAndValueType digestAlgoValue, DiagnosticData diagnosticData) {
   List<CertificateWrapper> certificates = diagnosticData.getUsedCertificates();
   if (CollectionUtils.isNotEmpty(certificates)) {
     for (CertificateWrapper certificate : certificates) {
       List<XmlDigestAlgAndValueType> digestAlgAndValues = certificate.getDigestAlgAndValue();
       if (CollectionUtils.isNotEmpty(digestAlgAndValues)) {
         for (XmlDigestAlgAndValueType certificateDigestAndValue : digestAlgAndValues) {
           if (StringUtils.equals(
                   certificateDigestAndValue.getDigestMethod(), digestAlgoValue.getDigestMethod())
               && StringUtils.equals(
                   certificateDigestAndValue.getDigestValue(), digestAlgoValue.getDigestValue())) {
             return certificate.getId();
           }
         }
       }
     }
   }
   return null;
 }
コード例 #2
0
ファイル: POEExtraction.java プロジェクト: rvillido/dss
 public void init(DiagnosticData diagnosticData, Date currentTime) {
   Set<SignatureWrapper> signatures = diagnosticData.getAllSignatures();
   for (SignatureWrapper signature : signatures) {
     addPOE(signature.getId(), currentTime);
   }
   Set<TimestampWrapper> timestamps = diagnosticData.getAllTimestamps();
   for (TimestampWrapper timestamp : timestamps) {
     addPOE(timestamp.getId(), currentTime);
   }
   List<CertificateWrapper> usedCertificates = diagnosticData.getUsedCertificates();
   for (CertificateWrapper certificate : usedCertificates) {
     addPOE(certificate.getId(), currentTime);
     Set<RevocationWrapper> revocations = certificate.getRevocationData();
     if (CollectionUtils.isNotEmpty(revocations)) {
       for (RevocationWrapper revocation : revocations) {
         if (RevocationOrigin.SIGNATURE.name().equals(revocation.getOrigin())) {
           addPOE(revocation.getId(), currentTime);
         }
       }
     }
   }
 }
コード例 #3
0
ファイル: POEExtraction.java プロジェクト: rvillido/dss
 private String getRevocationIdByDigest(
     XmlDigestAlgAndValueType digestAlgoValue, DiagnosticData diagnosticData) {
   List<CertificateWrapper> certificates = diagnosticData.getUsedCertificates();
   if (CollectionUtils.isNotEmpty(certificates)) {
     for (CertificateWrapper certificate : certificates) {
       Set<RevocationWrapper> revocations = certificate.getRevocationData();
       if (CollectionUtils.isNotEmpty(revocations)) {
         for (RevocationWrapper revocationData : revocations) {
           List<XmlDigestAlgAndValueType> digestAlgAndValues =
               revocationData.getDigestAlgAndValue();
           for (XmlDigestAlgAndValueType revocDigestAndValue : digestAlgAndValues) {
             if (StringUtils.equals(
                     revocDigestAndValue.getDigestMethod(), digestAlgoValue.getDigestMethod())
                 && StringUtils.equals(
                     revocDigestAndValue.getDigestValue(), digestAlgoValue.getDigestValue())) {
               return revocationData.getId();
             }
           }
         }
       }
     }
   }
   return null;
 }