Class KmsCryptoClient
Service client instance for KmsCrypto.
Implements
Inherited Members
Namespace: Oci.KeymanagementService
Assembly: OCI.DotNetSDK.Keymanagement.dll
Syntax
public class KmsCryptoClient : ClientBase, IDisposable
Constructors
KmsCryptoClient(IBasicAuthenticationDetailsProvider, ClientConfiguration, string)
Creates a new service instance using the given authentication provider and/or client configuration and/or endpoint. A client configuration can also be provided optionally to adjust REST client behaviors.
Declaration
public KmsCryptoClient(IBasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration clientConfiguration = null, string endpoint = null)
Parameters
Type | Name | Description |
---|---|---|
IBasicAuthenticationDetailsProvider | authenticationDetailsProvider | The authentication details provider. Required. |
ClientConfiguration | clientConfiguration | The client configuration that contains settings to adjust REST client behaviors. Optional. |
string | endpoint | The endpoint of the service. If not provided and the client is a regional client, the endpoint will be constructed based on region information. Optional. |
Methods
Decrypt(DecryptRequest, RetryConfiguration, CancellationToken, HttpCompletionOption)
Decrypts data using the given DecryptDataDetails resource.
Declaration
public Task<DecryptResponse> Decrypt(DecryptRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
Parameters
Type | Name | Description |
---|---|---|
DecryptRequest | request | The request object containing the details to send. Required. |
RetryConfiguration | retryConfiguration | The retry configuration that will be used by to send this request. Optional. |
CancellationToken | cancellationToken | The cancellation token to cancel this operation. Optional. |
HttpCompletionOption | completionOption | The completion option for this operation. Optional. |
Returns
Type | Description |
---|---|
Task<DecryptResponse> | A response object containing details about the completed operation |
Examples
Click here to see an example of how to use Decrypt API.
Encrypt(EncryptRequest, RetryConfiguration, CancellationToken, HttpCompletionOption)
Encrypts data using the given EncryptDataDetails resource. Plaintext included in the example request is a base64-encoded value of a UTF-8 string.
Declaration
public Task<EncryptResponse> Encrypt(EncryptRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
Parameters
Type | Name | Description |
---|---|---|
EncryptRequest | request | The request object containing the details to send. Required. |
RetryConfiguration | retryConfiguration | The retry configuration that will be used by to send this request. Optional. |
CancellationToken | cancellationToken | The cancellation token to cancel this operation. Optional. |
HttpCompletionOption | completionOption | The completion option for this operation. Optional. |
Returns
Type | Description |
---|---|
Task<EncryptResponse> | A response object containing details about the completed operation |
Examples
Click here to see an example of how to use Encrypt API.
ExportKey(ExportKeyRequest, RetryConfiguration, CancellationToken, HttpCompletionOption)
Exports a specific version of a master encryption key according to the details of the request. For their protection,
keys that you create and store on a hardware security module (HSM) can never leave the HSM. You can only export keys
stored on the server. For export, the key version is encrypted by an RSA public key that you provide.
This operation is not supported for keys having protection mode EXTERNAL
.
Declaration
public Task<ExportKeyResponse> ExportKey(ExportKeyRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
Parameters
Type | Name | Description |
---|---|---|
ExportKeyRequest | request | The request object containing the details to send. Required. |
RetryConfiguration | retryConfiguration | The retry configuration that will be used by to send this request. Optional. |
CancellationToken | cancellationToken | The cancellation token to cancel this operation. Optional. |
HttpCompletionOption | completionOption | The completion option for this operation. Optional. |
Returns
Type | Description |
---|---|
Task<ExportKeyResponse> | A response object containing details about the completed operation |
Examples
Click here to see an example of how to use ExportKey API.
GenerateDataEncryptionKey(GenerateDataEncryptionKeyRequest, RetryConfiguration, CancellationToken, HttpCompletionOption)
Generates a key that you can use to encrypt or decrypt data.
Declaration
public Task<GenerateDataEncryptionKeyResponse> GenerateDataEncryptionKey(GenerateDataEncryptionKeyRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
Parameters
Type | Name | Description |
---|---|---|
GenerateDataEncryptionKeyRequest | request | The request object containing the details to send. Required. |
RetryConfiguration | retryConfiguration | The retry configuration that will be used by to send this request. Optional. |
CancellationToken | cancellationToken | The cancellation token to cancel this operation. Optional. |
HttpCompletionOption | completionOption | The completion option for this operation. Optional. |
Returns
Type | Description |
---|---|
Task<GenerateDataEncryptionKeyResponse> | A response object containing details about the completed operation |
Examples
Click here to see an example of how to use GenerateDataEncryptionKey API.
Sign(SignRequest, RetryConfiguration, CancellationToken, HttpCompletionOption)
Creates a digital signature for a message or message digest by using the private key of a public-private key pair,
also known as an asymmetric key. To verify the generated signature, you can use the Verify
operation. Or, if you want to validate the signature outside of the service, you can do so by using the public key of the same asymmetric key.
This operation is not supported for keys having protection mode EXTERNAL
.
Declaration
public Task<SignResponse> Sign(SignRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
Parameters
Type | Name | Description |
---|---|---|
SignRequest | request | The request object containing the details to send. Required. |
RetryConfiguration | retryConfiguration | The retry configuration that will be used by to send this request. Optional. |
CancellationToken | cancellationToken | The cancellation token to cancel this operation. Optional. |
HttpCompletionOption | completionOption | The completion option for this operation. Optional. |
Returns
Type | Description |
---|---|
Task<SignResponse> | A response object containing details about the completed operation |
Examples
Click here to see an example of how to use Sign API.
Verify(VerifyRequest, RetryConfiguration, CancellationToken, HttpCompletionOption)
Verifies a digital signature that was generated by the Sign operation
by using the public key of the same asymmetric key that was used to sign the data. If you want to validate the
digital signature outside of the service, you can do so by using the public key of the asymmetric key.
This operation is not supported for keys having protection mode EXTERNAL
.
Declaration
public Task<VerifyResponse> Verify(VerifyRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead)
Parameters
Type | Name | Description |
---|---|---|
VerifyRequest | request | The request object containing the details to send. Required. |
RetryConfiguration | retryConfiguration | The retry configuration that will be used by to send this request. Optional. |
CancellationToken | cancellationToken | The cancellation token to cancel this operation. Optional. |
HttpCompletionOption | completionOption | The completion option for this operation. Optional. |
Returns
Type | Description |
---|---|
Task<VerifyResponse> | A response object containing details about the completed operation |
Examples
Click here to see an example of how to use Verify API.