Just to make your life a little easier (and remove some dependency on
non-PHP tools):

$public_key_str = "<This is the string right off your Android dev
portal. Load from DB or file if you choose.>";
$cert = "-----BEGIN PUBLIC KEY-----\r\n" .
chunk_split($public_key_str, 64, "\r\n") . "-----END PUBLIC KEY-----";

No more relying on openssl pipes for you! :)

Cheers,
Ian MacDonald

On Apr 25, 10:30 pm, Nate Totura <[email protected]> wrote:
> Thanks for the help, you were correct, the data I was using to test
> everything was in a file an had an extra newline appended to the end.
>
> On Apr 20, 7:37 pm, Nikolay Elenkov <[email protected]> wrote:
>
>
>
>
>
>
>
> > On Thu, Apr 21, 2011 at 6:24 AM, Nate Totura <[email protected]> wrote:
>
> > > Still no luck, I am pretty confident I am sending the PHP routines
> > > correctly formatted data.
>
> > > A followup question:
> > > How can I verify the signature and data using only openssl, here is
> > > what I am currently doing:
>
> > >   openssl dgst -sha1 -verify public.key.ssl -signature signature.bin
> > > data
>
> > What you are doing is correct. Just make sure that the data file has
> > no trailing newlines (use a binary editor to remove them, or save as
> > binary from your Java or PHP program). I just tried it with a response from
> > Market, it verifies OK.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to