summaryrefslogtreecommitdiff
path: root/test/openssl/test_x509cert.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/openssl/test_x509cert.rb')
-rw-r--r--test/openssl/test_x509cert.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/openssl/test_x509cert.rb b/test/openssl/test_x509cert.rb
index 0cfe440..5b2e712 100644
--- a/test/openssl/test_x509cert.rb
+++ b/test/openssl/test_x509cert.rb
@@ -178,6 +178,15 @@ class OpenSSL::TestX509Certificate < OpenSSL::TestCase
assert_equal(true, cert.check_private_key(@rsa2048))
end
+ def test_read_from_file
+ cert = issue_cert(@ca, @rsa2048, 1, [], nil, nil)
+ Tempfile.create("cert") { |f|
+ f << cert.to_pem
+ f.rewind
+ assert_equal cert.to_der, OpenSSL::X509::Certificate.new(f).to_der
+ }
+ end
+
private
def certificate_error_returns_false