Re: [jruby-dev] JRuby equivalent to Java Code

2013-01-07 Thread Rodrigo Rosenfeld Rosas
Em 07-01-2013 08:48, Carl Bourne escreveu: Kristian, getCertificates() expects a CertSelector object, not a regular expression I think this was the bit I overlooked and was obviously confused by! I also realise now that nil is equivalent to Java's null. I'll certainly make sure I include m

Re: [jruby-dev] JRuby equivalent to Java Code

2013-01-07 Thread Carl Bourne
Kristian, > getCertificates() expects a CertSelector object, not a regular expression I think this was the bit I overlooked and was obviously confused by! I also realise now that nil is equivalent to Java's null. I'll certainly make sure I include more relevant information in any future posts

Re: [jruby-dev] JRuby equivalent to Java Code

2013-01-07 Thread Rodrigo Rosenfeld Rosas
Hi Carl, I was just looking at the CertStore API: http://docs.oracle.com/javase/1.4.2/docs/api/java/security/cert/CertStore.html#getCertificates(java.security.cert.CertSelector)

Re: [jruby-dev] JRuby equivalent to Java Code

2013-01-07 Thread kristian
I am uncertain what is going on,, too. but the suggestion of Rodrigo did not work, so the hope was without the matcher /Safe/ that the underlying code does not expect some "String" happy that the little workaround worked :) - Kristian On Mon, Jan 7, 2013 at 3:22 PM, Carl Bourne wrote: > Kristia

Re: [jruby-dev] JRuby equivalent to Java Code

2013-01-07 Thread Carl Bourne
Kristian, Thanks so much for this. I'm sure exactly is happening here but by passing in a nil to the .get_certificates method it all works as expected. It now returns 2 certificate objects as it should. Best Regards, Carl On 7 Jan 2013, at 03:53, kristian wrote: > you example says store is

Re: [jruby-dev] JRuby equivalent to Java Code

2013-01-06 Thread kristian
you example says store is a Collection so I do not understand store.get_certificates(/Safe/) as such. what happens with store.get_certificates or store.get_certificates( nil ) or what objects do have when iterating over the Collection store.each { |c| p c.type; p c } just my thoughts after read

Re: [jruby-dev] JRuby equivalent to Java Code

2013-01-06 Thread Carl Bourne
Hi Rodrigo, Unfortunately your suggestion didn't work. I'm still getting a TypeError: can't convert Java::SunSecurityX509::X509CertImpl into String. Any pointers from anybody here would be a lifesaver!! Best Regards, Carl On 6 Jan 2013, at 14:13, Carl Bourne wrote: > Thanks Rodrigo, I'll

Re: [jruby-dev] JRuby equivalent to Java Code

2013-01-06 Thread Carl Bourne
Thanks Rodrigo, I'll give that a try and let you know if that works. Carl Bourne On 6 Jan 2013, at 14:05, Rodrigo Rosenfeld Rosas wrote: > Hi Carl, I can't replicate your code here as it isn't a complete example (I > don't have the response object for instance). > > But you could try "p" inst

Re: [jruby-dev] JRuby equivalent to Java Code

2013-01-06 Thread Rodrigo Rosenfeld Rosas
Hi Carl, I can't replicate your code here as it isn't a complete example (I don't have the response object for instance). But you could try "p" instead of "puts" or try the code below to avoid calling "to_s" (Ruby's equivalent of Java's toString()): puts store.get_certificates(/Safe/).object_

[jruby-dev] JRuby equivalent to Java Code

2013-01-04 Thread Carl Bourne
Hi, I'm fairly new to JRuby. Could somebody please show how I can do this using JRuby. How can express this java code in JRuby: - // Convert the store to a certificate chain CertStore store = response.getCertStore(); Collection certs = store