LCHCAPITALHUMAIN / starschema-bigquery-jdbc

Automatically exported from code.google.com/p/starschema-bigquery-jdbc
0 stars 0 forks source link

Accept private key as string as well as file #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It would be great to accept the private key in the JDBC url as text instead of 
just a path to the file. We cant use a path to file in our situation, as it 
needs to be provided by the user, and will not be stored in the filesystem.

Original issue reported on code.google.com by BenPorte...@gmail.com on 16 May 2013 at 6:57

GoogleCodeExporter commented 9 years ago

Original comment by guni...@starschema.net on 17 May 2013 at 6:16

GoogleCodeExporter commented 9 years ago
Could you give me an example, of how the privatekey string looks like? since 
.p12 keyfile seems to be binary. So I have no clue what could be pasted into 
the password field, and how could be converted into:
http://docs.oracle.com/javase/6/docs/api/java/security/PrivateKey.html

If you could give me a hint, it would be no problem to add a 
"?keyinpassword=true" to the url.

Original comment by guni...@starschema.net on 17 May 2013 at 3:06

GoogleCodeExporter commented 9 years ago
Sure - our use case is special, as we're a platform that enables analysis on a 
variety of databases. A customer that wants to use bigquery through our 
platform would indeed upload the key to us via a web interface, but after that 
we'd like to store the key encrypted in our own local database instead of as a 
file in the filesystem. So, while an end-user to our system would upload the 
actual file, our code would store the file encrypted as bytes, and then we'd 
like to provide the key as bytes to the driver (instead of the path to a file). 
Does that make sense?

Original comment by BenPorte...@gmail.com on 18 May 2013 at 8:03

GoogleCodeExporter commented 9 years ago
Yes it makes sense, but as far as I know you can't pass bytes to the JDBC 
driver, properties and user/password are all string. I tried to find some docs 
on google, how is it possible to store privatekeys in database as bytes then 
use them again, but had no success, and as i mentioned the main problem is, 
that the driver accepts only strings. If you could pass it as a string, and 
show some example on, how to make PrivateKey type from that string, it would be 
done in no time.

Original comment by guni...@starschema.net on 19 May 2013 at 12:27