public class LunaSIMKey extends Object implements Key
serialVersionUID| Constructor and Description |
|---|
LunaSIMKey()
Default constructor.
|
LunaSIMKey(byte[] blob)
Create a LunaSIMKey an initialize its blob
|
LunaSIMKey(Key key)
SIM a Key with CKA_SIM_NO_AUTHORIZATION
|
LunaSIMKey(Key key,
char[] password)
SIM a Key with CKA_SIM_NO_AUTHORIZATION or CKA_SIM_PASSWORD and M=N=1
|
LunaSIMKey(Key key,
int authSubsetCount,
Collection<String> authSecretList)
SIM a Key with CKA_SIM_PASSWORD
|
LunaSIMKey(Key key,
int authSecretCount,
int authSubsetCount,
int authForm)
SIM a Key with CKA_SIM_CHALLENGE or CKA_SIM_SECURE_PORT
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAlgorithm() |
byte[] |
getEncoded() |
String |
getFormat() |
LunaKey |
getKey()
UnSIM the key with CKA_SIM_NO_AUTHORIZATION
|
LunaKey |
getKey(char[] password)
UnSIM the key with CKA_SIM_NO_AUTHORIZATION or CKA_SIM_PASSWORD and M=N=1
|
LunaKey |
getKey(int authForm,
Collection<String> authSecretList)
UnSIM the key with any auth form
Kept for backwards compatibility.
|
LunaKey |
getKey(long authForm,
Collection<String> authSecretList)
UnSIM the key with any auth form
|
static byte[] |
SIMExtract(LunaKey[] lunaKeys,
int authSecretCount,
int authSubsetCount,
long authForm,
Collection<String> authSecretList)
Extract a key blob from the HSM.
|
static LunaKey[] |
SIMInsert(long authForm,
Collection<String> authSecretList,
byte[] blob)
Insert a key blob onto the HSM.
|
String |
toString()
Returns a string representation of the key
|
public LunaSIMKey()
public LunaSIMKey(byte[] blob)
blob - The key blobpublic LunaSIMKey(Key key) throws InvalidKeyException
key - a key objectInvalidKeyException - exceptionpublic LunaSIMKey(Key key, char[] password) throws InvalidKeyException
key - a key objectpassword - SIM passwordInvalidKeyException - exceptionpublic LunaSIMKey(Key key, int authSecretCount, int authSubsetCount, int authForm) throws InvalidKeyException
key - a key objectauthSecretCount - N valueauthSubsetCount - M valueauthForm - authentication typeInvalidKeyException - exceptionpublic LunaSIMKey(Key key, int authSubsetCount, Collection<String> authSecretList) throws InvalidKeyException
key - a key objectauthSubsetCount - M valueauthSecretList - Collection of password StringsInvalidKeyException - exceptionpublic LunaKey getKey() throws InvalidKeyException
InvalidKeyException - exceptionpublic LunaKey getKey(char[] password) throws InvalidKeyException
password - SIM passwordInvalidKeyException - exceptionpublic LunaKey getKey(int authForm, Collection<String> authSecretList) throws InvalidKeyException
authForm - authentication typeauthSecretList - authentication listInvalidKeyException - exceptionpublic LunaKey getKey(long authForm, Collection<String> authSecretList) throws InvalidKeyException
authForm - authentication typeauthSecretList - authentication listInvalidKeyException - exceptionpublic String toString()
public String getAlgorithm()
getAlgorithm in interface Keypublic byte[] getEncoded()
getEncoded in interface Keypublic static LunaKey[] SIMInsert(long authForm, Collection<String> authSecretList, byte[] blob) throws InvalidKeyException
authForm - The auth form.authSecretList - A Collection of the password Stringsblob - The key blobInvalidKeyException - if the authSecretList is specified and its
size doesn't match authSecretCount.public static byte[] SIMExtract(LunaKey[] lunaKeys, int authSecretCount, int authSubsetCount, long authForm, Collection<String> authSecretList) throws InvalidKeyException
lunaKeys - The array of LunaKeys to be extracted. All of
these keys must be in the same slotauthSecretCount - The N valueauthSubsetCount - The M valueauthForm - The auth form.authSecretList - A Collection of the password StringsInvalidKeyException - if the authSecretList is specified and its
size doesn't match authSecretCount.Copyright 2014-2016 SafeNet Inc