summaryrefslogtreecommitdiffstats
path: root/ext/openssl/lib
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-24 04:24:06 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-24 04:24:06 +0000
commit3a85bf480b9aff0ff4d7a91f6364125b3470c377 (patch)
tree23540df00712afbd7cd41dc602e74507149045d8 /ext/openssl/lib
parent58098d909da1e83654b23a67cfa5d3349ebe77d4 (diff)
downloadruby-3a85bf480b9aff0ff4d7a91f6364125b3470c377.tar.gz
ruby-3a85bf480b9aff0ff4d7a91f6364125b3470c377.tar.xz
ruby-3a85bf480b9aff0ff4d7a91f6364125b3470c377.zip
* ext/openssl/ossl_x509hame.c (ossl_x509name_initialize): change
second argument. it expected to be a Hash not an Integer. * ext/openssl/ossl_x509name.c (ossl_x509name_add_entry): add new function for OpenSSL::X509::Name#add_entry. * ext/openssl/ossl_x509name.c (Init_ossl_x509name): add constants OpenSSL::X509::Name::DEFAULT_OBJECT_TYPE and OBJECT_TYPE_TEMPLATE. * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name#initialize): second argument takes OBJECT_TYPE_TEMPLATE by default. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/lib')
-rw-r--r--ext/openssl/lib/openssl/x509.rb23
1 files changed, 10 insertions, 13 deletions
diff --git a/ext/openssl/lib/openssl/x509.rb b/ext/openssl/lib/openssl/x509.rb
index 40b1a6dd1..6dd469827 100644
--- a/ext/openssl/lib/openssl/x509.rb
+++ b/ext/openssl/lib/openssl/x509.rb
@@ -14,9 +14,7 @@
$Id$
=end
-##
-# Should we care what if somebody require this file directly?
-#require 'openssl'
+require "openssl"
module OpenSSL
module X509
@@ -44,7 +42,7 @@ module OpenSSL
def create_ext_from_hash(hash)
create_ext(hash["oid"], hash["value"], hash["critical"])
end
- end # ExtensionFactory
+ end
class Extension
def to_s # "oid = critical, value"
@@ -61,14 +59,13 @@ module OpenSSL
def to_a
[ self.oid, self.value, self.critical? ]
end
- end # Extension
-
+ end
+
class Name
- def self.parse(str, type=ASN1::UTF8STRING)
- ary = str.scan(/\s*([^\/,]+)\s*/).collect{|i| i[0].split("=") }
- self.new(ary, type)
+ def self.parse(str, template=OBJECT_TYPE_TEMPLATE)
+ ary = str.scan(/\s*([^\/,]+)\s*/).collect{|i| i[0].split("=", 2) }
+ self.new(ary, template)
end
- end # Name
-
- end # X509
-end # OpenSSL
+ end
+ end
+end