1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Kms
  5. getEncryptedData
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.Kms.getEncryptedData

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 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,
    });
    
    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)
    
    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
    	})
    }
    
    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,
        });
    
    });
    
    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());
    
        }
    }
    
    variables:
      testEncryptedData:
        fn::invoke:
          Function: oci:Kms:getEncryptedData
          Arguments:
            cryptoEndpoint: ${encryptedDataCryptoEndpoint}
            keyId: ${testKey.id}
            plaintext: ${encryptedDataPlaintext}
            associatedData: ${encryptedDataAssociatedData}
    

    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, 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]
    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, 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 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]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 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,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 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]: 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 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, 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 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>
    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.
    oci logo
    Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi