Rfc3161InternalHashAlgorithmsDeprecatedRule extends BaseRule { public VerificationErrorCode getErrorCode() { return VerificationErrorCode.INT_14; }  VerificationResultCode verifySignature(VerificationContext context); VerificationErrorCode getErrorCode();  }
@Test public void testSignatureVerification_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 testRfc3161SigAtrValidSha1_Ok() throws Exception { RuleResult result = rule.verify(build(TestUtil.loadSignature(RFC3161_SHA1_SIG_ATR_2016))); Assert.assertNotNull(result); Assert.assertEquals(result.getResultCode(), VerificationResultCode.OK); Assert.assertNull(result.getErrorCode()); }
@Test public void testRfc3161SigAtrDeprecatedSha1() throws Exception { RuleResult result = rule.verify(build(TestUtil.loadSignature(RFC3161_SHA1_SIG_ATR_2017))); Assert.assertEquals(result.getResultCode(), VerificationResultCode.FAIL); Assert.assertEquals(result.getErrorCode(), VerificationErrorCode.INT_14); }
@Test public void testRfc3161TstAlgorithmValidSha1_Ok() throws Exception { RuleResult result = rule.verify(build(TestUtil.loadSignature(RFC3161_SHA1_TST_ALGORITHM_2016))); Assert.assertNotNull(result); Assert.assertEquals(result.getResultCode(), VerificationResultCode.OK); Assert.assertNull(result.getErrorCode()); }
@Test public void testRfc3161TstAlgorithmDeprecatedSha1() throws Exception { RuleResult result = rule.verify(build(TestUtil.loadSignature(RFC3161_SHA1_TST_ALGORITHM_2017))); Assert.assertEquals(result.getResultCode(), VerificationResultCode.FAIL); Assert.assertEquals(result.getErrorCode(), VerificationErrorCode.INT_14); }