get Plaintext
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.kms.Key;
import com.pulumi.alicloud.kms.KeyArgs;
import com.pulumi.alicloud.kms.Ciphertext;
import com.pulumi.alicloud.kms.CiphertextArgs;
import com.pulumi.alicloud.kms.KmsFunctions;
import com.pulumi.alicloud.kms.inputs.GetPlaintextArgs;
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) {
var key = new Key("key", KeyArgs.builder()
.description("example key")
.isEnabled(true)
.build());
var encrypted = new Ciphertext("encrypted", CiphertextArgs.builder()
.keyId(key.id())
.plaintext("example")
.build());
final var plaintext = KmsFunctions.getPlaintext(GetPlaintextArgs.builder()
.ciphertextBlob(encrypted.ciphertextBlob())
.build());
ctx.export("decrypted", plaintext.applyValue(getPlaintextResult -> getPlaintextResult).applyValue(plaintext -> plaintext.applyValue(getPlaintextResult -> getPlaintextResult.plaintext())));
}
}
Content copied to clipboard
Return
A collection of values returned by getPlaintext.
Parameters
argument
A collection of arguments for invoking getPlaintext.
suspend fun getPlaintext(ciphertextBlob: String, encryptionContext: Map<String, String>? = null): GetPlaintextResult
Return
A collection of values returned by getPlaintext.
See also
Parameters
ciphertext Blob
The ciphertext to be decrypted.
encryption Context
(Optional) The Encryption context. If you specify this parameter in the Encrypt or GenerateDataKey API operation, it is also required when you call the Decrypt API operation. For more information, see Encryption Context.
suspend fun getPlaintext(argument: suspend GetPlaintextPlainArgsBuilder.() -> Unit): GetPlaintextResult
Return
A collection of values returned by getPlaintext.
See also
Parameters
argument
Builder for com.pulumi.alicloud.kms.kotlin.inputs.GetPlaintextPlainArgs.