public class LunaSecretKey extends LunaKey implements SecretKey
keySize, lapi, mKeyClass, mKeyType, mObject, UNLIMITED_USE, WRAP_IV
serialVersionUID
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,
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, GetKeyClass, GetKeyHandle, getKeySize, GetKeyType, getSession, getSlot, getUsageCount, getUsageLimit, hashCode, Initialize, Initialize, injectKey, InjectPrivateKey, InjectPrivateKey, InjectPrivateKey, InjectPrivateKey, IsKeyPersistent, LocateKeyByAlias, LocateKeyByAlias, LocateKeyByFingerprint, LocateKeyByFingerprint, LocateKeyByHandle, LocateKeyByHandle, LocateKeyOnlyByAlias, LocateKeyOnlyByAlias, MakePersistent, release, setKeySize, setUsageCount, setUsageLimit, toString, verifyClassAndType
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAlgorithm, getEncoded
destroy, isDestroyed
public LunaSecretKey(int hKey)
public LunaSecretKey(int hKey, int slot)
public LunaSecretKey(int hKey, int slot, long keyType)
public LunaSecretKey(LunaTokenObject object)
public String getFormat()
LunaKey
This will be one of
protected byte[] getEncodedInternal()
getEncodedInternal
in class LunaKey
public 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, 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
LunaException
Copyright 2014-2016 SafeNet Inc