@Override
    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }

        if (o instanceof OpenSSLRSAPublicKey) {
            OpenSSLRSAPublicKey other = (OpenSSLRSAPublicKey) o;

            /*
             * We can shortcut the true case, but it still may be equivalent but
             * different copies.
             */
            if (key.equals(other.getOpenSSLKey())) {
                return true;
            }
        }

        if (!(o instanceof RSAPublicKey)) {
            return false;
        }

        ensureReadParams();

        RSAPublicKey other = (RSAPublicKey) o;
        return modulus.equals(other.getModulus())
                && publicExponent.equals(other.getPublicExponent());
    }
An implementation of {@link java.security.PublicKey} for RSA keys which uses BoringSSL to
perform all the operations.
common/src/main/java/org/conscrypt/OpenSSLRSAPublicKey.java