public class TpmBackEndFile extends TpmBackEnd
| Modifier and Type | Class and Description |
|---|---|
static class |
TpmBackEndFile.Error
A TpmBackEndFile.Error extends TpmBackEnd.Error and represents a
non-semantic error in backend TPM file processing.
|
| Constructor and Description |
|---|
TpmBackEndFile()
Create a TpmBackEndFile to store files in the default location
HOME/.ndn/ndnsec-key-file where HOME is System.getProperty("user.home").
|
TpmBackEndFile(String locationPath)
Create a TpmBackEndFile to use the given path to store files.
|
| Modifier and Type | Method and Description |
|---|---|
protected TpmKeyHandle |
doCreateKey(Name identityName,
KeyParams params)
Create a key for identityName according to params.
|
protected void |
doDeleteKey(Name keyName)
Delete the key with name keyName.
|
protected TpmKeyHandle |
doGetKeyHandle(Name keyName)
Get the handle of the key with name keyName.
|
protected boolean |
doHasKey(Name keyName)
Check if the key with name keyName exists in the TPM.
|
static String |
getDefaultDirecoryPath(File filesRoot)
Get the default directory path for private keys based on the files root.
|
static String |
getDefaultDirecoryPath(String filesRoot)
Get the default directory path for private keys based on the files root.
|
static String |
getScheme() |
createKey, deleteKey, doExportKey, doImportKey, exportKey, getKeyHandle, hasKey, importKey, isTerminalMode, isTpmLocked, setKeyName, setTerminalMode, unlockTpmpublic TpmBackEndFile()
public TpmBackEndFile(String locationPath)
locationPath - The full path of the directory to store private keys.
This creates the directory if it doesn't exist. For example, you can get
the default directory path from an Android files directory with
getDefaultDirecoryPath(context.getFilesDir()) .public static String getDefaultDirecoryPath(File filesRoot)
filesRoot - The root file directory. An Android app can use
context.getFilesDir()public static String getDefaultDirecoryPath(String filesRoot)
filesRoot - The root file directory.public static String getScheme()
protected boolean doHasKey(Name keyName) throws TpmBackEnd.Error
doHasKey in class TpmBackEndkeyName - The name of the key.TpmBackEnd.Errorprotected TpmKeyHandle doGetKeyHandle(Name keyName) throws TpmBackEnd.Error
doGetKeyHandle in class TpmBackEndkeyName - The name of the key.TpmBackEnd.Errorprotected TpmKeyHandle doCreateKey(Name identityName, KeyParams params) throws TpmBackEnd.Error
doCreateKey in class TpmBackEndidentityName - The name if the identity.params - The KeyParams for creating the key.TpmBackEnd.Error - if the key cannot be created.protected void doDeleteKey(Name keyName) throws TpmBackEnd.Error
doDeleteKey in class TpmBackEndkeyName - The name of the key to delete.TpmBackEnd.Error - if the deletion fails.Copyright © 2018. All rights reserved.