jPOS 1.6.1 API Documentation

org.jpos.security
Class SecureDESKey

java.lang.Object
  extended by org.jpos.security.SecureKey
      extended by org.jpos.security.SecureDESKey
All Implemented Interfaces:
java.io.Serializable, Loggeable

public class SecureDESKey
extends SecureKey

The SecureDESKey class represents:
Single, double or triple length DES keys that are secured by a security module. This is typically the DES key encrypted under one of the Local Master Keys of the security module.

SecureDESKey has an extra property "Key Check Value". It allows assuring that two SecureDESKeys owned by two different parties map to the same clear key. This can be a useful manual check for successful key exchange.

NOTE: The security of SecureDESKey is totally dependent on the security of the used security module.

Version:
$Revision: 2594 $ $Date: 2008-01-22 08:41:31 -0800 (Tue, 22 Jan 2008) $
Author:
Hani S. Kirollos
See Also:
SMAdapter, Serialized Form

Constructor Summary
SecureDESKey()
           
SecureDESKey(short keyLength, java.lang.String keyType, byte[] keyBytes, byte[] keyCheckValue)
          Constructs an SecureDESKey
SecureDESKey(short keyLength, java.lang.String keyType, java.lang.String keyHexString, java.lang.String keyCheckValueHexString)
          Constructs an SecureDESKey
 
Method Summary
 void dump(java.io.PrintStream p, java.lang.String indent)
          dumps SecureDESKey basic information
 byte[] getKeyCheckValue()
          The Key Check Value is typically a 24-bits (3 bytes) formed by encrypting a block of zeros under the secure key when the secure key is clear (not in this class, but inside the security module).
 void setKeyCheckValue(byte[] keyCheckValue)
          The Key Check Value is typically a 24-bits (3 bytes) formed by encrypting a block of zeros under the secure key when the secure key is clear (not in this class, but inside the security module).
 
Methods inherited from class org.jpos.security.SecureKey
getKeyBytes, getKeyLength, getKeyName, getKeyType, setKeyBytes, setKeyLength, setKeyName, setKeyType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecureDESKey

public SecureDESKey()

SecureDESKey

public SecureDESKey(short keyLength,
                    java.lang.String keyType,
                    byte[] keyBytes,
                    byte[] keyCheckValue)
Constructs an SecureDESKey

Parameters:
keyLength - e.g. LENGTH_DES, LENGTH_DES3_2KEY, LENGTH_DES3_3KEY
keyType -
keyBytes - DES Key in the secure proprietary format of your security module
keyCheckValue -
See Also:
SMAdapter

SecureDESKey

public SecureDESKey(short keyLength,
                    java.lang.String keyType,
                    java.lang.String keyHexString,
                    java.lang.String keyCheckValueHexString)
Constructs an SecureDESKey

Parameters:
keyLength -
keyType -
keyHexString - secure key represented as HexString instead of byte[]
keyCheckValueHexString - key check value represented as HexString instead of byte[]
Method Detail

setKeyCheckValue

public void setKeyCheckValue(byte[] keyCheckValue)
The Key Check Value is typically a 24-bits (3 bytes) formed by encrypting a block of zeros under the secure key when the secure key is clear (not in this class, but inside the security module). This check value allows identifying if two secure keys map to the same clear key.

Parameters:
keyCheckValue -

getKeyCheckValue

public byte[] getKeyCheckValue()
The Key Check Value is typically a 24-bits (3 bytes) formed by encrypting a block of zeros under the secure key when the secure key is clear (not in this class, but inside the security module).

Returns:
the keyCheckValue that was set before by setKeyCheckValue()

dump

public void dump(java.io.PrintStream p,
                 java.lang.String indent)
dumps SecureDESKey basic information

Parameters:
p - a PrintStream usually supplied by Logger
indent - indention string, usually suppiled by Logger
See Also:
Loggeable

jPOS.org