new TpmBackEndMemory()
TpmBackEndMemory extends TpmBackEnd to implement a TPM back-end using
in-memory storage.
Methods
doCreateKeyPromise_(identityName, params, useSync) → {Promise|SyncPromise}
A protected method to create a key for identityName according to params. The
created key is named as: //[keyId]/KEY . The key name is set in
the returned TpmKeyHandle.
Parameters:
Name | Type | Description |
---|---|---|
identityName |
Name | The name if the identity. |
params |
KeyParams | The KeyParams for creating the key. |
useSync |
boolean | (optional) If true then return a SyncPromise which is already fulfilled. If omitted or false, this may return a SyncPromise or an async Promise. |
Returns:
A promise which returns the TpmKeyHandle of
the created key, or a promise rejected with TpmBackEnd.Error if the key
cannot be created.
- Type
- Promise | SyncPromise
doDeleteKeyPromise_(keyName, useSync) → {Promise|SyncPromise}
A protected method to delete the key with name keyName. If the key doesn't
exist, do nothing.
Parameters:
Name | Type | Description |
---|---|---|
keyName |
Name | The name of the key to delete. |
useSync |
boolean | (optional) If true then return a SyncPromise which is already fulfilled. If omitted or false, this may return a SyncPromise or an async Promise. |
Returns:
A promise which fulfills when finished, or a
promise rejected with TpmBackEnd.Error if the deletion fails.
- Type
- Promise | SyncPromise
doGetKeyHandlePromise_(keyName, useSync) → {Promise|SyncPromise}
A protected method to get the handle of the key with name keyName.
Parameters:
Name | Type | Description |
---|---|---|
keyName |
Name | The name of the key. |
useSync |
boolean | (optional) If true then return a SyncPromise which is already fulfilled. If omitted or false, this may return a SyncPromise or an async Promise. |
Returns:
A promise which returns a TpmKeyHandle of the
key, or returns null if the key does not exist.
- Type
- Promise | SyncPromise
doHasKeyPromise_(keyName, useSync) → {Promise|SyncPromise}
A protected method to check if the key with name keyName exists in the TPM.
Parameters:
Name | Type | Description |
---|---|---|
keyName |
Name | The name of the key. |
useSync |
boolean | (optional) If true then return a SyncPromise which is already fulfilled. If omitted or false, this may return a SyncPromise or an async Promise. |
Returns:
A promise which returns true if the key exists.
- Type
- Promise | SyncPromise
doImportKeyPromise_(keyName, pkcs8, password, useSync) → {Promise|SyncPromise}
A protected method to import an encoded private key with name keyName in
PKCS #8 format, possibly password-encrypted.
Parameters:
Name | Type | Description |
---|---|---|
keyName |
Name | The name of the key to use in the TPM. |
pkcs8 |
Buffer | The input byte buffer. If the password is supplied, this is a PKCS #8 EncryptedPrivateKeyInfo. If the password is none, this is an unencrypted PKCS #8 PrivateKeyInfo. |
password |
Buffer | The password for decrypting the private key. If the password is supplied, use it to decrypt the PKCS #8 EncryptedPrivateKeyInfo. If the password is null, import an unencrypted PKCS #8 PrivateKeyInfo. |
useSync |
boolean | (optional) If true then return a SyncPromise which is already fulfilled. If omitted or false, this may return a SyncPromise or an async Promise. |
Returns:
A promise which fulfills when finished, or a
promise rejected with TpmBackEnd.Error for an error importing the key.
- Type
- Promise | SyncPromise