@Test public void testNonX509Certificate() throws Exception { VerificationContext context = Mockito.mock(VerificationContext.class); KSISignature signature = TestUtil.loadSignature(SIGNATURE_2017_03_14); Mockito.when(context.getSignature()).thenReturn(signature); Mockito.when(context.getCalendarAuthenticationRecord()).thenReturn(signature.getCalendarAuthenticationRecord()); Mockito.when(context.getCertificate(Mockito.any(byte[].class))).thenReturn(Mockito.mock(Certificate.class)); RuleResult result = rule.verify(context); Assert.assertEquals(result.getResultCode(), VerificationResultCode.FAIL); Assert.assertEquals(result.getErrorCode(), VerificationErrorCode.KEY_03); }
public VerificationErrorCode getErrorCode() { return VerificationErrorCode.KEY_03; }
CertificateValidityRule extends BaseRule { public VerificationErrorCode getErrorCode() { return VerificationErrorCode.KEY_03; } }
CertificateValidityRule extends BaseRule { public VerificationErrorCode getErrorCode() { return VerificationErrorCode.KEY_03; }  }
CertificateValidityRule extends BaseRule { public VerificationErrorCode getErrorCode() { return VerificationErrorCode.KEY_03; }  VerificationResultCode verifySignature(VerificationContext context); VerificationErrorCode getErrorCode(); }
CertificateValidityRule extends BaseRule { public VerificationErrorCode getErrorCode() { return VerificationErrorCode.KEY_03; }  VerificationResultCode verifySignature(VerificationContext context); VerificationErrorCode getErrorCode();  }