Class SecureDESKey

All Implemented Interfaces:
Serializable, Loggeable

public class SecureDESKey extends SecureVariantKey
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.

See Also:
  • Field Details

    • KEY_TYPE_PATTERN

      protected static final Pattern KEY_TYPE_PATTERN
      Regular expression pattern representing key type string value.
  • Constructor Details

    • SecureDESKey

      public SecureDESKey()
    • SecureDESKey

      public SecureDESKey(short keyLength, String keyType, byte variant, KeyScheme scheme, byte[] keyBytes, byte[] keyCheckValue)
      Constructs an SecureDESKey
      Parameters:
      keyLength - e.g. LENGTH_DES, LENGTH_DES3_2KEY, LENGTH_DES3_3KEY
      keyType -
      variant -
      scheme -
      keyBytes - DES Key in the secure proprietary format of your security module
      keyCheckValue -
      See Also:
    • SecureDESKey

      public SecureDESKey(short keyLength, 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:
    • SecureDESKey

      public SecureDESKey(short keyLength, String keyType, String keyHexString, 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[]
    • SecureDESKey

      public SecureDESKey(short keyLength, String keyType, byte variant, KeyScheme scheme, String keyHexString, String keyCheckValueHexString)
      Constructs an SecureDESKey
      Parameters:
      keyLength -
      keyType -
      variant -
      scheme -
      keyHexString - secure key represented as HexString instead of byte[]
      keyCheckValueHexString - key check value represented as HexString instead of byte[]
  • Method Details

    • getVariant

      public byte getVariant()
      Description copied from class: SecureVariantKey
      Gets the key variant method used to protect this key.
      Specified by:
      getVariant in class SecureVariantKey
      Returns:
      key variant method used to protect this key.
    • getScheme

      public KeyScheme getScheme()
      Description copied from class: SecureKey
      Gets the key scheme used to protect this key.
      Specified by:
      getScheme in class SecureKey
      Returns:
      key scheme used to protect this key.
    • dump

      public void dump(PrintStream p, String indent)
      dumps SecureDESKey basic information
      Parameters:
      p - a PrintStream usually supplied by Logger
      indent - indention string, usually suppiled by Logger
      See Also: