aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthekuwayama <thekuwayama@gmail.com>2019-12-02 04:07:46 +0900
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2019-12-02 10:34:39 +0900
commit62287bede47e34561279901758ff5a8195cc8a9d (patch)
tree8f35f4b148308faca4bad1f07a754d113f8e9fc3
parent6322ccbbf5671acc4cb1036f90b64e05e5ed3d28 (diff)
downloadruby-openssl-62287bede47e34561279901758ff5a8195cc8a9d.tar.gz
modify the document about `CertificateId.new`
-rw-r--r--ext/openssl/ossl_ocsp.c4
-rw-r--r--test/test_ocsp.rb1
2 files changed, 4 insertions, 1 deletions
diff --git a/ext/openssl/ossl_ocsp.c b/ext/openssl/ossl_ocsp.c
index e6659cff..2ca4f62f 100644
--- a/ext/openssl/ossl_ocsp.c
+++ b/ext/openssl/ossl_ocsp.c
@@ -1489,13 +1489,15 @@ ossl_ocspcid_initialize_copy(VALUE self, VALUE other)
* call-seq:
* OpenSSL::OCSP::CertificateId.new(subject, issuer, digest = nil) -> certificate_id
* OpenSSL::OCSP::CertificateId.new(der_string) -> certificate_id
+ * OpenSSL::OCSP::CertificateId.new(obj) -> certificate_id
*
* Creates a new OpenSSL::OCSP::CertificateId for the given _subject_ and
* _issuer_ X509 certificates. The _digest_ is a digest algorithm that is used
* to compute the hash values. This defaults to SHA-1.
*
* If only one argument is given, decodes it as DER representation of a
- * certificate ID.
+ * certificate ID or generates certificate ID from the object that responds to
+ * the to_der method.
*/
static VALUE
ossl_ocspcid_initialize(int argc, VALUE *argv, VALUE self)
diff --git a/test/test_ocsp.rb b/test/test_ocsp.rb
index 50ad6c31..2ecc0e5a 100644
--- a/test/test_ocsp.rb
+++ b/test/test_ocsp.rb
@@ -84,6 +84,7 @@ class OpenSSL::TestOCSP < OpenSSL::TestCase
assert_equal [cid.issuer_key_hash].pack("H*"), asn1.value[2].value
assert_equal @cert.serial, asn1.value[3].value
assert_equal der, OpenSSL::OCSP::CertificateId.new(der).to_der
+ assert_equal der, OpenSSL::OCSP::CertificateId.new(asn1).to_der
end
def test_certificate_id_dup