public class LunaSIMKey
extends java.lang.Object
implements java.security.Key
| Constructor and Description |
|---|
LunaSIMKey()
Default constructor.
|
LunaSIMKey(byte[] blob)
Create a LunaSIMKey an initialize its blob
|
LunaSIMKey(java.security.Key key)
SIM a Key with CKA_SIM_NO_AUTHORIZATION
|
LunaSIMKey(java.security.Key key,
char[] password)
SIM a Key with CKA_SIM_NO_AUTHORIZATION or CKA_SIM_PASSWORD and M=N=1
|
LunaSIMKey(java.security.Key key,
int authSubsetCount,
java.util.Collection<java.lang.String> authSecretList)
SIM a Key with CKA_SIM_PASSWORD
|
LunaSIMKey(java.security.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 |
|---|---|
java.lang.String |
getAlgorithm() |
byte[] |
getEncoded() |
java.lang.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,
java.util.Collection<java.lang.String> authSecretList)
UnSIM the key with any auth form Kept for backwards compatibility.
|
LunaKey |
getKey(long authForm,
java.util.Collection<java.lang.String> authSecretList)
UnSIM the key with any auth form
|
static byte[] |
SIMExtract(LunaKey[] lunaKeys,
int authSecretCount,
int authSubsetCount,
long authForm,
java.util.Collection<java.lang.String> authSecretList)
Extract a key blob from the HSM.
|
static LunaKey[] |
SIMInsert(long authForm,
java.util.Collection<java.lang.String> authSecretList,
byte[] blob)
Insert a key blob onto the HSM.
|
java.lang.String |
toString()
Returns a string representation of the key
|
public LunaSIMKey()
public LunaSIMKey(byte[] blob)
blob - The key blobpublic LunaSIMKey(java.security.Key key)
throws java.security.InvalidKeyException
key - a key objectjava.security.InvalidKeyException - exceptionpublic LunaSIMKey(java.security.Key key,
char[] password)
throws java.security.InvalidKeyException
key - a key objectpassword - SIM passwordjava.security.InvalidKeyException - exceptionpublic LunaSIMKey(java.security.Key key,
int authSecretCount,
int authSubsetCount,
int authForm)
throws java.security.InvalidKeyException
key - a key objectauthSecretCount - N valueauthSubsetCount - M valueauthForm - authentication typejava.security.InvalidKeyException - exceptionpublic LunaSIMKey(java.security.Key key,
int authSubsetCount,
java.util.Collection<java.lang.String> authSecretList)
throws java.security.InvalidKeyException
key - a key objectauthSubsetCount - M valueauthSecretList - Collection of password Stringsjava.security.InvalidKeyException - exceptionpublic LunaKey getKey() throws java.security.InvalidKeyException
java.security.InvalidKeyException - exceptionpublic LunaKey getKey(char[] password) throws java.security.InvalidKeyException
password - SIM passwordjava.security.InvalidKeyException - exceptionpublic LunaKey getKey(int authForm, java.util.Collection<java.lang.String> authSecretList) throws java.security.InvalidKeyException
authForm - authentication typeauthSecretList - authentication listjava.security.InvalidKeyException - exceptionpublic LunaKey getKey(long authForm, java.util.Collection<java.lang.String> authSecretList) throws java.security.InvalidKeyException
authForm - authentication typeauthSecretList - authentication listjava.security.InvalidKeyException - exceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getAlgorithm()
getAlgorithm in interface java.security.Keypublic byte[] getEncoded()
getEncoded in interface java.security.Keypublic java.lang.String getFormat()
getFormat in interface java.security.Keypublic static LunaKey[] SIMInsert(long authForm, java.util.Collection<java.lang.String> authSecretList, byte[] blob) throws java.security.InvalidKeyException
authForm - The auth form.authSecretList - A Collection of the password Stringsblob - The key blobjava.security.InvalidKeyException - if the authSecretList is specified and its size doesn't match authSecretCount.public static byte[] SIMExtract(LunaKey[] lunaKeys, int authSecretCount, int authSubsetCount, long authForm, java.util.Collection<java.lang.String> authSecretList) throws java.security.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 Stringsjava.security.InvalidKeyException - if the authSecretList is specified and its size doesn't match authSecretCount.Copyright 2014-2018 SafeNet. All rights reserved.