Class SecurePrivateKey
java.lang.Object
org.jpos.security.SecureKey
org.jpos.security.SecureVariantKey
org.jpos.security.SecurePrivateKey
- All Implemented Interfaces:
Serializable, Loggeable
The
SecurePrivateKey class wraps any private key, which is protected
by the security module with variant methods.
The wrapped private key should be in the secure proprietary format of the security module.
The keyType indicates type of private key (currently only RSA
keys are supported - others may be in future)
- See Also:
-
Field Summary
Fields inherited from class SecureVariantKey
variantFields inherited from class SecureKey
keyBytes, keyCheckValue, keyLength, keyName, keyType, schemeModifier and TypeFieldDescriptionprotected byte[]Secure Key Bytesprotected byte[]The keyCheckValue allows identifying which clear key does this secure key represent.protected shortThis is the bit length of the key This can be: LENGTH_DES, LENGTH_DES3_2KEY, ...protected StringOptional key nameprotected StringKey Type is useful for stating what this key can be used for.protected KeySchemeKey scheme indicates protection metchod appiled to this key by a security module. -
Constructor Summary
ConstructorsConstructorDescriptionSecurePrivateKey(String keyType, byte[] keyBytes) Constructs anSecurePrivateKey. -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(PrintStream p, String indent) DumpsSecureRSAPrivateKeybasic information.Gets the key scheme used to protect this key.byteGets the key variant method used to protect this key.voidKey scheme indicates protection metchod appiled to this key by the security module.voidsetVariant(byte variant) Sets key protection variant metchod appiled to this key by the security module.Methods inherited from class SecureKey
getKeyBytes, getKeyCheckValue, getKeyLength, getKeyName, getKeyType, setKeyBytes, setKeyCheckValue, setKeyLength, setKeyName, setKeyTypeModifier and TypeMethodDescriptionbyte[]Returns the secure (LMK-protected) key bytes.byte[]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).shortReturns the clear-key length in bits.Returns the optional key name.Key Type is useful for stating what this key can be used for.voidsetKeyBytes(byte[] keyBytes) Sets the secure key bytesvoidsetKeyCheckValue(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).voidsetKeyLength(short keyLength) Sets the length of the key (in bits) (when it was still clear).voidsetKeyName(String keyName) Sets the optional key name.voidsetKeyType(String keyType) Key Type is useful for stating what this key can be used for.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Loggeable
dumpModifier and TypeMethodDescriptiondefault voiddump(PrintStream p, String indent, LogRenderer.Type type) Dumps a representation of this object using the specified renderer type.
-
Constructor Details
-
SecurePrivateKey
Constructs anSecurePrivateKey.- Parameters:
keyType- eg.SMAdapter.TYPE_RSA_PKorSMAdapter.TYPE_RSA_SKkeyBytes- private key in the secure proprietary format of the security module.
-
-
Method Details
-
setVariant
Description copied from class:SecureVariantKeySets key protection variant metchod appiled to this key by the security module.- Overrides:
setVariantin classSecureVariantKey- Parameters:
variant- key variant method used to protect this key.
-
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.
-
setScheme
-
getScheme
-
dump
-