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 though and I really appreciate you assistance here despite the lack of 
clarity on my part. 

Best Regards,


Carl

On 7 Jan 2013, at 10:35, Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com> wrote:

> 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)
> 
> getCertificates() expects a CertSelector object, not a regular expression. 
> Also, for the original Java code "null" (nil in Ruby) is passed to the 
> getCertificates(), so I don't know why you changed it in the Ruby code if you 
> just wanted to port it...
> 
> And whenever you post exceptions to this (or another) list, please give it 
> the context as displayed in the stacktrace log since it will help getting 
> your problem tracked sooner.
> 
> The TypeError is certainly misleading because we might think the problem is 
> on the string conversion when using "puts" but it actually happened elsewhere 
> and it is hard to foresee if we can't reproduce the entire use case and we 
> don't have access to the full (or near the context) stack-trace either.
> 
> I hope you enjoy JRuby.
> 
> Cheers!
> 
> Em 07-01-2013 08:07, kristian escreveu:
>> 
>> 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 <carl.bou...@me.com> wrote:
>>> 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 <m.krist...@web.de> wrote:
>>> 
>>>> 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 reading . . . .
>>>> - Kristian
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe from this list, please visit:
>>>> 
>>>>    http://xircles.codehaus.org/manage_email
>>>> 
>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>> 
>>>     http://xircles.codehaus.org/manage_email
>>> 
>>> 
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>> 
>>     http://xircles.codehaus.org/manage_email
>> 
>> 
> 

Reply via email to