public static boolean isSelfIssued(X509Certificate cert){
  X500Principal subject=cert.getSubjectX500Principal();
  X500Principal issuer=cert.getIssuerX500Principal();
  return subject.equals(issuer);
}

public static boolean isSelfIssued ( X509Certificate cert ) { X500Principal subject = cert . getSubjectX500Principal ( ) ; X500Principal issuer = cert . getIssuerX500Principal ( ) ; return subject . equals ( issuer ) ; }
utility method to test if a certificate is self - issued . this is the case iff the subject and issuer x500principals are equal .
