views:

122

answers:

1

Hi all,

I'm building an openid signature generator in javascript, and I have no experience working w/ octet strings, but step 3 of the signature gen procedure in the openid 2.0 spec states "Convert the list of key/value pairs to be signed to an octet string by encoding with Key-Value Form Encoding".

The string I've come up w/ (via Crypto.charenc.UTF8.stringToBytes from the crypto-js (code.google.com/p/crypto-js/) lib) looks like "111 112 95 101 ...". Is this is what the spec means? Is this even an octet string? The signature still isn't correct, but I'd at least like to know if my string is right.

I've seen other strings that look like "123\456\789...." (slash-separated) and "012\034\123..." (slash-separated, zero-padded). Any help is appreciated. Ideally, I'm looking for a javascript toOctetString method for a string, or even a javascript openid lib :O

Thanks!

A: 

Focus on that phrase "by encoding with Key-Value Form Encoding." You're just going for something that looks like this:

color:green
size:9w
codename:Sneaky Alligator

And always feel free to reference an existing open-source implementation.

keturn
also, when you get a time machine, go back to 2005 and tell Brad to use JSON instead of kvform.
keturn
although I guess, to be fair, the property kvform has that json doesn't is more explicit whitespace usage.
keturn