### Question:
MSAuthCodeTimeStampSigner extends BaseSigner { @Override public List<String> getCertificateIssues(List<Certificate> certificateChain) { final List<String> results = super.getCertificateIssues(certificateChain); if (!certificateChain.isEmpty()) { results.addAll(checkTimeStampCertificate(certificateChain.get(0))); } return results; }  @Override void init(final int signerId, final WorkerConfig config,
            final WorkerContext workerContext,
            final EntityManager workerEntityManager); @Override Response processData(final Request signRequest,
            final RequestContext requestContext); BigInteger getSerno(); @Override List<String> getCertificateIssues(List<Certificate> certificateChain); static final String TIMESOURCE; static final String SIGNATUREALGORITHM; static final String ACCEPTEDALGORITHMS; static final String ACCEPTEDPOLICIES; static final String ACCEPTEDEXTENSIONS; static final String DEFAULTTSAPOLICYOID; static final String ACCURACYMICROS; static final String ACCURACYMILLIS; static final String ACCURACYSECONDS; static final String ORDERING; static final String TSA; static final String REQUIREVALIDCHAIN; static final String INCLUDE_SIGNING_CERTIFICATE_ATTRIBUTE; }### Answer:
@Test public void testCertificateIssues() throws Exception { LOG.info(">testCertificateIssues"); MSAuthCodeTimeStampSigner instance = new MSAuthCodeTimeStampSigner(); final Certificate certNoEku = new JcaX509CertificateConverter().getCertificate(new CertBuilder().setSubject("CN=Without EKU").build()); assertEquals(Arrays.asList("Missing extended key usage timeStamping", "The extended key usage extension must be present and marked as critical"), instance.getCertificateIssues(Arrays.asList(certNoEku))); boolean critical = false; final Certificate certEku = new JcaX509CertificateConverter().getCertificate(new CertBuilder().setSubject("CN=With non-critical EKU").addExtension(new CertExt(Extension.extendedKeyUsage, critical, new ExtendedKeyUsage(KeyPurposeId.id_kp_timeStamping))).build()); assertEquals(Arrays.asList("The extended key usage extension must be present and marked as critical"), instance.getCertificateIssues(Arrays.asList(certEku))); critical = true; final Certificate certCritEkuButAlsoOther = new JcaX509CertificateConverter().getCertificate(new CertBuilder().setSubject("CN=With critical EKU and other").addExtension(new CertExt(Extension.extendedKeyUsage, critical, new ExtendedKeyUsage(new KeyPurposeId[] { KeyPurposeId.id_kp_timeStamping, KeyPurposeId.id_kp_codeSigning }))).build()); assertEquals(Arrays.asList("No other extended key usages than timeStamping is allowed"), instance.getCertificateIssues(Arrays.asList(certCritEkuButAlsoOther))); critical = true; final Certificate certCritEku = new JcaX509CertificateConverter().getCertificate(new CertBuilder().setSubject("CN=With critical EKU").addExtension(new CertExt(Extension.extendedKeyUsage, critical, new ExtendedKeyUsage(KeyPurposeId.id_kp_timeStamping))).build()); assertEquals(Collections.<String>emptyList(), instance.getCertificateIssues(Arrays.asList(certCritEku))); }