Class SecureDESKey
java.lang.Object
org.jpos.security.SecureKey
org.jpos.security.SecureVariantKey
org.jpos.security.SecureDESKey
- All Implemented Interfaces:
Serializable, Loggeable
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.
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 Summary
FieldsModifier and TypeFieldDescriptionprotected static final PatternRegular expression pattern representing key type string value.Fields inherited from class SecureVariantKey
variant -
Constructor Summary
ConstructorsConstructorDescriptionSecureDESKey(short keyLength, String keyType, byte[] keyBytes, byte[] keyCheckValue) Constructs an SecureDESKeySecureDESKey(short keyLength, String keyType, byte variant, KeyScheme scheme, byte[] keyBytes, byte[] keyCheckValue) Constructs an SecureDESKeySecureDESKey(short keyLength, String keyType, byte variant, KeyScheme scheme, String keyHexString, String keyCheckValueHexString) Constructs an SecureDESKeySecureDESKey(short keyLength, String keyType, String keyHexString, String keyCheckValueHexString) Constructs an SecureDESKey -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(PrintStream p, String indent) dumps SecureDESKey basic informationGets the key scheme used to protect this key.byteGets the key variant method used to protect this key.Methods inherited from class SecureVariantKey
setVariantMethods inherited from class SecureKey
getKeyBytes, getKeyCheckValue, getKeyLength, getKeyName, getKeyType, setKeyBytes, setKeyCheckValue, setKeyLength, setKeyName, setKeyType, setScheme
-
Field Details
-
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_3KEYkeyType-variant-scheme-keyBytes- DES Key in the secure proprietary format of your security modulekeyCheckValue-- See Also:
-
SecureDESKey
Constructs an SecureDESKey- Parameters:
keyLength- e.g. LENGTH_DES, LENGTH_DES3_2KEY, LENGTH_DES3_3KEYkeyType-keyBytes- DES Key in the secure proprietary format of your security modulekeyCheckValue-- 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
Description copied from class:SecureVariantKeyGets the key variant method used to protect this key.- Specified by:
getVariantin classSecureVariantKey- Returns:
- key variant method used to protect this key.
-
getScheme
-
dump
dumps SecureDESKey basic information- Parameters:
p- a PrintStream usually supplied by Loggerindent- indention string, usually suppiled by Logger- See Also:
-