Thanks Matt,

I'll give your build a try!

Are there any docs that cover off how to compile it? 

Is this likely to make it into the next release of JRuby (1.7.3) or other? 

Regards, 

Carl 

On 16 Jan 2013, at 22:02, Matt Hauck <mattha...@gmail.com> wrote:

> You could always try out building my branch: 
> https://github.com/matthauck/jruby/tree/bc147. That will depend also on 
> https://github.com/matthauck/bouncy-castle-java.
> 
> Kristian, do you mean to say that jruby has forked BC and renamed all of its 
> packages? I just unpacked the jar file in 
> lib/ruby/shared/bcprov-jdk15-146.jar, and it doesn't look like any packages 
> have been renamed. 
> 
> Btw, I thought previously a decision had been made that jruby wasn't shipping 
> BC, but only worked properly when BC was in loaded (i.e. via the 
> bouncy-castle-java gem?)
> 
> -- 
> Matt Hauck
> 
> On Wednesday, January 16, 2013 at 1:36 PM, Carl Bourne wrote:
> 
>> Thanks Matt - are there any workarounds until this get fixed? 
>> 
>> Regards, 
>> 
>> Carl
>> 
>> On 16 Jan 2013, at 20:40, Matt Hauck <mattha...@gmail.com> wrote:
>> 
>>> Here's the issue tracker: https://jira.codehaus.org/browse/JRUBY-6793
>>> 
>>> -- 
>>> Matt Hauck
>>> 
>>> On Wednesday, January 16, 2013 at 12:34 PM, Thomas E Enebo wrote:
>>> 
>>>> Yeah the version mismatch will definitely be an issue. I know a
>>>> couple of people are working towards current release of BC support and
>>>> nearly there. Hopefully we can at least get rid of one of your
>>>> problems soon...
>>>> 
>>>> -Tom
>>>> 
>>>> On Wed, Jan 16, 2013 at 2:32 PM, Carl Bourne <carl.bou...@me.com> wrote:
>>>>> Tom,
>>>>> 
>>>>> Thanks for the reply, I tried 'require openssl' but got a whole load of 
>>>>> constant already initialised warnings. Then an error saying it could not 
>>>>> load openssl/dummy!
>>>>> 
>>>>> I'm also using BC 1.4.7 so I'm wondering if that could be the problem!
>>>>> 
>>>>> Regards,
>>>>> 
>>>>> Carl Bourne
>>>>> 
>>>>> On 16 Jan 2013, at 20:15, Thomas E Enebo <tom.en...@gmail.com> wrote:
>>>>> 
>>>>>> Perhaps require 'openssl' first?  The problem I think is that if you
>>>>>> are loading bc you are doing it from a child classloader from the main
>>>>>> CL where JRuby has already loaded BC. It is just a guess though.
>>>>>> 
>>>>>> -Tom
>>>>>> 
>>>>>> On Wed, Jan 16, 2013 at 1:08 PM, Carl Bourne <carl.bou...@me.com> wrote:
>>>>>>> Hi,
>>>>>>> 
>>>>>>> I'm trying to create a new Certificate Signing Request () using the
>>>>>>> BouncyCastle libraries. I can generate a basic CSR without the code 
>>>>>>> between
>>>>>>> the #Begin and end add extension. However when I try to add the
>>>>>>> DERObjectIdentifier I get an "NoMethodError: undefined method
>>>>>>> `DERObjectIdentifier' for #<ScepEnroler:0x6cf6cb21>" error.
>>>>>>> 
>>>>>>> Any assistance would be appreciated.
>>>>>>> 
>>>>>>> Best Regards,
>>>>>>> 
>>>>>>> Carl
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> java_import org.bouncycastle.asn1.DERPrintableString
>>>>>>> java_import org.bouncycastle.asn1.DERObjectIdentifier
>>>>>>> 
>>>>>>> entityname = X500Name.new("#{@entityname}")
>>>>>>> 
>>>>>>> newentitypair = KeyPairGenerator.getInstance("RSA")
>>>>>>> newentitypair.initialize__method(2048)
>>>>>>> 
>>>>>>> entitypair = newentitypair.genKeyPair
>>>>>>> 
>>>>>>> publickeyinfo =
>>>>>>> SubjectPublicKeyInfo.getInstance(entitypair.getPublic.getEncoded)
>>>>>>> 
>>>>>>> csrbuilder = PKCS10CertificationRequestBuilder.new(entityname, 
>>>>>>> publickeyinfo
>>>>>>> )
>>>>>>> puts csrbuilder
>>>>>>> 
>>>>>>> csrbuilder.addAttribute(PKCSObjectIdentifiers::pkcs_9_at_challengePassword,
>>>>>>> DERPrintableString.new("#{@challengepassword}"))
>>>>>>> 
>>>>>>> #Begin add extension
>>>>>>> 
>>>>>>> extensionsGenerator = org.bouncycastle.asn1.x509.ExtensionsGenerator.new
>>>>>>> 
>>>>>>> vec = ASN1EncodableVector.new
>>>>>>> v = ASN1EncodableVector.new
>>>>>>> 
>>>>>>> v.add(DERObjectIdentifier("1.3.6.1.4.1.311.20.2.3").new)
>>>>>>> v.add(DERTaggedObject(true, 0, DERUTF8String("devuser@dvam.local").new
>>>>>>> ).new)
>>>>>>> 
>>>>>>> ASN1Object gn = DERTaggedObject(false, 0, DERSequence(v).new).new
>>>>>>> vec.add(gn)
>>>>>>> 
>>>>>>> extensionsGenerator.addExtension( Extension.subjectAlternativeName, 
>>>>>>> true,
>>>>>>> DERSequence(vec).new )
>>>>>>> csrbuilder.addAttribute( 
>>>>>>> PKCSObjectIdentifiers.pkcs_9_at_extensionRequest,
>>>>>>> extensionsGenerator.generate() )
>>>>>>> 
>>>>>>> #End add extension
>>>>>>> 
>>>>>>> signer = signerbuilder.build(entitypair.getPrivate)
>>>>>>> puts signer
>>>>>>> csr = csrbuilder.build(signer)
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> blog: http://blog.enebo.com twitter: tom_enebo
>>>>>> mail: tom.en...@gmail.com
>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>> 
>>>> 
>>>> 
>>>> --
>>>> blog: http://blog.enebo.com twitter: tom_enebo
>>>> mail: tom.en...@gmail.com
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe from this list, please visit:
>>>> 
>>>> http://xircles.codehaus.org/manage_email
> 

Reply via email to