SignatureInputHashAlgorithmDeprecatedRule extends BaseRule { VerificationErrorCode getErrorCode() { return VerificationErrorCode.INT_13; }    }
@Test public void testSignatureVerificationWithNotDeprecatedAlgorithm_Ok() throws Exception { RuleResult result = rule.verify(build(TestUtil.loadSignature(SIGNATURE_2017_03_14))); Assert.assertNotNull(result); Assert.assertEquals(result.getResultCode(), VerificationResultCode.OK); Assert.assertNull(result.getErrorCode()); }
@Test public void testSignatureVerificationWithValidSha1Algorithm_Ok() throws Exception { KSISignature signature = TestUtil.loadSignature(SIGNATURE_SHA1_INPUT_HASH_OK); RuleResult result = rule.verify(build(signature)); Assert.assertNotNull(result); Assert.assertEquals(result.getResultCode(), VerificationResultCode.OK); Assert.assertNull(result.getErrorCode()); }
@Test public void testSignatureVerificationWithDeprecatedAlgorithm() throws Exception { RuleResult result = rule.verify(build(TestUtil.loadSignature(SIGNATURE_AGGREGATION_HASH_CHAIN_DEPRECATED_INPUT_ALGORITHM))); Assert.assertEquals(result.getResultCode(), VerificationResultCode.FAIL); Assert.assertEquals(result.getErrorCode(), VerificationErrorCode.INT_13); }
@Test public void testRfc3161SignatureVerificationWithValidSha1Algorithm_Ok() throws Exception { RuleResult result = rule.verify(build(TestUtil.loadSignature(RFC3161_SHA1_INPUT_HASH_2016))); Assert.assertNotNull(result); Assert.assertEquals(result.getResultCode(), VerificationResultCode.OK); Assert.assertNull(result.getErrorCode()); }
@Test public void testRfc3161SignatureVerificationWithDeprecatedAlgorithm() throws Exception { RuleResult result = rule.verify(build(TestUtil.loadSignature(RFC3161_SHA1_INPUT_HASH_2017))); Assert.assertEquals(result.getResultCode(), VerificationResultCode.FAIL); Assert.assertEquals(result.getErrorCode(), VerificationErrorCode.INT_13); }