/** * Adds a CRL to this revocation data set. * * @param crl */ public void addCRL(X509CRL crl) { byte[] encodedCrl; try { encodedCrl = crl.getEncoded(); } catch (CRLException e) { throw new IllegalArgumentException("CRL coding error: " + e.getMessage(), e); } addCRL(encodedCrl); }
RevocationData tsaRevocationDataXadesT = new RevocationData(); LOG.debug("creating XAdES-T time-stamp"); XAdESTimeStampType signatureTimeStamp = createXAdESTimeStamp(Collections.singletonList(signatureValueNode), if (tsaRevocationDataXadesT.hasRevocationDataEntries()) { ValidationDataType validationData = createValidationData(tsaRevocationDataXadesT); try { if (revocationData.hasCRLs()) { CRLRefsType crlRefs = this.objectFactory.createCRLRefsType(); completeRevocationRefs.setCRLRefs(crlRefs); List<CRLRefType> crlRefList = crlRefs.getCRLRef(); List<byte[]> crls = revocationData.getCRLs(); for (byte[] encodedCrl : crls) { CRLRefType crlRef = this.objectFactory.createCRLRefType(); if (revocationData.hasOCSPs()) { OCSPRefsType ocspRefs = this.objectFactory.createOCSPRefsType(); completeRevocationRefs.setOCSPRefs(ocspRefs); List<OCSPRefType> ocspRefList = ocspRefs.getOCSPRef(); List<byte[]> ocsps = revocationData.getOCSPs(); for (byte[] ocsp : ocsps) { OCSPRefType ocspRef = this.objectFactory.createOCSPRefType(); RevocationData tsaRevocationDataXadesX1 = new RevocationData(); LOG.debug("creating XAdES-X time-stamp"); XAdESTimeStampType timeStampXadesX1 = createXAdESTimeStamp(timeStampNodesXadesX1, tsaRevocationDataXadesX1, this.c14nAlgoId, this.timeStampService, this.objectFactory, this.xmldsigObjectFactory);
RevocationData revocationData = new RevocationData(); CRLValuesType crlValues = revocationValues.getCRLValues(); if (null != crlValues) { for (EncapsulatedPKIDataType encapsulatedCRLValue : encapsulatedCRLValueList) { byte[] crl = encapsulatedCRLValue.getValue(); revocationData.addCRL(crl); for (EncapsulatedPKIDataType encapsulatedOCSPValue : encapsulatedOCSPValueList) { byte[] ocsp = encapsulatedOCSPValue.getValue(); revocationData.addOCSP(ocsp);
private RevocationValuesType createRevocationValues(RevocationData revocationData) { RevocationValuesType revocationValues = this.objectFactory.createRevocationValuesType(); if (revocationData.hasCRLs()) { CRLValuesType crlValues = this.objectFactory.createCRLValuesType(); revocationValues.setCRLValues(crlValues); List<EncapsulatedPKIDataType> encapsulatedCrlValues = crlValues.getEncapsulatedCRLValue(); List<byte[]> crls = revocationData.getCRLs(); for (byte[] crl : crls) { EncapsulatedPKIDataType encapsulatedCrlValue = this.objectFactory.createEncapsulatedPKIDataType(); encapsulatedCrlValue.setValue(crl); encapsulatedCrlValues.add(encapsulatedCrlValue); } } if (revocationData.hasOCSPs()) { OCSPValuesType ocspValues = this.objectFactory.createOCSPValuesType(); revocationValues.setOCSPValues(ocspValues); List<EncapsulatedPKIDataType> encapsulatedOcspValues = ocspValues.getEncapsulatedOCSPValue(); List<byte[]> ocsps = revocationData.getOCSPs(); for (byte[] ocsp : ocsps) { EncapsulatedPKIDataType encapsulatedOcspValue = this.objectFactory.createEncapsulatedPKIDataType(); encapsulatedOcspValue.setValue(ocsp); encapsulatedOcspValues.add(encapsulatedOcspValue); } } return revocationValues; } }
for (EncapsulatedPKIDataType encapsulatedCrl : encapsulatedCrls) { byte[] encodedCrl = encapsulatedCrl.getValue(); revocationData.addCRL(encodedCrl); for (EncapsulatedPKIDataType encapsulatedOcsp : encapsulatedOcsps) { byte[] encodedOcsp = encapsulatedOcsp.getValue(); revocationData.addOCSP(encodedOcsp);