oci logo
Oracle Cloud Infrastructure v0.12.0, Mar 17 23

oci.Kms.getEncryptedData

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

using System.Collections.Generic;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testEncryptedData = Oci.Kms.GetEncryptedData.Invoke(new()
    {
        CryptoEndpoint = @var.Encrypted_data_crypto_endpoint,
        KeyId = oci_kms_key.Test_key.Id,
        Plaintext = @var.Encrypted_data_plaintext,
        AssociatedData = @var.Encrypted_data_associated_data,
    });

});
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/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: _var.Encrypted_data_crypto_endpoint,
			KeyId:          oci_kms_key.Test_key.Id,
			Plaintext:      _var.Encrypted_data_plaintext,
			AssociatedData: _var.Encrypted_data_associated_data,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
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(var_.encrypted_data_crypto_endpoint())
            .keyId(oci_kms_key.test_key().id())
            .plaintext(var_.encrypted_data_plaintext())
            .associatedData(var_.encrypted_data_associated_data())
            .build());

    }
}
import pulumi
import pulumi_oci as oci

test_encrypted_data = oci.Kms.get_encrypted_data(crypto_endpoint=var["encrypted_data_crypto_endpoint"],
    key_id=oci_kms_key["test_key"]["id"],
    plaintext=var["encrypted_data_plaintext"],
    associated_data=var["encrypted_data_associated_data"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testEncryptedData = oci.Kms.getEncryptedData({
    cryptoEndpoint: _var.encrypted_data_crypto_endpoint,
    keyId: oci_kms_key.test_key.id,
    plaintext: _var.encrypted_data_plaintext,
    associatedData: _var.encrypted_data_associated_data,
});
variables:
  testEncryptedData:
    fn::invoke:
      Function: oci:Kms:getEncryptedData
      Arguments:
        cryptoEndpoint: ${var.encrypted_data_crypto_endpoint}
        keyId: ${oci_kms_key.test_key.id}
        plaintext: ${var.encrypted_data_plaintext}
        associatedData: ${var.encrypted_data_associated_data}

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>
def get_encrypted_data(associated_data: Optional[Mapping[str, Any]] = 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, Any]]] = 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]
func GetEncryptedData(ctx *Context, args *GetEncryptedDataArgs, opts ...InvokeOption) (*GetEncryptedDataResult, error)
func GetEncryptedDataOutput(ctx *Context, args *GetEncryptedDataOutputArgs, opts ...InvokeOption) GetEncryptedDataResultOutput

> 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)
}
public static CompletableFuture<GetEncryptedDataResult> getEncryptedData(GetEncryptedDataArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: oci:Kms/getEncryptedData:getEncryptedData
  arguments:
    # arguments dictionary

The following arguments are supported:

CryptoEndpoint string

The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.

KeyId string

The OCID of the key to encrypt with.

Plaintext string

The plaintext data to encrypt.

AssociatedData Dictionary<string, object>

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 string

The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.

KeyId string

The OCID of the key to encrypt with.

Plaintext string

The plaintext data to encrypt.

AssociatedData map[string]interface{}

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 String

The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.

keyId String

The OCID of the key to encrypt with.

plaintext String

The plaintext data to encrypt.

associatedData Map<String,Object>

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 string

The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.

keyId string

The OCID of the key to encrypt with.

plaintext string

The plaintext data to encrypt.

associatedData {[key: string]: any}

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 str

The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.

key_id str

The OCID of the key to encrypt with.

plaintext str

The plaintext data to encrypt.

associated_data Mapping[str, Any]

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 String

The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.

keyId String

The OCID of the key to encrypt with.

plaintext String

The plaintext data to encrypt.

associatedData Map<Any>

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, object>
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]interface{}
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,Object>
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]: any}
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, Any]
ciphertext String

The encrypted data.

cryptoEndpoint String
id String

The provider-assigned unique ID for this managed resource.

keyId String
plaintext String
associatedData Map<Any>

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.