当前位置: 首页>>代码示例>>Java>>正文


Java DetailedReport类代码示例

本文整理汇总了Java中eu.europa.esig.dss.validation.reports.DetailedReport的典型用法代码示例。如果您正苦于以下问题:Java DetailedReport类的具体用法?Java DetailedReport怎么用?Java DetailedReport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DetailedReport类属于eu.europa.esig.dss.validation.reports包,在下文中一共展示了DetailedReport类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: printDetailedReport

import eu.europa.esig.dss.validation.reports.DetailedReport; //导入依赖的package包/类
private void printDetailedReport(DetailedReport details) {
    try {
        System.out.println("\nDetailed report:");
        JAXBContext context = JAXBContext.newInstance(details.getJAXBModel().getClass());
        final Marshaller marshaller = context.createMarshaller();
        final StringWriter stringWriter = new StringWriter();
       // Marshal the javaObject and write the XML to the stringWriter
        marshaller.marshal(details.getJAXBModel(), stringWriter);
 
        // Print out the contents of the stringWriter
        System.out.println(stringWriter.toString() + "\n");
    } catch (JAXBException e) {
        System.err.println("Failed to print detailed report. ");
        e.printStackTrace();
    }
}
 
开发者ID:laverca,项目名称:laverca,代码行数:17,代码来源:XAdES.java

示例2: testValidate

import eu.europa.esig.dss.validation.reports.DetailedReport; //导入依赖的package包/类
@Test
public void testValidate() {
	SignedDocumentValidator validator = SignedDocumentValidator.fromDocument(new FileDocument(fileToTest));
	validator.setCertificateVerifier(new CommonCertificateVerifier());

	Reports validateDocument = validator.validateDocument();
	assertNotNull(validateDocument);

	DiagnosticData diagnosticData = validateDocument.getDiagnosticData();
	assertNotNull(diagnosticData);

	List<CertificateWrapper> usedCertificates = diagnosticData.getUsedCertificates();
	for (CertificateWrapper certificateWrapper : usedCertificates) {
		byte[] binaries = certificateWrapper.getBinaries();
		assertNotNull(DSSUtils.loadCertificate(binaries));
	}

	SimpleReport simpleReport = validateDocument.getSimpleReport();
	assertNotNull(simpleReport);

	DetailedReport detailedReport = validateDocument.getDetailedReport();
	assertNotNull(detailedReport);
}
 
开发者ID:esig,项目名称:dss,代码行数:24,代码来源:ETSISamplesValidationTest.java

示例3: rsa1023

import eu.europa.esig.dss.validation.reports.DetailedReport; //导入依赖的package包/类
@Test
public void rsa1023() throws Exception {
	FileInputStream fis = new FileInputStream("src/test/resources/rsa1023.xml");
	DiagnosticData diagnosticData = getJAXBObjectFromString(fis, DiagnosticData.class, "/xsd/DiagnosticData.xsd");
	assertNotNull(diagnosticData);

	CustomProcessExecutor executor = new CustomProcessExecutor();
	executor.setDiagnosticData(diagnosticData);
	executor.setValidationPolicy(loadPolicy());
	executor.setCurrentTime(diagnosticData.getValidationDate());

	Reports reports = executor.execute();

	SimpleReport simpleReport = reports.getSimpleReport();

	DetailedReport detailedReport = reports.getDetailedReport();
	assertEquals(Indication.INDETERMINATE, detailedReport.getBasicBuildingBlocksIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.CRYPTO_CONSTRAINTS_FAILURE_NO_POE, detailedReport.getBasicBuildingBlocksSubIndication(simpleReport.getFirstSignatureId()));

	assertEquals(Indication.INDETERMINATE, detailedReport.getLongTermValidationIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.CRYPTO_CONSTRAINTS_FAILURE_NO_POE, detailedReport.getLongTermValidationSubIndication(simpleReport.getFirstSignatureId()));

	assertEquals(Indication.INDETERMINATE, detailedReport.getArchiveDataValidationIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.NO_POE, detailedReport.getArchiveDataValidationSubIndication(simpleReport.getFirstSignatureId()));
}
 
开发者ID:esig,项目名称:dss,代码行数:26,代码来源:CustomProcessExecutorTest.java

示例4: testMultiSigs

import eu.europa.esig.dss.validation.reports.DetailedReport; //导入依赖的package包/类
@Test
public void testMultiSigs() throws Exception {
	FileInputStream fis = new FileInputStream("src/test/resources/multi-sign.xml");
	DiagnosticData diagnosticData = getJAXBObjectFromString(fis, DiagnosticData.class, "/xsd/DiagnosticData.xsd");
	assertNotNull(diagnosticData);

	CustomProcessExecutor executor = new CustomProcessExecutor();
	executor.setDiagnosticData(diagnosticData);
	executor.setValidationPolicy(loadPolicy());
	executor.setCurrentTime(diagnosticData.getValidationDate());

	Reports reports = executor.execute();

	SimpleReport simpleReport = reports.getSimpleReport();
	assertEquals(4, simpleReport.getJaxbModel().getSignaturesCount());

	LOG.info(reports.getXmlSimpleReport());

	DetailedReport detailedReport = reports.getDetailedReport();
	assertEquals(4, detailedReport.getSignatureIds().size());

	LOG.info(reports.getXmlDetailedReport());
}
 
开发者ID:esig,项目名称:dss,代码行数:24,代码来源:CustomProcessExecutorTest.java

示例5: testCounterSignature

import eu.europa.esig.dss.validation.reports.DetailedReport; //导入依赖的package包/类
@Test
public void testCounterSignature() throws Exception {
	FileInputStream fis = new FileInputStream("src/test/resources/counter-signature-diag-data.xml");
	DiagnosticData diagnosticData = getJAXBObjectFromString(fis, DiagnosticData.class, "/xsd/DiagnosticData.xsd");
	assertNotNull(diagnosticData);

	CustomProcessExecutor executor = new CustomProcessExecutor();
	executor.setDiagnosticData(diagnosticData);
	executor.setValidationPolicy(loadPolicy());
	executor.setCurrentTime(diagnosticData.getValidationDate());

	Reports reports = executor.execute();

	SimpleReport simpleReport = reports.getSimpleReport();
	assertEquals(2, simpleReport.getJaxbModel().getSignaturesCount());

	LOG.info(reports.getXmlSimpleReport());

	DetailedReport detailedReport = reports.getDetailedReport();
	assertEquals(2, detailedReport.getSignatureIds().size());

	LOG.info(reports.getXmlDetailedReport());
}
 
开发者ID:esig,项目名称:dss,代码行数:24,代码来源:CustomProcessExecutorTest.java

示例6: testValidate

import eu.europa.esig.dss.validation.reports.DetailedReport; //导入依赖的package包/类
@Test
public void testValidate() {
	SignedDocumentValidator validator = SignedDocumentValidator.fromDocument(new FileDocument(fileToTest));
	CommonCertificateVerifier certificateVerifier = new CommonCertificateVerifier();
	certificateVerifier.setDataLoader(new IgnoreDataLoader());
	validator.setCertificateVerifier(certificateVerifier);

	Reports validateDocument = validator.validateDocument();
	assertNotNull(validateDocument);

	DiagnosticData diagnosticData = validateDocument.getDiagnosticData();
	assertNotNull(diagnosticData);

	List<CertificateWrapper> usedCertificates = diagnosticData.getUsedCertificates();
	for (CertificateWrapper certificateWrapper : usedCertificates) {
		byte[] binaries = certificateWrapper.getBinaries();
		assertNotNull(DSSUtils.loadCertificate(binaries));
	}

	SimpleReport simpleReport = validateDocument.getSimpleReport();
	assertNotNull(simpleReport);

	DetailedReport detailedReport = validateDocument.getDetailedReport();
	assertNotNull(detailedReport);
}
 
开发者ID:esig,项目名称:dss,代码行数:26,代码来源:ETSISamplesValidationTest.java

示例7: testValidate

import eu.europa.esig.dss.validation.reports.DetailedReport; //导入依赖的package包/类
@Test
public void testValidate() {
	SignedDocumentValidator validator = SignedDocumentValidator.fromDocument(new FileDocument(fileToTest));
	validator.setCertificateVerifier(new CommonCertificateVerifier());

	Reports validateDocument = validator.validateDocument();
	assertNotNull(validateDocument);

	DiagnosticData diagnosticData = validateDocument.getDiagnosticData();
	assertNotNull(diagnosticData);

	SimpleReport simpleReport = validateDocument.getSimpleReport();
	assertNotNull(simpleReport);

	DetailedReport detailedReport = validateDocument.getDetailedReport();
	assertNotNull(detailedReport);
}
 
开发者ID:esig,项目名称:dss,代码行数:18,代码来源:ETSISamplesValidationTest.java

示例8: testValidate

import eu.europa.esig.dss.validation.reports.DetailedReport; //导入依赖的package包/类
@Test
public void testValidate() {
	SignedDocumentValidator validator = SignedDocumentValidator.fromDocument(new FileDocument(fileToTest));
	validator.setCertificateVerifier(new CommonCertificateVerifier());

	Reports validateDocument = validator.validateDocument();
	assertNotNull(validateDocument);

	DiagnosticData diagnosticData = validateDocument.getDiagnosticData();
	assertNotNull(diagnosticData);

	SimpleReport simpleReport = validateDocument.getSimpleReport();
	assertNotNull(simpleReport);

	DetailedReport detailedReport = validateDocument.getDetailedReport();
	assertNotNull(detailedReport);

	// validateDocument.print();
}
 
开发者ID:esig,项目名称:dss,代码行数:20,代码来源:ETSISamplesValidationTest.java

示例9: testValidate

import eu.europa.esig.dss.validation.reports.DetailedReport; //导入依赖的package包/类
@Test
public void testValidate() {
	SignedDocumentValidator validator = SignedDocumentValidator.fromDocument(new FileDocument(fileToTest));

	SignaturePolicyProvider signaturePolicyProvider = new SignaturePolicyProvider();
	Map<String, DSSDocument> signaturePoliciesByUrl = new HashMap<String, DSSDocument>();
	signaturePoliciesByUrl.put("https://www.sk.ee/repository/bdoc-spec21.pdf", new FileDocument(new File("src/test/resources/bdoc-spec21.pdf")));
	signaturePolicyProvider.setSignaturePoliciesByUrl(signaturePoliciesByUrl);
	validator.setSignaturePolicyProvider(signaturePolicyProvider);

	validator.setCertificateVerifier(new CommonCertificateVerifier());

	Reports validateDocument = validator.validateDocument();
	assertNotNull(validateDocument);

	DiagnosticData diagnosticData = validateDocument.getDiagnosticData();
	assertNotNull(diagnosticData);

	SimpleReport simpleReport = validateDocument.getSimpleReport();
	assertNotNull(simpleReport);

	DetailedReport detailedReport = validateDocument.getDetailedReport();
	assertNotNull(detailedReport);
}
 
开发者ID:esig,项目名称:dss,代码行数:25,代码来源:ETSISamplesValidationTest.java

示例10: signedDataNotFound

import eu.europa.esig.dss.validation.reports.DetailedReport; //导入依赖的package包/类
@Test
public void signedDataNotFound() throws Exception {
	FileInputStream fis = new FileInputStream("src/test/resources/signed_data_not_found.xml");
	DiagnosticData diagnosticData = getJAXBObjectFromString(fis, DiagnosticData.class, "/xsd/DiagnosticData.xsd");
	assertNotNull(diagnosticData);

	CustomProcessExecutor executor = new CustomProcessExecutor();
	executor.setDiagnosticData(diagnosticData);
	executor.setValidationPolicy(loadPolicy());
	executor.setCurrentTime(diagnosticData.getValidationDate());

	Reports reports = executor.execute();
	assertNotNull(reports);

	SimpleReport simpleReport = reports.getSimpleReport();
	assertEquals(Indication.INDETERMINATE, simpleReport.getIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.SIGNED_DATA_NOT_FOUND, simpleReport.getSubIndication(simpleReport.getFirstSignatureId()));

	DetailedReport detailedReport = reports.getDetailedReport();
	assertEquals(Indication.INDETERMINATE, detailedReport.getBasicValidationIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.SIGNED_DATA_NOT_FOUND, detailedReport.getBasicValidationSubIndication(simpleReport.getFirstSignatureId()));

	assertEquals(0, detailedReport.getTimestampIds().size());

	assertEquals(Indication.INDETERMINATE, detailedReport.getLongTermValidationIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.SIGNED_DATA_NOT_FOUND, detailedReport.getLongTermValidationSubIndication(simpleReport.getFirstSignatureId()));

	assertEquals(Indication.INDETERMINATE, detailedReport.getArchiveDataValidationIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.SIGNED_DATA_NOT_FOUND, detailedReport.getArchiveDataValidationSubIndication(simpleReport.getFirstSignatureId()));
}
 
开发者ID:esig,项目名称:dss,代码行数:31,代码来源:CustomProcessExecutorTest.java

示例11: noPoeRevokedNoTimestamp

import eu.europa.esig.dss.validation.reports.DetailedReport; //导入依赖的package包/类
@Test
public void noPoeRevokedNoTimestamp() throws Exception {
	FileInputStream fis = new FileInputStream("src/test/resources/no_poe_revoked_no_timestamp.xml");
	DiagnosticData diagnosticData = getJAXBObjectFromString(fis, DiagnosticData.class, "/xsd/DiagnosticData.xsd");
	assertNotNull(diagnosticData);

	CustomProcessExecutor executor = new CustomProcessExecutor();
	executor.setDiagnosticData(diagnosticData);
	executor.setValidationPolicy(loadPolicy());
	executor.setCurrentTime(diagnosticData.getValidationDate());

	Reports reports = executor.execute();
	assertNotNull(reports);

	SimpleReport simpleReport = reports.getSimpleReport();
	assertEquals(Indication.INDETERMINATE, simpleReport.getIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.NO_POE, simpleReport.getSubIndication(simpleReport.getFirstSignatureId()));

	DetailedReport detailedReport = reports.getDetailedReport();
	assertEquals(Indication.INDETERMINATE, detailedReport.getBasicValidationIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.REVOKED_NO_POE, detailedReport.getBasicValidationSubIndication(simpleReport.getFirstSignatureId()));

	assertEquals(0, detailedReport.getTimestampIds().size());

	assertEquals(Indication.INDETERMINATE, detailedReport.getLongTermValidationIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.REVOKED_NO_POE, detailedReport.getLongTermValidationSubIndication(simpleReport.getFirstSignatureId()));

	assertEquals(Indication.INDETERMINATE, detailedReport.getArchiveDataValidationIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.NO_POE, detailedReport.getArchiveDataValidationSubIndication(simpleReport.getFirstSignatureId()));
}
 
开发者ID:esig,项目名称:dss,代码行数:31,代码来源:CustomProcessExecutorTest.java

示例12: passedRevokedWithTimestamp

import eu.europa.esig.dss.validation.reports.DetailedReport; //导入依赖的package包/类
@Test
public void passedRevokedWithTimestamp() throws Exception {
	FileInputStream fis = new FileInputStream("src/test/resources/passed_revoked_with_timestamp.xml");
	DiagnosticData diagnosticData = getJAXBObjectFromString(fis, DiagnosticData.class, "/xsd/DiagnosticData.xsd");
	assertNotNull(diagnosticData);

	CustomProcessExecutor executor = new CustomProcessExecutor();
	executor.setDiagnosticData(diagnosticData);
	executor.setValidationPolicy(loadPolicy());
	executor.setCurrentTime(diagnosticData.getValidationDate());

	Reports reports = executor.execute();
	assertNotNull(reports);

	SimpleReport simpleReport = reports.getSimpleReport();
	assertEquals(Indication.TOTAL_PASSED, simpleReport.getIndication(simpleReport.getFirstSignatureId()));

	DetailedReport detailedReport = reports.getDetailedReport();
	assertEquals(Indication.INDETERMINATE, detailedReport.getBasicValidationIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.REVOKED_NO_POE, detailedReport.getBasicValidationSubIndication(simpleReport.getFirstSignatureId()));

	List<String> timestampIds = detailedReport.getTimestampIds();
	assertEquals(1, timestampIds.size());

	assertEquals(Indication.PASSED, detailedReport.getTimestampValidationIndication(timestampIds.get(0)));

	assertEquals(Indication.PASSED, detailedReport.getLongTermValidationIndication(simpleReport.getFirstSignatureId()));

	assertEquals(Indication.PASSED, detailedReport.getArchiveDataValidationIndication(simpleReport.getFirstSignatureId()));
}
 
开发者ID:esig,项目名称:dss,代码行数:31,代码来源:CustomProcessExecutorTest.java

示例13: passedOutOfBoundsWithTimestamps

import eu.europa.esig.dss.validation.reports.DetailedReport; //导入依赖的package包/类
@Test
public void passedOutOfBoundsWithTimestamps() throws Exception {
	FileInputStream fis = new FileInputStream("src/test/resources/passed_out_of_bounds_with_timestamps.xml");
	DiagnosticData diagnosticData = getJAXBObjectFromString(fis, DiagnosticData.class, "/xsd/DiagnosticData.xsd");
	assertNotNull(diagnosticData);

	CustomProcessExecutor executor = new CustomProcessExecutor();
	executor.setDiagnosticData(diagnosticData);
	executor.setValidationPolicy(loadPolicy());
	executor.setCurrentTime(diagnosticData.getValidationDate());

	Reports reports = executor.execute();
	assertNotNull(reports);

	SimpleReport simpleReport = reports.getSimpleReport();
	assertEquals(Indication.TOTAL_PASSED, simpleReport.getIndication(simpleReport.getFirstSignatureId()));

	DetailedReport detailedReport = reports.getDetailedReport();
	assertEquals(Indication.INDETERMINATE, detailedReport.getBasicValidationIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.OUT_OF_BOUNDS_NO_POE, detailedReport.getBasicValidationSubIndication(simpleReport.getFirstSignatureId()));

	List<String> timestampIds = detailedReport.getTimestampIds();
	assertEquals(5, timestampIds.size());
	for (String tspId : timestampIds) {
		assertEquals(Indication.PASSED, detailedReport.getTimestampValidationIndication(tspId));
	}

	assertEquals(Indication.INDETERMINATE, detailedReport.getLongTermValidationIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.OUT_OF_BOUNDS_NO_POE, detailedReport.getLongTermValidationSubIndication(simpleReport.getFirstSignatureId()));

	assertEquals(Indication.PASSED, detailedReport.getArchiveDataValidationIndication(simpleReport.getFirstSignatureId()));
}
 
开发者ID:esig,项目名称:dss,代码行数:33,代码来源:CustomProcessExecutorTest.java

示例14: timestampsSameSecond

import eu.europa.esig.dss.validation.reports.DetailedReport; //导入依赖的package包/类
@Test
public void timestampsSameSecond() throws Exception {
	FileInputStream fis = new FileInputStream("src/test/resources/timestamps_same_second.xml");
	DiagnosticData diagnosticData = getJAXBObjectFromString(fis, DiagnosticData.class, "/xsd/DiagnosticData.xsd");
	assertNotNull(diagnosticData);

	CustomProcessExecutor executor = new CustomProcessExecutor();
	executor.setDiagnosticData(diagnosticData);
	executor.setValidationPolicy(loadPolicy());
	executor.setCurrentTime(diagnosticData.getValidationDate());

	Reports reports = executor.execute();
	assertNotNull(reports);

	SimpleReport simpleReport = reports.getSimpleReport();
	assertEquals(Indication.TOTAL_PASSED, simpleReport.getIndication(simpleReport.getFirstSignatureId()));

	List<String> warnings = simpleReport.getWarnings(simpleReport.getFirstSignatureId());
	assertFalse(warnings.contains(MessageTag.TSV_ASTPTCT_ANS.getMessage()));

	DetailedReport detailedReport = reports.getDetailedReport();
	assertEquals(Indication.INDETERMINATE, detailedReport.getBasicValidationIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.REVOKED_NO_POE, detailedReport.getBasicValidationSubIndication(simpleReport.getFirstSignatureId()));

	List<String> timestampIds = detailedReport.getTimestampIds();
	assertEquals(5, timestampIds.size());
	for (String tspId : timestampIds) {
		assertEquals(Indication.PASSED, detailedReport.getTimestampValidationIndication(tspId));
	}

	assertEquals(Indication.PASSED, detailedReport.getLongTermValidationIndication(simpleReport.getFirstSignatureId()));

	assertEquals(Indication.PASSED, detailedReport.getArchiveDataValidationIndication(simpleReport.getFirstSignatureId()));
}
 
开发者ID:esig,项目名称:dss,代码行数:35,代码来源:CustomProcessExecutorTest.java

示例15: timestampsIncorrectOrder

import eu.europa.esig.dss.validation.reports.DetailedReport; //导入依赖的package包/类
@Test
public void timestampsIncorrectOrder() throws Exception {
	FileInputStream fis = new FileInputStream("src/test/resources/timestamps_same_second_incorrect_order.xml");
	DiagnosticData diagnosticData = getJAXBObjectFromString(fis, DiagnosticData.class, "/xsd/DiagnosticData.xsd");
	assertNotNull(diagnosticData);

	CustomProcessExecutor executor = new CustomProcessExecutor();
	executor.setDiagnosticData(diagnosticData);
	executor.setValidationPolicy(loadPolicy());
	executor.setCurrentTime(diagnosticData.getValidationDate());

	Reports reports = executor.execute();
	assertNotNull(reports);

	SimpleReport simpleReport = reports.getSimpleReport();
	assertEquals(Indication.TOTAL_PASSED, simpleReport.getIndication(simpleReport.getFirstSignatureId()));

	List<String> warnings = simpleReport.getWarnings(simpleReport.getFirstSignatureId());
	assertTrue(warnings.contains(MessageTag.TSV_ASTPTCT_ANS.getMessage()));

	DetailedReport detailedReport = reports.getDetailedReport();
	assertEquals(Indication.INDETERMINATE, detailedReport.getBasicValidationIndication(simpleReport.getFirstSignatureId()));
	assertEquals(SubIndication.REVOKED_NO_POE, detailedReport.getBasicValidationSubIndication(simpleReport.getFirstSignatureId()));

	List<String> timestampIds = detailedReport.getTimestampIds();
	assertEquals(5, timestampIds.size());
	for (String tspId : timestampIds) {
		assertEquals(Indication.PASSED, detailedReport.getTimestampValidationIndication(tspId));
	}

	assertEquals(Indication.PASSED, detailedReport.getLongTermValidationIndication(simpleReport.getFirstSignatureId()));

	assertEquals(Indication.PASSED, detailedReport.getArchiveDataValidationIndication(simpleReport.getFirstSignatureId()));
}
 
开发者ID:esig,项目名称:dss,代码行数:35,代码来源:CustomProcessExecutorTest.java


注:本文中的eu.europa.esig.dss.validation.reports.DetailedReport类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。