public class LunaSecretKey extends LunaKey implements javax.crypto.SecretKey
ivRandom, ivSecureRandom, keySize, lapi, mKeyClass, mKeyType, mObject, 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, cacheAuthorizedSession, deleteCacheAuthorizedSession, DestroyKey, equals, generateRandomIv, getAlgorithm, GetAlias, getAuthorizedSession, getBytesRemaining, getCacheAuthorizedSession, GetDateMadePersistent, getEncoded, GetFingerprint, getKeyByType, GetKeyClass, GetKeyHandle, getKeySize, getKeyType, GetKeyType, GetOUID, 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, verifyClassAndType
public 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()
LunaKey
This will be one of
protected byte[] getEncodedInternal()
getEncodedInternal
in class LunaKey
public 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
LunaException
Copyright 2014-2018 SafeNet. All rights reserved.