@Test public void validateSignResponseSignature_invalid() { DssMetadataService dssMetadataService = new DssMetadataService(Configuration.getParserPool()); ReflectionTestUtils.setField(dssMetadataService, "dssServiceMetadataEntityId", "http: ReflectionTestUtils.setField(dssMetadataService, "dssServiceMetadataResource", new ClassPathResource("dss/dss_valid_metadata.xml")); ReflectionTestUtils.setField(dssMetadataService, "keystorePassword", "password"); dssMetadataService.initDssMetadata(); DssSignMessageService service = new DssSignMessageService(dssMetadataService); ValidationResponse validationResponse = service .validateDssMessageSignature(getSignRequestString("dss/signed_invalid_signRequest.xml")); assertEquals("Signature", ValidationResult.INVALID, validationResponse.getSignatureValid()); assertEquals("Reference", ValidationResult.INVALID, validationResponse.getReferencesValid()); }
public ValidationResponse validateDssMessageSignature(String signResponseXmlString) { return verifySignature(signResponseXmlString); }
DssSignMessageService { public ValidationResponse validateDssMessageSignature(String signResponseXmlString) { return verifySignature(signResponseXmlString); } }
DssSignMessageService { public ValidationResponse validateDssMessageSignature(String signResponseXmlString) { return verifySignature(signResponseXmlString); } @Autowired  DssSignMessageService(DssMetadataService dssMetadataService); }
DssSignMessageService { public ValidationResponse validateDssMessageSignature(String signResponseXmlString) { return verifySignature(signResponseXmlString); } @Autowired  DssSignMessageService(DssMetadataService dssMetadataService); @PostConstruct void init(); String signSignRequest(SignRequest signRequest); ValidationResponse validateDssMessageSignature(String signResponseXmlString); }
DssSignMessageService { public ValidationResponse validateDssMessageSignature(String signResponseXmlString) { return verifySignature(signResponseXmlString); } @Autowired  DssSignMessageService(DssMetadataService dssMetadataService); @PostConstruct void init(); String signSignRequest(SignRequest signRequest); ValidationResponse validateDssMessageSignature(String signResponseXmlString); static final String DEFAULT_SIGN_ALGORITHM; }