### Question:
Certificate extends ArchivableEntity { public boolean isIssuer(final Certificate issuer) throws IOException { CertificateType cType = issuer.getCertificateType(); if (cType != CertificateType.X509_CERTIFICATE) { throw new IllegalArgumentException("issuer cert must be X509Certificate"); } boolean isIssuer = false; X509Certificate issuerX509 = issuer.getX509Certificate(); switch (getCertificateType()) { case X509_CERTIFICATE: X509Certificate certX509 = getX509Certificate(); try { certX509.verify(issuerX509.getPublicKey()); isIssuer = true; } catch (CertificateException | NoSuchAlgorithmException | InvalidKeyException | NoSuchProviderException | SignatureException e) { LOGGER.error(e); } break; case ATTRIBUTE_CERTIFICATE: AttributeCertificate attCert = getAttributeCertificate(); String algorith = "SHA256withRSA"; try { Signature sig = Signature.getInstance(algorith); sig.initVerify(issuerX509.getPublicKey()); sig.update(attCert.getAcinfo().getEncoded()); isIssuer = sig.verify(attCert.getSignatureValue().getBytes()); } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) { LOGGER.error(e); } break; default: break; } return isIssuer; } protected  Certificate();  Certificate(final Path certificatePath); @SuppressWarnings("methodlength")  Certificate(final byte[] certificateBytes); int getX509CredentialVersion(); boolean isIssuer(final Certificate issuer); boolean isValidOn(final Date date); @JsonIgnore X509Certificate getX509Certificate(); @JsonIgnore X509AttributeCertificateHolder getX509AttributeCertificateHolder(); @JsonIgnore AttributeCertificate getAttributeCertificate(); String getAuthInfoAccess(); String getAuthKeyId(); String getCrlPoints(); byte[] getPolicyConstraints(); String getKeyUsage(); String getExtendedKeyUsage(); String getSignatureAlgorithm(); String getPublicKeyAlgorithm(); BigInteger getSerialNumber(); BigInteger getAuthoritySerialNumber(); BigInteger getHolderSerialNumber(); String getHolderIssuer(); String getIssuer(); String getSubject(); int getPublicKeySize(); byte[] getEncodedPublicKey(); String getPublicKeyModulusHexValue(); byte[] getSignature(); Date getBeginValidity(); Date getEndValidity(); int getCertificateHash(); String getIssuerOrganization(); String getSubjectOrganization(); @JsonIgnore byte[] getRawBytes(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); static byte[] readBytes(final Path certificatePath); static BigInteger getPublicKeyModulus(final X509Certificate certificate); static BigInteger getPublicKeyModulus(final PublicKey publicKey); static X500Name[] getAttributeCertificateIssuerNames(final AttCertIssuer issuer); static Date recoverDate(final ASN1GeneralizedTime time); static final int HEX_BASE; static final int MIN_ATTR_CERT_LENGTH; static final String ID_FIELD; static final String ARCHIVE_FIELD; static final String SERIAL_NUMBER_FIELD; static final String ISSUER_FIELD; static final String SUBJECT_FIELD; static final String ISSUER_ORGANIZATION_FIELD; static final String SUBJECT_ORGANIZATION_FIELD; static final String ENCODED_PUBLIC_KEY_FIELD; static final String PUBLIC_KEY_MODULUS_FIELD; static final String CERTIFICATE_HASH_FIELD; static final String HOLDER_SERIAL_NUMBER_FIELD; }### Answer:
@Test public void testIsIssuer() throws CertificateException, IOException, NoSuchProviderException, URISyntaxException { Certificate issuerCert = getTestCertificate(FAKE_ROOT_CA_FILE); Certificate cert = getTestCertificate(INT_CA_CERT02); Assert.assertFalse(issuerCert.isIssuer(cert)); Assert.assertTrue(cert.isIssuer(issuerCert)); }