Question: KeyGenerator with Raw Byte

Jessica Mauvais (jessicam@llnl.gov)
Tue, 03 Mar 1998 16:15:53 -0800

Message-Id: <3.0.5.32.19980303161553.009893d0@popeye.llnl.gov>
Date: Tue, 03 Mar 1998 16:15:53 -0800
To: java-security@web1.javasoft.com
From: Jessica Mauvais <jessicam@llnl.gov>
Subject: Question: KeyGenerator with Raw Byte

Is it possbile to use raw byte to generate a key with the current beta
release of JDK 1.2 and JCE? Like:

KeyGenerator.generateKey( byte[] key ) {}

This is what we try to do:

1. Use DH to set up the key agreement
2. Use random number to generate a session/traffic key to encrypt the plain
text using DES.
3. Use share secret to encrypt the traffic key.
4. Send both the encrypted traffic key and cipher text to the other side to
decrypt.

I can't seem to get step 3 to work -- take the raw byte from
KeyAgreement.generateSecret() to generate a key using KeyGenerator. How do
I take the share secret in raw byte format to generate a key? Am I missing
something here Or the current release don't provide ways to do this?

Thanks much!

Jessica Mauvais