本文整理汇总了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();
}
}
示例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);
}
示例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()));
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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()));
}
示例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()));
}
示例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()));
}
示例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()));
}
示例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()));
}
示例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()));
}