public class SecurePrivateKey extends SecureVariantKey implements java.io.Serializable
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)
variant
Constructor and Description |
---|
SecurePrivateKey(java.lang.String keyType,
byte[] keyBytes)
Constructs an
SecurePrivateKey . |
Modifier and Type | Method and Description |
---|---|
void |
dump(java.io.PrintStream p,
java.lang.String indent)
Dumps
SecureRSAPrivateKey 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.
|
getKeyBytes, getKeyCheckValue, getKeyLength, getKeyName, getKeyType, setKeyBytes, setKeyCheckValue, setKeyLength, setKeyName, setKeyType
public SecurePrivateKey(java.lang.String keyType, byte[] keyBytes)
SecurePrivateKey
.keyType
- eg. SMAdapter.TYPE_RSA_PK
or SMAdapter.TYPE_RSA_SK
keyBytes
- private key in the secure proprietary format of the security module.public void setVariant(byte variant)
SecureVariantKey
setVariant
in class SecureVariantKey
variant
- key variant method used to protect this key.public byte getVariant()
SecureVariantKey
getVariant
in class SecureVariantKey
public void setScheme(KeyScheme scheme)
SecureKey
public KeyScheme getScheme()
SecureKey