Hi Raphael,
I'm just guessing because I haven't seen your environment but why don't you
try installing the json gem ala
$ gem install json
Tha should add the dependency you need.
Raymond
On Thursday, May 16, 2013, Raphaël Jadot wrote:
> Hello,
>
> I try to follow the documentation for implementing my own IdP, but i
> fail in generating a correct browserid file
> I made a script (deftojson2) following this document
>
>
https://github.com/mozilla/browserid/blob/dev/docs/PRIMARY_PROTOCOL.md
> (6.1 Public Key Format)
>
> but while executing the script with "ruby deftojson2" , i've got
>
> -
> deftojson2:1:in `<main>': uninitialized constant OpenSSL (NameError)
> -
>
>
> So i added
>
> -
> require 'openssl'
> -
>
>
> and I've got
>
> -
> deftojson2:4:in `<main>': undefined method `to_json' for #<Hash:0x9ac22f0>
> (NoMethodError)
> -
>
>
> I tried another script found on the web
>
> -
> require 'openssl'
> privkey = OpenSSL::PKey::RSA.new(2048)
> pubkey = privkey.public_key
>
> # Return BrowserID Identity JSON
> def to_json
> {
> "public-key" => { "algorithm"=> "RS", "n" => public_key.n.to_s, "e" =>
> public_key.e.to_s },
> "authentication" => "/sign_in",
> "provisioning" => "/provision"
> }.to_json
> end
> -
>
>
> but I have no output at all.
>
> I'm not a ruby user, I'd be glad if someone can tell me what I'm doing
> wrong :)
>
>
>
> --
> Best regards, meilleures salutations
> Raphaël Jadot
>
>
--
---------------------------------------------------------
Raymond Kroeker