Skip to content

== on certificates seems to compare ... strings? #158

Closed

Description

@mcr

Given two instances of a certificate, how can I determine if it's the same certificate?
I feel that == ought to do the trick.
It does not, as I think it looks for eq() (same object).

I can get around this using, for instance: certA.to_der == certB.to_der, which gives me a byte-comparison equality. That's great if they are actually the identical certificate (which in my present case, I care about), but I find nothing to do essentially, if certA.issuer == certB.issuer, then certA.subject == certB.subject.
Should it be == that does this?

Activity

  1. rhenium commented on Oct 10, 2017

    @rhenium
    Member

    I think OpenSSL::X509::Certificate#== should do a byte-by-byte comparison.

  2. rhenium commented on Oct 22, 2017

    @rhenium
    Member

    #161 has been merged to master. v2.1.0 will include those == methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions