db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George H <george....@gmail.com>
Subject setting encryptionKey attribute in jdbc url
Date Tue, 01 Dec 2009 06:45:13 GMT

I am trying to create an embedded derby db using an encryption key that I
generate before hand. I've read the derby v10.5.3.0 ref guide and the
developer guide and I still have one question that lingers in my mind.

In the JDBC url where I have to specify the encryption key attribute how do
we get the key in string form? In the docs they use examples (Dev guide page
114 (PDF)) where the key looks like a letters and numbers and in most cases
just numbers.

Now when I generate my key like

KeyGenerator keyGen = KeyGenerator.getInstance("AES")
SecretKey key = keyGen.generateKey();

I only have the method   key.getEncoded() that I can use which returns an
array of bytes. I wonder how I can give this key to derby in the jdbc url ?
Do I have to convert the byte array to a HEX string ? or to decimals? I
don't know. If someone could help me out on this specific part it would be

George H

View raw message