CosmosEncryptionDatabase Class

  • java.lang.Object
    • com.azure.cosmos.encryption.CosmosEncryptionDatabase

public final class CosmosEncryptionDatabase

CosmosEncryptionDatabase with encryption capabilities.

Method Summary

Modifier and Type Method and Description
CosmosClientEncryptionKeyResponse createClientEncryptionKey(String clientEncryptionKeyId, String encryptionAlgorithm, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata)

Creates a client encryption key after subscription the operation will be performed.

CosmosClientEncryptionKey getClientEncryptionKey(String id)

Gets a CosmosClientEncryptionKey object without making a service call

CosmosDatabase getCosmosDatabase()

Gets a CosmosDatabase.

CosmosEncryptionContainer getCosmosEncryptionContainer(CosmosContainer container)

Gets a Container with Encryption capabilities

CosmosEncryptionContainer getCosmosEncryptionContainer(String containerId)

Gets a Container with Encryption capabilities

CosmosPagedIterable<CosmosClientEncryptionKeyProperties> readAllClientEncryptionKeys()

Reads all cosmos client encryption keys in a database.

CosmosClientEncryptionKeyResponse rewrapClientEncryptionKey(String clientEncryptionKeyId, EncryptionKeyWrapMetadata newEncryptionKeyWrapMetadata)

Rewrap a cosmos client encryption key

Methods inherited from java.lang.Object

Method Details

createClientEncryptionKey

public CosmosClientEncryptionKeyResponse createClientEncryptionKey(String clientEncryptionKeyId, String encryptionAlgorithm, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata)

Creates a client encryption key after subscription the operation will be performed.

Parameters:

clientEncryptionKeyId - Client Encryption Key id.
encryptionAlgorithm - Encryption Algorithm.
encryptionKeyWrapMetadata - EncryptionKeyWrapMetadata.

Returns:

the resource response with the created cosmos client encryption key or an error.

getClientEncryptionKey

public CosmosClientEncryptionKey getClientEncryptionKey(String id)

Gets a CosmosClientEncryptionKey object without making a service call

Parameters:

id - id of the clientEncryptionKey

Returns:

Cosmos ClientEncryptionKey

getCosmosDatabase

public CosmosDatabase getCosmosDatabase()

Gets a CosmosDatabase.

Returns:

cosmos database

getCosmosEncryptionContainer

public CosmosEncryptionContainer getCosmosEncryptionContainer(CosmosContainer container)

Gets a Container with Encryption capabilities

Parameters:

container - original container

Returns:

container with encryption capabilities

getCosmosEncryptionContainer

public CosmosEncryptionContainer getCosmosEncryptionContainer(String containerId)

Gets a Container with Encryption capabilities

Parameters:

containerId - original container id

Returns:

container with encryption capabilities

readAllClientEncryptionKeys

public CosmosPagedIterable readAllClientEncryptionKeys()

Reads all cosmos client encryption keys in a database.

After subscription the operation will be performed. The CosmosPagedIterable<T> will contain one or several feed response of the read cosmos client encryption keys. In case of failure the CosmosPagedIterable<T> will error.

Returns:

rewrapClientEncryptionKey

public CosmosClientEncryptionKeyResponse rewrapClientEncryptionKey(String clientEncryptionKeyId, EncryptionKeyWrapMetadata newEncryptionKeyWrapMetadata)

Rewrap a cosmos client encryption key

Parameters:

clientEncryptionKeyId - the client encryption key properties to create.
newEncryptionKeyWrapMetadata - EncryptionKeyWrapMetadata.

Returns:

the resource response with the read client encryption key or an error.

Applies to