public boolean equals(Object obj){
  if (obj == this) {
    return true;
  }
  if (!(obj instanceof Certificate)) {
    return false;
  }
  Certificate object=(Certificate)obj;
  try {
    return Arrays.equals(getEncoded(),object.getEncoded());
  }
 catch (  CertificateEncodingException e) {
    return false;
  }
}

public boolean equals ( Object obj ) { if ( obj == this ) { return true ; } if ( ! ( obj instanceof Certificate ) ) { return false ; } Certificate object = ( Certificate ) obj ; try { return Arrays . equals ( getEncoded ( ) , object . getEncoded ( ) ) ; } catch ( CertificateEncodingException e ) { return false ; } }
compares the argument to this certificate . if both have the same bytes they are assumed to be equal .
