Question: TypeError when using write_smime in jruby


TypeError when using write_smime in jruby

Answers 0
Added at 2016-12-14 11:12

I'm trying to sign an email with the openssl library of jruby 1.7.26 and get the error "TypeError: nil is not a string".

Here is my test script:

require 'openssl'

certificate ='config', 'my-cert.crt')))
private_key ='config', 'my-key.key')))
data = "Test"
OpenSSL::PKCS7.write_smime(OpenSSL::PKCS7.sign(certificate, private_key, data, [], OpenSSL::PKCS7::DETACHED))

The error happens here:

TypeError: nil is not a string
from org/jruby/ext/openssl/ `write_smime'

The Input for the write_smime funtion looks like this:

#<OpenSSL::PKCS7:0xea458d5 @data="Test">

Any help with finding a solution for this error is highly appreciated.

Source Show
◀ Wstecz