Issue #5103 has been updated by Eric Hodel.


Is object equality on ASN.1 structures not useful or hard?
----------------------------------------
Feature #5103: [ext/openssl] Object equality for objects based on ASN.1 structures
http://redmine.ruby-lang.org/issues/5103

Author: Martin Bosslet
Status: Feedback
Priority: Normal
Assignee: Martin Bosslet
Category: ext
Target version: 1.9.4


Equality behaviour is not overridden by any of the classes that base on ASN.1 structures. This leads to
counterintuitive things such as

    require 'openssl'
    key = OpenSSL::PKey::RSA.new 256

    puts [key].include?(key) # => true

    key2 = OpenSSL::PKey.read key.to_pem

    puts key == key2 # => false
    puts [key].include?(key2) # => false

That's why I'd like to suggest to determine equality for these objects on the encoding level, i.e.
two such objects are equal iff obj1.to_der == obj2.to_der. 


-- 
http://redmine.ruby-lang.org