Support generating ECDSA keys in a trusted execution environment #2281
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for generating ECDSA keys in a trusted execution
environment (TEE) that can be used for signing and verification. Such
keys are generated in the TEE and never leave it.
Because the keys are generated in the TEE, the keys themselves cannot be
exported. Instead, a handle to the key is exported. The handle can be
used to import the key and use it for signing and verification, but not
to extract the key itself.
A new
options
parameter is added tocrypto.subtle.generateKey()
. Ithas two optional properties:
inTee
andusageRequiresAuth
.inTee
isa boolean that indicates whether the key should be generated in a TEE.
usageRequiresAuth
is also a boolean that indicates whether the key canonly be used when the user has authenticated.
An example of how to generate and use a key in a TEE is added to the
crypto-sign
snippet. The snippet now contains two examples: one forgenerating and using keys in the normal way, and one for generating and
using keys in a TEE. The
crypto-sign
snippets now also demonstrateexporting and importing keys.