### Question:
PKCS11SignatureToken implements SignatureToken { @Override public X509Certificate getCertificate() { logger.debug("Fetching certificate"); return privateKeyEntry.getCertificate().getCertificate(); } PKCS11SignatureToken(String pkcs11ModulePath, char[] password, int slotIndex);  PKCS11SignatureToken(String pkcs11ModulePath, PasswordInputCallback passwordCallback, int slotIndex);  PKCS11SignatureToken(String pkcs11ModulePath, char[] password, int slotIndex, String label);  PKCS11SignatureToken(String pkcs11ModulePath, PasswordInputCallback passwordCallback, int slotIndex,
                                String label); List<DSSPrivateKeyEntry> getPrivateKeyEntries(); void usePrivateKeyEntry(DSSPrivateKeyEntry keyEntry); @Override X509Certificate getCertificate(); @Override byte[] sign(DigestAlgorithm digestAlgorithm, byte[] dataToSign);  }### Answer:
@Test public void fetchCertificateFromSmartCard() throws Exception { X509Certificate certificate = this.signatureToken.getCertificate(); Assert.assertNotNull(certificate); Assert.assertThat(certificate.getSubjectDN().getName(), Matchers.containsString("CN")); }