new TpmKeyHandleMemory(key)
TpmKeyHandleMemory extends TpmKeyHandle to implement a TPM key handle that
keeps the private key in memory.
Create a TpmKeyHandleMemory to use the given in-memory key.
Parameters:
Name | Type | Description |
---|---|---|
key |
TpmPrivateKey | The in-memory key. |
Methods
doDecryptPromise_(cipherText, useSync) → {Promise|SyncPromise}
A protected method to do the work of decrypt().
Parameters:
Name | Type | Description |
---|---|---|
cipherText |
Buffer | The cipher text byte buffer. |
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 decrypted data Blob,
or a promise rejected with TpmPrivateKey.Error for error decrypting.
- Type
- Promise | SyncPromise
doSignPromise_(digestAlgorithm, data, useSync) → {Promise|SyncPromise}
A protected method to do the work of sign().
Parameters:
Name | Type | Description |
---|---|---|
digestAlgorithm |
number | The digest algorithm as an int from the DigestAlgorithm enum. |
data |
Buffer | The input byte buffer. |
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 signature Blob (or
an isNull Blob for an unrecognized digestAlgorithm), or a promise rejected
with TpmBackEnd.Error for an error in signing.
- Type
- Promise | SyncPromise