aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-10-22 13:20:11 +0900
committerGitHub <noreply@github.com>2017-10-22 13:20:11 +0900
commitd834e8614b9847c442c4ccd2cd7db322aa25a0d1 (patch)
tree43f64bb4a782dc11d0300c50090dff7592fb04b6 /lib
parent897ee5ecfe78a6c86cc1821fdb00d799f06fbc71 (diff)
parent5c4af48a35c5c6bea10fd86a848a564e9f2f84b0 (diff)
downloadruby-openssl-d834e8614b9847c442c4ccd2cd7db322aa25a0d1.tar.gz
Merge pull request #161 from rhenium/ky/x509-implement-eq
x509*: implement ==
Diffstat (limited to 'lib')
-rw-r--r--lib/openssl/x509.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/openssl/x509.rb b/lib/openssl/x509.rb
index 6d31b98c..98358f90 100644
--- a/lib/openssl/x509.rb
+++ b/lib/openssl/x509.rb
@@ -41,6 +41,11 @@ module OpenSSL
end
class Extension
+ def ==(other)
+ return false unless Extension === other
+ to_der == other.to_der
+ end
+
def to_s # "oid = critical, value"
str = self.oid
str << " = "
@@ -160,6 +165,13 @@ module OpenSSL
end
end
+ class Attribute
+ def ==(other)
+ return false unless Attribute === other
+ to_der == other.to_der
+ end
+ end
+
class StoreContext
def cleanup
warn "(#{caller.first}) OpenSSL::X509::StoreContext#cleanup is deprecated with no replacement" if $VERBOSE
@@ -178,5 +190,26 @@ module OpenSSL
}
end
end
+
+ class CRL
+ def ==(other)
+ return false unless CRL === other
+ to_der == other.to_der
+ end
+ end
+
+ class Revoked
+ def ==(other)
+ return false unless Revoked === other
+ to_der == other.to_der
+ end
+ end
+
+ class Request
+ def ==(other)
+ return false unless Request === other
+ to_der == other.to_der
+ end
+ end
end
end