[前][次][番号順一覧][スレッド一覧]

ruby-changes:27257

From: drbrain <ko1@a...>
Date: Tue, 19 Feb 2013 10:27:43 +0900 (JST)
Subject: [ruby-changes:27257] drbrain:r39309 (trunk): * ext/openssl/ossl.c (class OpenSSL): Fixed ExtensionFactory example.

drbrain	2013-02-19 10:27:33 +0900 (Tue, 19 Feb 2013)

  New Revision: 39309

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39309

  Log:
    * ext/openssl/ossl.c (class OpenSSL):  Fixed ExtensionFactory example.
      Patch by Richard Bradley.  [ruby-trunk - Bug #7551]

  Modified files:
    trunk/ChangeLog
    trunk/ext/openssl/ossl.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39308)
+++ ChangeLog	(revision 39309)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Feb 19 10:27:12 2013  Eric Hodel  <drbrain@s...>
+
+	* ext/openssl/ossl.c (class OpenSSL):  Fixed ExtensionFactory example.
+	  Patch by Richard Bradley.  [ruby-trunk - Bug #7551]
+
 Tue Feb 19 08:32:11 2013  Koichi Sasada  <ko1@a...>
 
 	* vm_eval.c (vm_call0_body): check interrupts after method dispatch
Index: ext/openssl/ossl.c
===================================================================
--- ext/openssl/ossl.c	(revision 39308)
+++ ext/openssl/ossl.c	(revision 39309)
@@ -701,10 +701,15 @@ ossl_fips_mode_set(VALUE self, VALUE ena https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl.c#L701
  *
  *   extension_factory = OpenSSL::X509::ExtensionFactory.new nil, cert
  *
- *   extension_factory.create_extension 'basicConstraints', 'CA:FALSE'
- *   extension_factory.create_extension 'keyUsage',
- *     'keyEncipherment,dataEncipherment,digitalSignature'
- *   extension_factory.create_extension 'subjectKeyIdentifier', 'hash'
+ *   cert.add_extension(extension_factory.create_extension
+ *     'basicConstraints', 'CA:FALSE')
+ *   cert.add_extension(extension_factory.create_extension
+ *     'keyUsage', 'keyEncipherment,dataEncipherment,digitalSignature')
+ *   cert.add_extension(extension_factory.create_extension
+ *     'subjectKeyIdentifier', 'hash')
+ *
+ * The list of supported extensions (and in some cases their possible values)
+ * can be derived from the "objects.h" file in the OpenSSL source code.
  *
  * === Signing a Certificate
  *
@@ -772,16 +777,19 @@ ossl_fips_mode_set(VALUE self, VALUE ena https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl.c#L777
  *   extension_factory.subject_certificate = ca_cert
  *   extension_factory.issuer_certificate = ca_cert
  *
- *   extension_factory.create_extension 'subjectKeyIdentifier', 'hash'
+ *   ca_cert.add_extension(extension_factory.create_extension
+ *     'subjectKeyIdentifier', 'hash')
  *
  * This extension indicates the CA's key may be used as a CA.
  *
- *   extension_factory.create_extension 'basicConstraints', 'CA:TRUE', true
+ *   ca_cert.add_extension(extension_factory.create_extension
+ *     'basicConstraints', 'CA:TRUE', true)
  *
  * This extension indicates the CA's key may be used to verify signatures on
  * both certificates and certificate revocations.
  *
- *   extension_factory.create_extension 'keyUsage', 'cRLSign,keyCertSign', true
+ *   ca_cert.add_extension(extension_factory.create_extension
+ *     'keyUsage', 'cRLSign,keyCertSign', true)
  *
  * Root CA certificates are self-signed.
  *
@@ -837,10 +845,12 @@ ossl_fips_mode_set(VALUE self, VALUE ena https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl.c#L845
  *   extension_factory.subject_certificate = csr_cert
  *   extension_factory.issuer_certificate = ca_cert
  *
- *   extension_factory.create_extension 'basicConstraints', 'CA:FALSE'
- *   extension_factory.create_extension 'keyUsage',
- *     'keyEncipherment,dataEncipherment,digitalSignature'
- *   extension_factory.create_extension 'subjectKeyIdentifier', 'hash'
+ *   csr_cert.add_extension(extension_factory.create_extension
+ *     'basicConstraints', 'CA:FALSE')
+ *   csr_cert.add_extension(extension_factory.create_extension
+ *     'keyUsage', 'keyEncipherment,dataEncipherment,digitalSignature')
+ *   csr_cert.add_extension(extension_factory.create_extension
+ *     'subjectKeyIdentifier', 'hash')
  *
  *   csr_cert.sign ca_key, OpenSSL::Digest::SHA1.new
  *

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]