You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//# For a Beacon Key Source a [CMC](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/cryptographic-materials-cache.md)
152
152
//# MUST be created.
153
-
//# For a [Single Key Store](#single-key-store-initialization), either the user provides a cache, or we create a cache that MUST have [Entry Capacity](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/cryptographic-materials-cache.md#entry-capacity)
154
-
//# equal to 1. If the user provides a cache which is not `Shared`, they SHOULD set the [Entry Capacity](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/cryptographic-materials-cache.md#entry-capacity)
155
-
//# of the provided `CacheType` to 1, because the [Single Key Store](#single-key-store-initialization) only ever caches one entry. Even if the user provides an entryCapacity > 1, the [Single Key Store](#single-key-store-initialization) will only cache one entry.
156
-
//# For a [Multi Key Store](#multi-key-store-initialization), either the user provides a cache, or we create a cache that MUST have [Entry Capacity](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/cryptographic-materials-cache.md#entry-capacity)
153
+
//# For a [Single Key Store](#single-key-store-initialization), either the user provides a cache, or we create a cache that has [Entry Capacity](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/cryptographic-materials-cache.md#entry-capacity)
154
+
//# equal to 1.
155
+
//# For a [Multi Key Store](#multi-key-store-initialization), either the user provides a cache, or we create a cache that has [Entry Capacity](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/cryptographic-materials-cache.md#entry-capacity)
//# used to [Put Cache Entry](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/local-cryptographic-materials-cache.md#put-cache-entry)
323
+
//# MUST be the same
324
+
//# as the identifier that was used to attempt [Get Cache Entry](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/local-cryptographic-materials-cache.md#get-cache-entry).
Copy file name to clipboardExpand all lines: specification/searchable-encryption/search-config.md
+34-30Lines changed: 34 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -220,14 +220,13 @@ for how long a beacon key should exist locally before reauthorization.
220
220
221
221
For a Beacon Key Source a [CMC](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/cryptographic-materials-cache.md)
222
222
MUST be created.
223
-
For a [Single Key Store](#single-key-store-initialization), either the user provides a cache, or we create a cache that MUST have [Entry Capacity](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/cryptographic-materials-cache.md#entry-capacity)
224
-
equal to 1. If the user provides a cache which is not `Shared`, they SHOULD set the [Entry Capacity](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/cryptographic-materials-cache.md#entry-capacity)
225
-
of the provided `CacheType` to 1, because the [Single Key Store](#single-key-store-initialization) only ever caches one entry. Even if the user provides an entryCapacity > 1, the [Single Key Store](#single-key-store-initialization) will only cache one entry.
226
-
For a [Multi Key Store](#multi-key-store-initialization), either the user provides a cache, or we create a cache that MUST have [Entry Capacity](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/cryptographic-materials-cache.md#entry-capacity)
223
+
For a [Single Key Store](#single-key-store-initialization), either the user provides a cache, or we create a cache that has [Entry Capacity](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/cryptographic-materials-cache.md#entry-capacity)
224
+
equal to 1.
225
+
For a [Multi Key Store](#multi-key-store-initialization), either the user provides a cache, or we create a cache that has [Entry Capacity](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/cryptographic-materials-cache.md#entry-capacity)
227
226
equal to 1000.
228
227
229
-
The Key Store Cache MUST be shared across different [Beacon Key Sources](#beacon-key-source) if and only if a `Shared` cache is used.
230
-
In all other cases, the Key Store Cache MUST be bound to the [Beacon Key Source](#beacon-key-source).
228
+
The Key Store Cache is shared across different [Beacon Key Sources](#beacon-key-source) if and only if a `Shared` cache is used.
229
+
In all other cases, the Key Store Cache is bound to the [Beacon Key Source](#beacon-key-source).
231
230
In either case, Cache Identifiers MUST be unique across all key sources.
232
231
Cache Identifiers for Searchable Encryption MUST be set as per the section [Searchable Encryption Cache Identifier](#searchable-encryption-cache-identifier).
233
232
@@ -325,6 +324,14 @@ exists, get beacon key MUST return the [entry materials](../../submodules/Materi
325
324
The `beacon key id` MUST be passed to the configured `KeyStore`'s `GetBeaconKey` operation.
326
325
If `GetBeaconKey` fails get beacon key MUST fail.
327
326
327
+
If using a `Shared` cache across multiple [Beacon Key Sources](#beacon-key-source),
328
+
different [Beacon Key Sources](#beacon-key-source) having the same `beaconKey` can have different TTLs.
329
+
In such a case, the expiry time in the cache is set according to the [Beacon Key Source](#beacon-key-source) that populated the cache.
330
+
There MUST be a check (cacheEntryWithinLimits) to make sure that for the cache entry found, who's TTL has NOT expired,
331
+
`time.now() - cacheEntryCreationTime <= ttlSeconds` is true and
332
+
valid for TTL of the [Beacon Key Source](#beacon-key-source) getting the cache entry.
333
+
If this is NOT true, then we MUST treat the cache entry as expired.
334
+
328
335
For every [standard beacons](beacons.md#standard-beacon-initialization), an HMAC key
329
336
MUST be generated in accordance with [HMAC Key Generation](#hmac-key-generation).
330
337
@@ -337,19 +344,10 @@ These materials MUST be put into the associated [Key Store Cache](#key-store-cac
337
344
with an [Expiry Time](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/cryptographic-materials-cache.md#expiry-time)
338
345
equal to now + configured [cacheTTL](#cachettl).
339
346
340
-
The Searchable Encryption cache identifier for [Key Store Cache](#key-store-cache)
If using a `Shared` cache across multiple [Beacon Key Sources](#beacon-key-source),
347
-
different [Beacon Key Sources](#beacon-key-source) having the same `branchKey` can have different TTLs.
348
-
In such a case, the expiry time in the cache is set according to the [Beacon Key Source](#beacon-key-source) that populated the cache.
349
-
There MUST be a check (cacheEntryWithinLimits) to make sure that for the cache entry found, who's TTL has NOT expired,
350
-
`time.now() - cacheEntryCreationTime <= ttlSeconds` is true and
351
-
valid for TTL of the [Beacon Key Source](#beacon-key-source) getting the cache entry.
352
-
If this is NOT true, then we MUST treat the cache entry as expired.
347
+
The Searchable Encryption cache identifier
348
+
used to [Put Cache Entry](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/local-cryptographic-materials-cache.md#put-cache-entry)
349
+
MUST be the same
350
+
as the identifier that was used to attempt [Get Cache Entry](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/local-cryptographic-materials-cache.md#get-cache-entry).
353
351
354
352
These cached materials MUST be returned.
355
353
@@ -366,6 +364,10 @@ The `expectedLength` MUST be 64 bytes.
366
364
367
365
## Searchable Encryption Cache Identifier
368
366
367
+
This section is consistent with the Cache Entry Identifier formulas for the [Hierarchical Keyring](https://github.com/awslabs/aws-encryption-sdk-specification/blob/master/framework/aws-kms/aws-kms-hierarchical-keyring.md#appendix-a-cache-entry-identifier-formulas)
368
+
and [Caching CMM](https://github.com/awslabs/aws-encryption-sdk-specification/blob/master/framework/caching-cmm.md#appendix-a-cache-entry-identifier-formulas) in the Material Providers spec. These cache identifier formulas should
369
+
not be changed independently.
370
+
369
371
When accessing the underlying cryptographic materials cache,
370
372
Searchable Encryption MUST use the formulas specified in this section
371
373
in order to compute the [cache entry identifier](../../submodules/MaterialProviders/aws-encryption-sdk-specification/framework/cryptographic-materials-cache.md#cache-identifier).
@@ -480,12 +482,12 @@ If a user has two or more [beacon versions](#beacon-version-initialization) with
480
482
481
483
then they WILL share the cache entries in the `Shared` Cache.
482
484
483
-
Any keyring that has access to the `Shared` cache MAY be able to use materials
484
-
that it MAY or MAY NOT have direct access to.
485
+
Any keyring that has access to the `Shared` cache may be able to use materials
486
+
that it may or may not have direct access to.
485
487
486
-
Users MUST make sure that all of Partition ID, Logical Key Store Name of the Key Store
487
-
and Branch Key ID are set to be the same for two [beacon versions](#beacon-version-initialization) if and only they want the keyrings to share
488
-
cache entries.
488
+
Users should make sure that all of Partition ID, Logical Key Store Name of the Key Store
489
+
and Branch Key ID are set to be the same for two [beacon versions](#beacon-version-initialization)
490
+
if and only they want the keyrings to share cache entries.
489
491
490
492
Therefore, there are two important parameters that users need to carefully set while providing the shared cache:
491
493
@@ -495,19 +497,21 @@ Partition ID is an optional parameter provided to the [Beacon Key Source](#beaco
495
497
which distinguishes Cryptographic Material Providers (i.e: [Beacon Key Sources](#beacon-key-source)) writing to a cache.
496
498
497
499
- (Default) A a random 16-byte UUID, which makes
498
-
it unique for every [Beacon Key Source](#beacon-key-source). In this case, two [Beacon Key Sources](#beacon-key-source) (or another Material Provider)
499
-
CANNOT share the same cache entries in the cache.
500
+
it unique for every [Beacon Key Source](#beacon-key-source).
501
+
In this case, two [Beacon Key Sources](#beacon-key-source) (or another Material Provider)
502
+
WILL NOT share the same cache entries in the cache.
500
503
- If the Partition ID is set by the user and is the same for two [Beacon Key Sources](#beacon-key-source) (or another Material Provider),
501
-
they CAN share the same cache entries in the cache.
504
+
they MAY share the same cache entries in the cache.
502
505
- If the Partition ID is set by the user and is different for two [Beacon Key Sources](#beacon-key-source) (or another Material Provider),
503
-
they CANNOT share the same cache entries in the cache.
506
+
they WILL NOT share the same cache entries in the cache.
504
507
505
508
### Logical Key Store Name
506
509
507
-
> Note: Users MUST NEVER have two different physical Key Stores with the same Logical Key Store Name.
510
+
> Note: Users should not have two different physical Key Stores with the same Logical Key Store Name.
508
511
509
512
Logical Key Store Name is set by the user when configuring the Key Store for
510
-
the [beacon versions](#beacon-version-initialization). This is a logical name for the key store.
513
+
the [beacon versions](#beacon-version-initialization).
514
+
This is a logical name for the key store.
511
515
Logical Key Store Name MUST be converted to UTF8 Bytes to be used in
0 commit comments