org.silverpeas.util.crypto
Class BlowfishKey

java.lang.Object
  extended by org.silverpeas.util.crypto.BlowfishKey
All Implemented Interfaces:
Serializable, Key

public class BlowfishKey
extends Object
implements Key

A representation of a symmetric key used in the Blowfish cipher. It is a wrapper of the actual key it generates from a plain text representation of the key.

See Also:
Serialized Form

Constructor Summary
BlowfishKey()
          Constructs a new symmetric key for the Blowfish cipher.
BlowfishKey(byte[] keyCode)
          Constructs a new symmetric key for the Blowfish cypher from the specified binary key code.
BlowfishKey(String keyCode)
          Constructs a new symmetric key for the Blowfish cypher from the specified key code in text.
 
Method Summary
 String getAlgorithm()
           
 byte[] getEncoded()
           
 String getFormat()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlowfishKey

public BlowfishKey()
Constructs a new symmetric key for the Blowfish cipher. The key is computed from a default code; that is to say two instances created by using this constructor are equal.


BlowfishKey

public BlowfishKey(String keyCode)
Constructs a new symmetric key for the Blowfish cypher from the specified key code in text.

Parameters:
keyCode - the code of the key.

BlowfishKey

public BlowfishKey(byte[] keyCode)
Constructs a new symmetric key for the Blowfish cypher from the specified binary key code.

Parameters:
keyCode - the code of the key.
Method Detail

getAlgorithm

public String getAlgorithm()
Specified by:
getAlgorithm in interface Key

getFormat

public String getFormat()
Specified by:
getFormat in interface Key

getEncoded

public byte[] getEncoded()
Specified by:
getEncoded in interface Key


Copyright © 2016 Silverpeas. All Rights Reserved.