title: how to compare distinct implementations of java.security.cert.X509Certificate
body: <p>I'm using bouncycastle org.bouncycastle.jce.provider.X509CertificateObject and sun.security.x509.X509CertImpl in different parts of my app, and sometimes I need to compare them for equality, equals() method is not working and methods like getSubjectDN().getName() display different results for each of these implementations, how could I compare these certificates for equality without going to binary DER or PEM comparison?</p>