Oracle Cloud Infrastructure v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi
oci.Kms.getEncryptedData
Explore with Pulumi AI
Oracle Cloud Infrastructure v1.41.0 published on Wednesday, Jun 19, 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/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, 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:
- Crypto
Endpoint string - The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.
- Key
Id string - The OCID of the key to encrypt with.
- Plaintext string
- The plaintext data to encrypt.
- Associated
Data 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.
- Crypto
Endpoint string - The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.
- Key
Id string - The OCID of the key to encrypt with.
- Plaintext string
- The plaintext data to encrypt.
- Associated
Data 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.
- crypto
Endpoint String - The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.
- key
Id String - The OCID of the key to encrypt with.
- plaintext String
- The plaintext data to encrypt.
- associated
Data 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.
- crypto
Endpoint string - The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.
- key
Id string - The OCID of the key to encrypt with.
- plaintext string
- The plaintext data to encrypt.
- associated
Data {[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.
- crypto
Endpoint String - The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint.
- key
Id String - The OCID of the key to encrypt with.
- plaintext String
- The plaintext data to encrypt.
- associated
Data 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.
- Crypto
Endpoint string - Id string
- The provider-assigned unique ID for this managed resource.
- Key
Id string - Plaintext string
- Associated
Data Dictionary<string, object>
- Ciphertext string
- The encrypted data.
- Crypto
Endpoint string - Id string
- The provider-assigned unique ID for this managed resource.
- Key
Id string - Plaintext string
- Associated
Data map[string]interface{}
- ciphertext String
- The encrypted data.
- crypto
Endpoint String - id String
- The provider-assigned unique ID for this managed resource.
- key
Id String - plaintext String
- associated
Data Map<String,Object>
- ciphertext string
- The encrypted data.
- crypto
Endpoint string - id string
- The provider-assigned unique ID for this managed resource.
- key
Id string - plaintext string
- associated
Data {[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.
- crypto
Endpoint String - id String
- The provider-assigned unique ID for this managed resource.
- key
Id String - plaintext String
- associated
Data Map<Any>
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 v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi