public class LunaSecretKey extends LunaKey implements javax.crypto.SecretKey
ecParamSpec, ivRandom, ivSecureRandom, keySize, lapi, mAlgId, mKeyClass, mKeyType, mObject, mParameterSet, UNLIMITED_USE| Constructor and Description |
|---|
LunaSecretKey(int hKey) |
LunaSecretKey(int hKey,
int slot) |
LunaSecretKey(int hKey,
int slot,
long keyType) |
LunaSecretKey(int hKey,
int slot,
java.util.Map<java.lang.Long,java.lang.Object> sessionParameters) |
LunaSecretKey(LunaTokenObject object) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
ExtractSecretKey()
Extract a Luna secret key from the token
|
protected byte[] |
getEncodedInternal() |
java.lang.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,
java.lang.String algorithm)
Inject (encrypt encoded key and unwrap) an encoded secret key into the token at the default
slot.
|
static LunaSecretKey |
InjectSecretKey(byte[] keyBytes,
java.lang.String algorithm,
int slot)
Inject (encrypt encoded key and unwrap) an encoded secret key into the token at the specified
slot.
|
static LunaSecretKey |
InjectSecretKey(javax.crypto.SecretKey key)
Inject (encrypt encoded key and unwrap) a non-Luna secret key into the token at the default
slot.
|
static LunaSecretKey |
InjectSecretKey(javax.crypto.SecretKey key,
int slot)
Inject (encrypt encoded key and unwrap) a non-Luna secret key into the token at the specified
slot.
|
assign, AttributeToBigInteger, authorize, BigIntegerToAttribute, DestroyKey, equals, generateRandomIv, getAlgorithm, GetAlias, getAuthorizedSession, getBytesRemaining, GetDateMadePersistent, getEncoded, GetFingerprint, getKeyByType, GetKeyClass, GetKeyHandle, getKeySize, getKeyType, GetKeyType, GetOUID, getParameterSet, getSession, getSlot, getUsageCount, getUsageLimit, hashCode, incrementFailedAuthorizationCount, Initialize, Initialize, injectKey, InjectPrivateKey, InjectPrivateKey, InjectPrivateKey, InjectPrivateKey, isInitialized, IsKeyPersistent, LocateKeyByAlias, LocateKeyByAlias, LocateKeyByFingerprint, LocateKeyByFingerprint, LocateKeyByHandle, LocateKeyByHandle, LocateKeyByOUID, LocateKeyByOUID, LocateKeyOnlyByAlias, LocateKeyOnlyByAlias, MakePersistent, release, resetAuthorizationData, resetAuthorizedSession, setAuthorizationData, setKeySize, setUsageCount, setUsageLimit, toString, verifyClassAndTypepublic LunaSecretKey(int hKey)
public LunaSecretKey(int hKey,
int slot)
public LunaSecretKey(int hKey,
int slot,
long keyType)
public LunaSecretKey(int hKey,
int slot,
java.util.Map<java.lang.Long,java.lang.Object> sessionParameters)
public LunaSecretKey(LunaTokenObject object)
public java.lang.String getFormat()
LunaKeyThis will be one of
protected byte[] getEncodedInternal()
getEncodedInternal in class LunaKeypublic static LunaSecretKey InjectSecretKey(javax.crypto.SecretKey key) throws java.security.InvalidKeyException
key - The non-Luna key objectjava.security.InvalidKeyException - If the key is not encoded in RAW formatLunaException - If there is a problem creating/injecting the keys on the HSMpublic static LunaSecretKey InjectSecretKey(javax.crypto.SecretKey key, int slot) throws java.security.InvalidKeyException
key - The non-Luna key objectslot - The slot of the token to inject the key intojava.security.InvalidKeyException - 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, java.lang.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, java.lang.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.