get Ciphertext
Example Usage
Basic 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.KmsFunctions;
import com.pulumi.alicloud.kms.inputs.GetCiphertextArgs;
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());
final var encrypted = KmsFunctions.getCiphertext(GetCiphertextArgs.builder()
.keyId(key.id())
.plaintext("example")
.build());
}
}
Content copied to clipboard
Return
A collection of values returned by getCiphertext.
Parameters
argument
A collection of arguments for invoking getCiphertext.
suspend fun getCiphertext(encryptionContext: Map<String, String>? = null, keyId: String, plaintext: String): GetCiphertextResult
Return
A collection of values returned by getCiphertext.
See also
Parameters
encryption Context
The Encryption context. If you specify this parameter here, it is also required when you call the Decrypt API operation. For more information, see Encryption Context.
key Id
The globally unique ID of the CMK.
plaintext
The plaintext to be encrypted which must be encoded in Base64.
suspend fun getCiphertext(argument: suspend GetCiphertextPlainArgsBuilder.() -> Unit): GetCiphertextResult
Return
A collection of values returned by getCiphertext.
See also
Parameters
argument
Builder for com.pulumi.alicloud.kms.kotlin.inputs.GetCiphertextPlainArgs.