public class LunaSecretKey extends LunaKey implements SecretKey
AES_KWP_WRAP_IV, keySize, lapi, mKeyClass, mKeyType, mObject, UNLIMITED_USE, WRAP_IVserialVersionUID| Constructor and Description |
|---|
LunaSecretKey(int hKey) |
LunaSecretKey(int hKey,
int slot) |
LunaSecretKey(int hKey,
int slot,
long keyType) |
LunaSecretKey(int hKey,
int slot,
Map<Long,Object> sessionParameters) |
LunaSecretKey(LunaTokenObject object) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
ExtractSecretKey()
Extract a Luna secret key from the token
|
protected byte[] |
getEncodedInternal() |
String |
getFormat()
Returns the name of the format used to encode the LunaKey object.
|
static LunaSecretKey |
InjectSecretKey(byte[] keyBytes)
Inject (encrypt encoded key and unwrap) an encoded secret key (of type "Generic Secret") into
the token at the default slot.
|
static LunaSecretKey |
InjectSecretKey(byte[] keyBytes,
String algorithm)
Inject (encrypt encoded key and unwrap) an encoded secret key into the token at the default
slot.
|
static LunaSecretKey |
InjectSecretKey(byte[] keyBytes,
String algorithm,
int slot)
Inject (encrypt encoded key and unwrap) an encoded secret key into the token at the specified
slot.
|
static LunaSecretKey |
InjectSecretKey(SecretKey key)
Inject (encrypt encoded key and unwrap) a non-Luna secret key into the token at the default
slot.
|
static LunaSecretKey |
InjectSecretKey(SecretKey key,
int slot)
Inject (encrypt encoded key and unwrap) a non-Luna secret key into the token at the specified
slot.
|
AttributeToBigInteger, BigIntegerToAttribute, DestroyKey, equals, getAlgorithm, GetAlias, GetDateMadePersistent, getEncoded, GetFingerprint, getKeyByType, GetKeyClass, GetKeyHandle, getKeySize, getKeyType, GetKeyType, getSession, getSlot, getUsageCount, getUsageLimit, hashCode, Initialize, Initialize, injectKey, InjectPrivateKey, InjectPrivateKey, InjectPrivateKey, InjectPrivateKey, isInitialized, IsKeyPersistent, LocateKeyByAlias, LocateKeyByAlias, LocateKeyByFingerprint, LocateKeyByFingerprint, LocateKeyByHandle, LocateKeyByHandle, LocateKeyOnlyByAlias, LocateKeyOnlyByAlias, MakePersistent, release, setKeySize, setUsageCount, setUsageLimit, toString, verifyClassAndTypeclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAlgorithm, getEncodedpublic LunaSecretKey(int hKey)
public LunaSecretKey(int hKey,
int slot)
public LunaSecretKey(int hKey,
int slot,
long keyType)
public LunaSecretKey(LunaTokenObject object)
public String getFormat()
LunaKeyThis will be one of
protected byte[] getEncodedInternal()
getEncodedInternal in class LunaKeypublic static LunaSecretKey InjectSecretKey(SecretKey key) throws InvalidKeyException
key - The non-Luna key objectInvalidKeyException - If the key is not encoded in RAW formatLunaException - If there is a problem creating/injecting the keys on the HSMpublic static LunaSecretKey InjectSecretKey(SecretKey key, int slot) throws InvalidKeyException
key - The non-Luna key objectslot - The slot of the token to inject the key intoInvalidKeyException - If the key is not encoded in RAW formatLunaException - If there is a problem creating/injecting the keys on the HSMpublic static LunaSecretKey InjectSecretKey(byte[] keyBytes)
keyBytes - The RAW non-Luna key bytesLunaException - If there is a problem creating/injecting the keys on the HSMpublic static LunaSecretKey InjectSecretKey(byte[] keyBytes, String algorithm)
keyBytes - The RAW non-Luna key bytesalgorithm - The secret key algorithmLunaException - If there is a problem creating/injecting the keys on the HSMpublic static LunaSecretKey InjectSecretKey(byte[] keyBytes, String algorithm, int slot)
keyBytes - The RAW non-Luna key bytesalgorithm - The secret key algorithmslot - The slot of the token to inject the key intoLunaException - If there is a problem creating/injecting the keys on the HSMpublic byte[] ExtractSecretKey()
throws LunaException
LunaExceptionCopyright 2014-2018 SafeNet. All rights reserved.