ip2k / google-api-ruby-client

Automatically exported from code.google.com/p/google-api-ruby-client
Apache License 2.0
0 stars 0 forks source link

Google::APIClient::PKCS12.load_key failed on Windows #70

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Created Service Account in Google apis
2. Read the key with api client:
Google::APIClient::PKCS12.load_key('client.p12', 'notasecret')

What is the expected output? 
none

What do you see instead?
c:/Ruby/lib/ruby/gems/1.9.1/gems/google-api-client-0.5.0/lib/google/api_client/a
uth/pkcs12.rb:43:in `rescue in load_key': Invalid keyfile or passphrase 
(ArgumentError)
        from c:/Ruby/lib/ruby/gems/1.9.1/gems/google-api-client-0.5.0/lib/google/api_client/auth/pkcs12.rb:34:in `load_key'

What version of the product are you using? On what operating system?
google-api-client (0.5.0) on Windows 7

Please provide any additional information below.
I figured out that the key needs to be read in binary mode when using Windows. 
After changing this it worked for me (see attached patch).

Original issue reported on code.google.com by meik.nie...@gmail.com on 6 Dec 2012 at 3:42

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in next release (0.5.1+)

Original comment by sba...@google.com on 2 Jan 2013 at 8:58