com.waveset.util
Class KeyUtil

java.lang.Object
  extended bycom.waveset.util.KeyUtil

public class KeyUtil
extends java.lang.Object

This is a utility class encode and decode keys.

Since:
1.0
Version:
$Revision: 1.1 $ created: 2-10-2001

Field Summary
static java.lang.String code_id
           
 
Constructor Summary
KeyUtil()
           
 
Method Summary
static java.security.KeyPair getKeyPair()
          The method gets the key pair.
static java.security.PrivateKey getPrivate(byte[] encodedKey)
          This method gets the private key from the encoded byte.
static java.security.PublicKey getPublic(byte[] encodedKey)
          The method gets the public key from the encoded byte.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values
Constructor Detail

KeyUtil

public KeyUtil()
Method Detail

getPublic

public static java.security.PublicKey getPublic(byte[] encodedKey)
                                         throws java.security.spec.InvalidKeySpecException
The method gets the public key from the encoded byte. The bytes can be recovered from a Hex string saved in a file etc.

Parameters:
encodedKey - the encoded public key in bytes.
Throws:
java.security.spec.InvalidKeySpecException

getPrivate

public static java.security.PrivateKey getPrivate(byte[] encodedKey)
                                           throws java.security.spec.InvalidKeySpecException
This method gets the private key from the encoded byte. The bytes can be recovered from a Hex string saved in a file etc.

Parameters:
encodedKey - the encoded private key in bytes.
Throws:
java.security.spec.InvalidKeySpecException

getKeyPair

public static java.security.KeyPair getKeyPair()
The method gets the key pair.

Returns:
a pair of keys