Package org.jpos.security
Class SecurePrivateKey
- java.lang.Object
-
- org.jpos.security.SecureKey
-
- org.jpos.security.SecureVariantKey
-
- org.jpos.security.SecurePrivateKey
-
- All Implemented Interfaces:
java.io.Serializable
,Loggeable
public class SecurePrivateKey extends SecureVariantKey implements java.io.Serializable
TheSecurePrivateKey
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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.jpos.security.SecureVariantKey
variant
-
-
Constructor Summary
Constructors Constructor Description SecurePrivateKey(java.lang.String keyType, byte[] keyBytes)
Constructs anSecurePrivateKey
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dump(java.io.PrintStream p, java.lang.String indent)
DumpsSecureRSAPrivateKey
basic information.KeyScheme
getScheme()
Gets the key scheme used to protect this key.byte
getVariant()
Gets the key variant method used to protect this key.void
setScheme(KeyScheme scheme)
Key scheme indicates protection metchod appiled to this key by the security module.void
setVariant(byte variant)
Sets key protection variant metchod appiled to this key by the security module.-
Methods inherited from class org.jpos.security.SecureKey
getKeyBytes, getKeyCheckValue, getKeyLength, getKeyName, getKeyType, setKeyBytes, setKeyCheckValue, setKeyLength, setKeyName, setKeyType
-
-
-
-
Constructor Detail
-
SecurePrivateKey
public SecurePrivateKey(java.lang.String keyType, byte[] keyBytes)
Constructs anSecurePrivateKey
.- Parameters:
keyType
- eg.SMAdapter.TYPE_RSA_PK
orSMAdapter.TYPE_RSA_SK
keyBytes
- private key in the secure proprietary format of the security module.
-
-
Method Detail
-
setVariant
public void setVariant(byte variant)
Description copied from class:SecureVariantKey
Sets key protection variant metchod appiled to this key by the security module.- Overrides:
setVariant
in classSecureVariantKey
- Parameters:
variant
- key variant method used to protect this key.
-
getVariant
public byte getVariant()
Description copied from class:SecureVariantKey
Gets the key variant method used to protect this key.- Specified by:
getVariant
in classSecureVariantKey
- Returns:
- key variant method used to protect this key.
-
setScheme
public void setScheme(KeyScheme scheme)
Description copied from class:SecureKey
Key scheme indicates protection metchod appiled to this key by the security module.
-
getScheme
public KeyScheme getScheme()
Description copied from class:SecureKey
Gets the key scheme used to protect this key.
-
-