Charles,

Indeed it seems to be an issue with JRuby 1.7 RC2 and maybe the included BC 
libraries. 

If switch back to JRuby 1.6 I get the expected result.

org.bouncycastle.pkcs.PKCS10CertificationRequest@206b4e2

Is there an easy way to exclude the included BC libraries?

Regards,

Carl

On 18 Oct 2012, at 02:29, Charles Oliver Nutter <head...@headius.com> wrote:

> On Wed, Oct 17, 2012 at 6:44 PM, Carl Bourne <carl.bou...@me.com> wrote:
>> Using this Java code:
>> 
>> // Generate the certificate signing request
>>            PKCS10CertificationRequestBuilder csrBuilder = new 
>> PKCS10CertificationRequestBuilder(entityName, publicKeyInfo);
>>            
>> csrBuilder.addAttribute(PKCSObjectIdentifiers.pkcs_9_at_challengePassword, 
>> new DERPrintableString(new String("lexicon".toCharArray())));
>>            ContentSigner signer = 
>> signerBuilder.build(entityPair.getPrivate());
>>            PKCS10CertificationRequest csr = csrBuilder.build(signer);
>>           System.out.println(csr);
>> 
>> It returns this:
>> 
>> org.bouncycastle.pkcs.PKCS10CertificationRequest@ba259522
>> 
>> 
>> However when I try to do the same using JRuby with this code:
>> 
>> // Generate the certificate signing request
>> csrbuilder = PKCS10CertificationRequestBuilder.new(entityname, publickeyinfo 
>> )
>> password = String.new("password").toCharArray
>> csrbuilder.addAttribute(PKCSObjectIdentifiers::pkcs_9_at_challengePassword, 
>> DERPrintableString.new(String.new(password)))
>> signer = signerbuilder.build(entitypair.getPrivate)
>> csr = csrbuilder.build(signer)
>> puts csr
>> 
>> It returns this:
>> 
>> org.bouncycastle.pkcs.PKCS10CertificationRequestHolder@c06a2100
>> 
>> Instead of returning org.bouncycastle.pkcs.PKCS10CertificationRequest object.
> 
> Well that's very strange. Since you obviously have all the right types
> up to the last build call, perhaps it's choosing the wrong build()
> method? Is there one that returns a holder?
> 
> Oh, another thought...perhaps you're picking up JRuby's built-in
> BouncyCastle, which is a bit older than the most recent version and
> may have API differences? Perhaps build returns a "Holder" in our
> version of BC?
> 
> - Charlie
> 
> ---------------------------------------------------------------------
> 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