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<? extends Certificate> certs = store
                    .getCertificates(null);
            Certificate[] chain = new Certificate[certs.size()];

            int i = 0;
            for (Certificate certificate : certs) {
                chain[i++] = certificate;
            }
I have the "store" within JRuby and its recognised as a collection.

e.g.

puts store.type 
#Collection
If I try this:

puts store.get_certificates(/Safe/)

I get the following type error: -

TypeError: can't convert Java::SunSecurityX509::X509CertImpl into String

Best Regards,

Carl

Reply via email to