|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectiaik.tc.tss.impl.java.tsp.TcAttributes
iaik.tc.tss.impl.java.tsp.TcWorkingObject
iaik.tc.tss.impl.java.tsp.TcContext
public class TcContext
Method Summary | |
---|---|
void |
closeContext()
This method destroys the object associated with the object handle. |
void |
closeObject(TcIWorkingObject obj)
This method is used to close a given object. |
void |
connect()
This method tries to connect the context to the default host (localhost). |
void |
connect(java.lang.String hostname)
This method tries to connect the context to a host running a TCS service. |
TcIEncData |
createEncDataObject(long initFlags)
This method returns a new encdata object. |
TcIHash |
createHashObject(long initFlags)
This method returns a new hash object. |
TcIMigData |
createMigDataObject(long initFlags)
This method returns a new migdata object. |
TcIPcrComposite |
createPcrCompositeObject(long initFlags)
This method returns a new PCR object. |
TcIPolicy |
createPolicyObject(long initFlags)
This method returns a new policy object. |
TcIRsaKey |
createRsaKeyObject(long initFlags)
For general details on this method please refer to TcIContext.createRsaKeyObject(long) . |
void |
freeMemory(long cPtr)
Deprecated. |
long |
getAttribConnectionVersion(long subFlag)
This method returns the connection version. |
long |
getAttribHashMode(long subFlag)
This method returns if secrets obtained via popups are hashed with or without null termination. |
TcBlobData |
getAttribMachineName(long subFlag)
This method returns the machines host name. |
long |
getAttribSilentMode(long subFlag)
This method returns the silent mode setting of the context. |
long |
getAttribVersionMode(long subFlag)
This method returns the version mode setting of the context. |
TcBlobData |
getCapability(long capArea,
TcBlobData subCap)
This method provides the capabilities of the TSS Core Service or TSS Service Provider. |
boolean |
getCapabilityBoolean(long capArea,
TcBlobData subCap)
This method provides the capabilities of the TSS Core Service or TSS Service Provider. |
TcTssVersion |
getCapabilityVersion(long capArea,
TcBlobData subCap)
This method provides the capabilities of the TSS Core Service or TSS Service Provider. |
TcIPolicy |
getDefaultPolicy()
Note: The default policy object is returned by reference. |
TcIRsaKey |
getKeyByPublicInfo(long stypeKey,
long algId,
TcBlobData publicInfo)
This method searches the persistent storage for a registered key using the provided public key information and creates a key object initialized according to the found data. |
TcIRsaKey |
getKeyByUuid(long stypeKey,
TcTssUuid uuidKey)
This method searches the persistent storage for a registered key using the provided UUID and creates a key object initialized according to the found data. |
TcIMonotonicCtr |
getMonotonicCounters(long handle)
This method is used to obtain a Monotonic Counter object that allows interaction with the TPM's counters. |
TcINvRam |
getNvRamObject(long nvIndex)
This method is used to obtain a NV RAM object that allows interaction with the TPM's NV RAM. |
TcTssKmKeyinfo[] |
getRegisteredKeysByUuid(TcTssUuid uuid,
long storage)
This method gets an array of key info objects. |
TcTssKmKeyinfo[] |
getRegisteredKeysByUuidSystem(TcTssUuid uuid)
This method is a wrapper for the getRegisteredKeysByUuid method. |
TcTssKmKeyinfo[] |
getRegisteredKeysByUuidUser(TcTssUuid uuid)
This method is a wrapper for the getRegisteredKeysByUuid method. |
TcITcsBinding |
getTcsBinding()
This method returns the underlying TCS binding. |
long |
getTcsContextHandle()
This method returns the handle of the corresponding TCS context. |
TcITpm |
getTpmObject()
This method is used to obtain a TPM object that allows interaction with the system's TPM. |
boolean |
isConnected()
This method returns the status of the context: True is returned if the context is connected, otherwise false. |
TcIRsaKey |
loadKeyByBlob(TcIRsaKey unwrappingKey,
TcBlobData blob)
This method creates a key object based on the information got by the key blob and loads the key into the TPM which unwraps the key blob utilizing the key addressed by unwrappingKey. |
TcIRsaKey |
loadKeyByUuidFromSystem(TcTssUuid uuid)
This method creates a key object based on the information contained in the key manager using the UUID and loads the key into the TPM. |
TcIRsaKey |
loadKeyByUuidFromUser(TcTssUuid uuid)
This method creates a key object based on the information contained in the key manager using the UUID and loads the key into the TPM. |
void |
registerKey(TcIRsaKey key,
long stypeKey,
TcTssUuid uuidKey,
long stypeParentKey,
TcTssUuid uuidParent)
This method registers a key in the TSS Persistent Storage database. |
void |
setAttribHashMode(long subflag,
long attrib)
This method is used to specify if passwords obtained via popups should be hashed with or without null termination. |
void |
setAttribSilentMode(long subflag,
long attrib)
This method is used to specify if GUI popups for entering passwords should be displayed or not. |
void |
setAttribVersionMode(long subflag,
long attrib)
This method is used to specify if 1.1 or 1.2. |
TcIRsaKey |
unregisterKey(long stypeKey,
TcTssUuid uuidKey)
This method unregisters a key from the persistent storage database. |
Methods inherited from class iaik.tc.tss.impl.java.tsp.TcAttributes |
---|
getAttribData, getAttribUint32, setAttribData, setAttribUint32 |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface iaik.tc.tss.api.tspi.TcIAttributes |
---|
getAttribData, getAttribUint32, setAttribData, setAttribUint32 |
Method Detail |
---|
public void connect(java.lang.String hostname) throws TcTssException
TcIContext
connect
in interface TcIContext
hostname
- The name of the cost to connect to. For example "http://127.0.0.1:30004/axis/services/TSSCoreServiceBindingImpl"
TcTssException
public void connect() throws TcTssException
TcIContext
connect
in interface TcIContext
TcTssException
public void closeContext() throws TcTssException
TcIContext
closeContext
in interface TcIContext
TcTssException
public void closeObject(TcIWorkingObject obj) throws TcTssException
TcIContext
closeObject
in interface TcIContext
obj
- The object to be closed.
TcTssException
public TcITcsBinding getTcsBinding()
public long getTcsContextHandle() throws TcTssException
TcTssException
public boolean isConnected()
TcIContext
isConnected
in interface TcIContext
public void freeMemory(long cPtr) throws TcTssException
freeMemory
in interface TcIContext
cPtr
- The memory block to be freed.
TcTssException
public TcBlobData getCapability(long capArea, TcBlobData subCap) throws TcTssException
TcIContext
getCapability
in interface TcIContext
capArea
- Flag indicating the attribute to query. TcTssConstants.TSS_TCSCAP_ALG
TcTssConstants.TSS_TCSCAP_VERSION
TcTssConstants.TSS_TCSCAP_CACHING
TcTssConstants.TSS_TCSCAP_PERSSTORAGE
TcTssConstants.TSS_TCSCAP_MANUFACTURER
TcTssConstants.TSS_TSPCAP_ALG
TcTssConstants.TSS_TSPCAP_VERSION
TcTssConstants.TSS_TSPCAP_PERSSTORAGE
TcTssConstants.TSS_TSPCAP_RANDOMLIMIT
subCap
- Data indicating the attribute to query. TcTssException
public boolean getCapabilityBoolean(long capArea, TcBlobData subCap) throws TcTssException
TcIContext
getCapabilityBoolean
in interface TcIContext
capArea
- Flag indicating the attribute to query. TcTssConstants.TSS_TCSCAP_ALG
TcTssConstants.TSS_TCSCAP_PERSSTORAGE
TcTssConstants.TSS_TCSCAP_CACHING
TcTssConstants.TSS_TSPCAP_ALG
TcTssConstants.TSS_TSPCAP_PERSSTORAGE
subCap
- Data indicating the attribute to query. TcTssConstants.TSS_TCSCAP_PROP_KEYCACHE
TcTssConstants.TSS_TCSCAP_PROP_AUTHCACHE
TcTssException
public TcTssVersion getCapabilityVersion(long capArea, TcBlobData subCap) throws TcTssException
TcIContext
getCapabilityVersion
in interface TcIContext
capArea
- Flag indicating the attribute to query. subCap
- Data indicating the attribute to query
TcTssException
public TcIEncData createEncDataObject(long initFlags) throws TcTssException
TcIContext
createEncDataObject
in interface TcIContext
initFlags
- is used to specify further options for the new object as defined by the TSS
specification. EncData related initialization values are prefixed with TSS_ENCDATA_
and are defined in TcTssConstants
. TcTssException
public TcIHash createHashObject(long initFlags) throws TcTssException
TcIContext
createHashObject
in interface TcIContext
initFlags
- is used to specify further options for the new object as defined by the TSS
specification. Hash related initialization values are prefixed with TSS_HASH_ and are
defined in TcTssConstants
. TcTssException
public TcIMigData createMigDataObject(long initFlags) throws TcTssException
TcIContext
createMigDataObject
in interface TcIContext
initFlags
- is used to specify further options for the new object as defined by the TSS
specification. Note: For TSS version 1.2 there is no migdata related init flag defined.
Consequently, 0 should be used as initFlags parameter.
TcTssException
public TcIPcrComposite createPcrCompositeObject(long initFlags) throws TcTssException
TcIContext
createPcrCompositeObject
in interface TcIContext
initFlags
- is used to specify further options for the new object as defined by the TSS
specification. Note: For TSS version 1.1 there is no PCR related init flag defined.
Consequently, 0 should be used as initFlags parameter.
TcTssException
public TcIPolicy createPolicyObject(long initFlags) throws TcTssException
TcIContext
createPolicyObject
in interface TcIContext
initFlags
- is used to specify further options for the new object as defined by the TSS
specification. Policy related initialization values are prefixed with TSS_POLICY_ and
are defined in TcTssConstants
. TcTssException
public TcIRsaKey createRsaKeyObject(long initFlags) throws TcTssException
TcIContext.createRsaKeyObject(long)
.
createRsaKeyObject
in interface TcIContext
initFlags
- is used to specify further options for the new object as defined by the TSS
specification. Key related initialization values are prefixed with TSS_KEY_ and are
defined in TcTssConstants
. TcTssConstants.TSS_KEY_SIZE_DEFAULT
TcTssConstants.TSS_KEY_SIZE_512
TcTssConstants.TSS_KEY_SIZE_1024
TcTssConstants.TSS_KEY_SIZE_2048
TcTssConstants.TSS_KEY_SIZE_4096
TcTssConstants.TSS_KEY_SIZE_8192
TcTssConstants.TSS_KEY_SIZE_16384
TcTssConstants.TSS_KEY_TYPE_AUTHCHANGE
TcTssConstants.TSS_KEY_TYPE_BIND
TcTssConstants.TSS_KEY_TYPE_DEFAULT
TcTssConstants.TSS_KEY_TYPE_IDENTITY
TcTssConstants.TSS_KEY_TYPE_LEGACY
(signing and binding)TcTssConstants.TSS_KEY_TYPE_SIGNING
TcTssConstants.TSS_KEY_TYPE_STORAGE
TcTssConstants.TSS_KEY_NON_VOLATILE
TcTssConstants.TSS_KEY_VOLATILE
TcTssConstants.TSS_KEY_NOT_MIGRATABLE
(default)TcTssConstants.TSS_KEY_MIGRATABLE
TcTssConstants.TSS_KEY_CERTIFIED_MIGRATABLE
TcTssConstants.TSS_KEY_NOT_CERTIFIED_MIGRATABLE
TcTssConstants.TSS_KEY_NO_AUTHORIZATION
(default)TcTssConstants.TSS_KEY_AUTHORIZATION
TcTssConstants.TSS_KEY_AUTHORIZATION_PRIV_USE_ONLY
TcTssConstants.TSS_KEY_STRUCT_DEFAULT
(default)TcTssConstants.TSS_KEY_STRUCT_KEY
TcTssConstants.TSS_KEY_STRUCT_KEY12
TcTssConstants.TSS_KEY_TSP_SRK
TcTssException
public TcIPolicy getDefaultPolicy() throws TcTssException
TcIContext.getDefaultPolicy()
.
getDefaultPolicy
in interface TcIContext
TcTssException
public TcIRsaKey getKeyByPublicInfo(long stypeKey, long algId, TcBlobData publicInfo) throws TcTssException
TcIContext
getKeyByPublicInfo
in interface TcIContext
stypeKey
- Flag indicating the persistent storage.algId
- Parameter indicates the algorithm of the requested key.publicInfo
- Public key info provided to identify the key to be looked for.
TcTssException
public TcIRsaKey getKeyByUuid(long stypeKey, TcTssUuid uuidKey) throws TcTssException
TcIContext
getKeyByUuid
in interface TcIContext
stypeKey
- Flag indicating the persistent storageuuidKey
- UUID of the key by which the key was registered in the persistent storage
TcTssException
public TcTssKmKeyinfo[] getRegisteredKeysByUuid(TcTssUuid uuid, long storage) throws TcTssException
TcIContext
getRegisteredKeysByUuid
in interface TcIContext
uuid
- The UUID the key was registered in the persistent storage. If no key UUID is
provided (null), the returned key info array contains data reflecting the whole key
hierarchy starting with the root key. If a certain key UUID is provided, the returned
array only contains data reflecting the path of the key hierarchy regarding that key.
The first array entry is the key addressed by the given UUID followed by its parent
key up to the root key.storage
- Flag indicating the persistent storage the key is registered in
(TcTssConstatnts.TSS_PS_TYPE_*).
TcTssException
public TcTssKmKeyinfo[] getRegisteredKeysByUuidSystem(TcTssUuid uuid) throws TcTssException
TcIContext
getRegisteredKeysByUuidSystem
in interface TcIContext
uuid
- (see getRegisteredKeysByUuid)
TcTssException
public TcTssKmKeyinfo[] getRegisteredKeysByUuidUser(TcTssUuid uuid) throws TcTssException
TcIContext
getRegisteredKeysByUuidUser
in interface TcIContext
uuid
- (see getRegisteredKeysByUuid)
TcTssException
public TcITpm getTpmObject() throws TcTssException
TcIContext
getTpmObject
in interface TcIContext
TcTssException
public TcIRsaKey loadKeyByBlob(TcIRsaKey unwrappingKey, TcBlobData blob) throws TcTssException
TcIContext
loadKeyByBlob
in interface TcIContext
unwrappingKey
- Key to unwrap the blob.blob
- Wrapped key blob to load.
TcTssException
public TcIRsaKey loadKeyByUuidFromSystem(TcTssUuid uuid) throws TcTssException
TcIContext
loadKeyByUuidFromSystem
in interface TcIContext
uuid
- UUID of the key to be loaded.
TcTssException
public TcIRsaKey loadKeyByUuidFromUser(TcTssUuid uuid) throws TcTssException
TcIContext
loadKeyByUuidFromUser
in interface TcIContext
uuid
- UUID of the key to be loaded.
TcTssException
public void registerKey(TcIRsaKey key, long stypeKey, TcTssUuid uuidKey, long stypeParentKey, TcTssUuid uuidParent) throws TcTssException
TcIContext
registerKey
in interface TcIContext
key
- Handle of the key object addressing the key to be registered.stypeKey
- Flag indicating the persistent storageuuidKey
- UUID by which the key is registered in the persistent storagestypeParentKey
- Flag indicating the persistent storageuuidParent
- UUID by which the parent key was registered in the persistent storage
TcTssException
public TcIRsaKey unregisterKey(long stypeKey, TcTssUuid uuidKey) throws TcTssException
TcIContext
unregisterKey
in interface TcIContext
stypeKey
- Flag indicating the persistent storageuuidKey
- UUID of the key to be removed from the persistent storage
TcTssException
public void setAttribSilentMode(long subflag, long attrib) throws TcTssException
TcIAttributes.setAttribUint32(long, long, long)
. Note that this method is not
standardized as part of the TSP Interface (TSPI).
subflag
- Ignored (set to 0).attrib
- Either TcTssConstants.TSS_TSPATTRIB_CONTEXT_SILENT
or
TcTssConstants.TSS_TSPATTRIB_CONTEXT_NOT_SILENT
.
TcTssException
public long getAttribSilentMode(long subFlag) throws TcTssException
TcIAttributes.getAttribUint32(long, long)
.
subFlag
- Ignored (set to 0).
TcTssConstants.TSS_TSPATTRIB_CONTEXT_SILENT
or
TcTssConstants.TSS_TSPATTRIB_CONTEXT_NOT_SILENT
.
TcTssException
public void setAttribVersionMode(long subflag, long attrib) throws TcTssException
TcIAttributes.setAttribUint32(long, long, long)
.
subflag
- Ignored (set to 0).attrib
- Either TcTssConstants.TSS_TSPATTRIB_CONTEXT_VERSION_V1_1
or
TcTssConstants.TSS_TSPATTRIB_CONTEXT_VERSION_V1_2
or
TcTssConstants.TSS_TSPATTRIB_CONTEXT_VERSION_AUTO
.
TcTssException
public long getAttribVersionMode(long subFlag) throws TcTssException
TcIAttributes.getAttribUint32(long, long)
.
subFlag
- Ignored (set to 0).
TcTssConstants.TSS_TSPATTRIB_CONTEXT_VERSION_V1_1
or
TcTssConstants.TSS_TSPATTRIB_CONTEXT_VERSION_V1_2
or
TcTssConstants.TSS_TSPATTRIB_CONTEXT_VERSION_AUTO
.
TcTssException
public void setAttribHashMode(long subflag, long attrib) throws TcTssException
TcIAttributes.setAttribUint32(long, long, long)
.
subflag
- TcTssConstants.TSS_TSPATTRIB_SECRET_HASH_MODE_POPUP
attrib
- Either TcTssConstants.TSS_TSPATTRIB_HASH_MODE_NOT_NULL
or
TcTssConstants.TSS_TSPATTRIB_HASH_MODE_NULL
.
TcTssException
public long getAttribHashMode(long subFlag) throws TcTssException
TcIAttributes.getAttribUint32(long, long)
.
subFlag
- TcTssConstants.TSS_TSPATTRIB_SECRET_HASH_MODE_POPUP
TcTssConstants.TSS_TSPATTRIB_HASH_MODE_NOT_NULL
or
TcTssConstants.TSS_TSPATTRIB_HASH_MODE_NULL
.
TcTssException
public long getAttribConnectionVersion(long subFlag) throws TcTssException
TcIAttributes.getAttribUint32(long, long)
.
subFlag
- Ignored (set to 0).
TcTssConstants.TSS_CONNECTION_VERSION_1_1
or
TcTssConstants.TSS_CONNECTION_VERSION_1_2
.
{@link
- TcTssException}
TcTssException
public TcBlobData getAttribMachineName(long subFlag) throws TcTssException
TcIAttributes.getAttribUint32(long, long)
.
subFlag
- Ignored (set to 0).
{@link
- TcTssException}
TcTssException
public TcIMonotonicCtr getMonotonicCounters(long handle) throws TcTssException
TcIContext
getMonotonicCounters
in interface TcIContext
TcTssException
public TcINvRam getNvRamObject(long nvIndex) throws TcTssException
TcIContext
getNvRamObject
in interface TcIContext
TcTssException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |