1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Kms
  5. getEncryptedData
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

oci.Kms.getEncryptedData

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

The oci.Kms.EncryptedData data source provides details about a specific EncryptedData

Encrypts data using the given EncryptDataDetails resource. Plaintext included in the example request is a base64-encoded value of a UTF-8 string.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testEncryptedData = oci.Kms.getEncryptedData({
    cryptoEndpoint: encryptedDataCryptoEndpoint,
    keyId: testKey.id,
    plaintext: encryptedDataPlaintext,
    associatedData: encryptedDataAssociatedData,
});
Copy
import pulumi
import pulumi_oci as oci

test_encrypted_data = oci.Kms.get_encrypted_data(crypto_endpoint=encrypted_data_crypto_endpoint,
    key_id=test_key["id"],
    plaintext=encrypted_data_plaintext,
    associated_data=encrypted_data_associated_data)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/kms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := kms.GetEncryptedData(ctx, &kms.GetEncryptedDataArgs{
			CryptoEndpoint: encryptedDataCryptoEndpoint,
			KeyId:          testKey.Id,
			Plaintext:      encryptedDataPlaintext,
			AssociatedData: encryptedDataAssociatedData,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testEncryptedData = Oci.Kms.GetEncryptedData.Invoke(new()
    {
        CryptoEndpoint = encryptedDataCryptoEndpoint,
        KeyId = testKey.Id,
        Plaintext = encryptedDataPlaintext,
        AssociatedData = encryptedDataAssociatedData,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Kms.KmsFunctions;
import com.pulumi.oci.Kms.inputs.GetEncryptedDataArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var testEncryptedData = KmsFunctions.getEncryptedData(GetEncryptedDataArgs.builder()
            .cryptoEndpoint(encryptedDataCryptoEndpoint)
            .keyId(testKey.id())
            .plaintext(encryptedDataPlaintext)
            .associatedData(encryptedDataAssociatedData)
            .build());

    }
}
Copy
variables:
  testEncryptedData:
    fn::invoke:
      function: oci:Kms:getEncryptedData
      arguments:
        cryptoEndpoint: ${encryptedDataCryptoEndpoint}
        keyId: ${testKey.id}
        plaintext: ${encryptedDataPlaintext}
        associatedData: ${encryptedDataAssociatedData}
Copy

Using getEncryptedData

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getEncryptedData(args: GetEncryptedDataArgs, opts?: InvokeOptions): Promise<GetEncryptedDataResult>
function getEncryptedDataOutput(args: GetEncryptedDataOutputArgs, opts?: InvokeOptions): Output<GetEncryptedDataResult>
Copy
def get_encrypted_data(associated_data: Optional[Mapping[str, str]] = None,
                       crypto_endpoint: Optional[str] = None,
                       key_id: Optional[str] = None,
                       plaintext: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetEncryptedDataResult
def get_encrypted_data_output(associated_data: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                       crypto_endpoint: Optional[pulumi.Input[str]] = None,
                       key_id: Optional[pulumi.Input[str]] = None,
                       plaintext: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetEncryptedDataResult]
Copy
func GetEncryptedData(ctx *Context, args *GetEncryptedDataArgs, opts ...InvokeOption) (*GetEncryptedDataResult, error)
func GetEncryptedDataOutput(ctx *Context, args *GetEncryptedDataOutputArgs, opts ...InvokeOption) GetEncryptedDataResultOutput
Copy

> Note: This function is named GetEncryptedData in the Go SDK.

public static class GetEncryptedData 
{
    public static Task<GetEncryptedDataResult> InvokeAsync(GetEncryptedDataArgs args, InvokeOptions? opts = null)
    public static Output<GetEncryptedDataResult> Invoke(GetEncryptedDataInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetEncryptedDataResult> getEncryptedData(GetEncryptedDataArgs args, InvokeOptions options)
public static Output<GetEncryptedDataResult> getEncryptedData(GetEncryptedDataArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:Kms/getEncryptedData:getEncryptedData
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

CryptoEndpoint This property is required. string
The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.
KeyId This property is required. string
The OCID of the key to encrypt with.
Plaintext This property is required. string
The plaintext data to encrypt.
AssociatedData Dictionary<string, string>
Information that can be used to provide an encryption context for the encrypted data. The length of the string representation of the associatedData must be fewer than 4096 characters.
CryptoEndpoint This property is required. string
The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.
KeyId This property is required. string
The OCID of the key to encrypt with.
Plaintext This property is required. string
The plaintext data to encrypt.
AssociatedData map[string]string
Information that can be used to provide an encryption context for the encrypted data. The length of the string representation of the associatedData must be fewer than 4096 characters.
cryptoEndpoint This property is required. String
The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.
keyId This property is required. String
The OCID of the key to encrypt with.
plaintext This property is required. String
The plaintext data to encrypt.
associatedData Map<String,String>
Information that can be used to provide an encryption context for the encrypted data. The length of the string representation of the associatedData must be fewer than 4096 characters.
cryptoEndpoint This property is required. string
The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.
keyId This property is required. string
The OCID of the key to encrypt with.
plaintext This property is required. string
The plaintext data to encrypt.
associatedData {[key: string]: string}
Information that can be used to provide an encryption context for the encrypted data. The length of the string representation of the associatedData must be fewer than 4096 characters.
crypto_endpoint This property is required. str
The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.
key_id This property is required. str
The OCID of the key to encrypt with.
plaintext This property is required. str
The plaintext data to encrypt.
associated_data Mapping[str, str]
Information that can be used to provide an encryption context for the encrypted data. The length of the string representation of the associatedData must be fewer than 4096 characters.
cryptoEndpoint This property is required. String
The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.
keyId This property is required. String
The OCID of the key to encrypt with.
plaintext This property is required. String
The plaintext data to encrypt.
associatedData Map<String>
Information that can be used to provide an encryption context for the encrypted data. The length of the string representation of the associatedData must be fewer than 4096 characters.

getEncryptedData Result

The following output properties are available:

Ciphertext string
The encrypted data.
CryptoEndpoint string
Id string
The provider-assigned unique ID for this managed resource.
KeyId string
Plaintext string
AssociatedData Dictionary<string, string>
Ciphertext string
The encrypted data.
CryptoEndpoint string
Id string
The provider-assigned unique ID for this managed resource.
KeyId string
Plaintext string
AssociatedData map[string]string
ciphertext String
The encrypted data.
cryptoEndpoint String
id String
The provider-assigned unique ID for this managed resource.
keyId String
plaintext String
associatedData Map<String,String>
ciphertext string
The encrypted data.
cryptoEndpoint string
id string
The provider-assigned unique ID for this managed resource.
keyId string
plaintext string
associatedData {[key: string]: string}
ciphertext str
The encrypted data.
crypto_endpoint str
id str
The provider-assigned unique ID for this managed resource.
key_id str
plaintext str
associated_data Mapping[str, str]
ciphertext String
The encrypted data.
cryptoEndpoint String
id String
The provider-assigned unique ID for this managed resource.
keyId String
plaintext String
associatedData Map<String>

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi