Interface AsyncEncapsulatedKeyManager
An asynchronous manager for encapsulated keys.
EnvelopePropertyEncryptionProfile requires data keys to exist before they can be used for encryption. This
manager provides asynchronous operations for creating and managing such keys.
When creating a key, the manager uses the configured BaseKeyEncapsulationService to generate and encapsulate
a new data key and registers the resulting EncapsulatedKeyRecord with the configured
BaseEncapsulatedKeyRecordRepository. Both synchronous and asynchronous implementations of these services
are supported.
- Since:
- 6.3.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault CompletionStage<EncapsulatedKey> Creates a new encapsulated key without an alias.default CompletionStage<EncapsulatedKey> createAsync(String alias) Creates a new encapsulated key with the provided alias.createAsync(String alias, KeyEncapsulationOptions encapsulationOptions) Creates a new encapsulated key with the provided alias andKeyEncapsulationOptions.default CompletionStage<Void> Deletes the alias from encapsulated key by id.Deletes an encapsulated key by id.findByAliasAsync(String alias) Finds an encapsulated key by its alias.setAliasByIdAsync(String id, String alias) Sets the alias of an encapsulated key by id.
-
Method Details
-
createAsync
Creates a new encapsulated key without an alias.- Returns:
- a
CompletionStagethat completes with the encapsulated key
-
createAsync
Creates a new encapsulated key with the provided alias.- Parameters:
alias- the key alias, may be null- Returns:
- a
CompletionStagethat completes with the encapsulated key
-
createAsync
CompletionStage<EncapsulatedKey> createAsync(String alias, KeyEncapsulationOptions encapsulationOptions) Creates a new encapsulated key with the provided alias andKeyEncapsulationOptions.- Parameters:
alias- the key alias, may be nullencapsulationOptions- the key encapsulation options, may be null- Returns:
- a
CompletionStagethat completes with the encapsulated key
-
findByAliasAsync
Finds an encapsulated key by its alias.- Parameters:
alias- the key alias, must not be null- Returns:
- a
CompletionStagethat completes with the encapsulated key or null when no key with the given alias exists
-
setAliasByIdAsync
Sets the alias of an encapsulated key by id. The alias must not be used by another key. To assign an alias currently used by another key, it must first be deleted from that key.- Parameters:
id- the key id, must not be nullalias- the new key alias, may be null to remove the alias- Returns:
- a
CompletionStagethat completes with null
-
deleteAliasByIdAsync
Deletes the alias from encapsulated key by id.- Parameters:
id- the key id, must not be null- Returns:
- a
CompletionStagethat completes with null
-
deleteByIdAsync
Deletes an encapsulated key by id.- Parameters:
id- the key id, must not be null- Returns:
- a
CompletionStagethat completes with null
-