diff options
author | GOTOU Yuuzou <gotoyuzo@notwork.org> | 2003-07-01 08:16:26 +0000 |
---|---|---|
committer | GOTOU Yuuzou <gotoyuzo@notwork.org> | 2003-07-01 08:16:26 +0000 |
commit | 9081fc39fa246746d995439a746484cc18bdf5db (patch) | |
tree | 8d3f76437d0182477ea183e44a28c7550ffc5b31 /lib | |
parent | 2bfddb6b55752d82e271f3cbbef9a135f786ef29 (diff) | |
download | ruby-openssl-history-9081fc39fa246746d995439a746484cc18bdf5db.tar.gz |
*** empty log message ***
Diffstat (limited to 'lib')
-rw-r--r-- | lib/openssl/x509.rb | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/lib/openssl/x509.rb b/lib/openssl/x509.rb index 0a31f6e..631f1d1 100644 --- a/lib/openssl/x509.rb +++ b/lib/openssl/x509.rb @@ -65,32 +65,19 @@ class ExtensionFactory end # ExtensionFactory class Extension - # note: Extension.new is UNDEFed! - use ExtensionFactory.create_extension - # - # to_a is built-in - # def to_s # "oid = critical, value" - ary = self.to_a - str = ary[0] + " = " - str += "critical, " if ary[2] == true - str += ary[1] + str = self.oid + str << " = " + str << "critical, " if self.critical? + str << self.value.gsub(/\n/, ", ") end def to_h # {"oid"=>sn|ln, "value"=>value, "critical"=>true|false} - ary = self.to_a - {"oid"=>ary[0],"value"=>ary[1],"critical"=>ary[2]} - end - - def oid - self.to_a[0] + {"oid"=>self.oid,"value"=>self.value,"critical"=>self.critical?} end - def value - self.to_a[1] - end - - def critical? - self.to_a[2] + def to_a + [ self.oid, self.value, self.critical? ] end end # Extension |