github.com/muratcelep/terraform@v1.1.0-beta2-not-internal-4/website/docs/language/functions/rsadecrypt.html.md (about) 1 --- 2 layout: "language" 3 page_title: "rsadecrypt - Functions - Configuration Language" 4 sidebar_current: "docs-funcs-crypto-rsadecrypt" 5 description: |- 6 The rsadecrypt function decrypts an RSA-encrypted message. 7 --- 8 9 # `rsadecrypt` Function 10 11 `rsadecrypt` decrypts an RSA-encrypted ciphertext, returning the corresponding 12 cleartext. 13 14 ```hcl 15 rsadecrypt(ciphertext, privatekey) 16 ``` 17 18 `ciphertext` must be a base64-encoded representation of the ciphertext, using 19 the PKCS #1 v1.5 padding scheme. Terraform uses the "standard" Base64 alphabet 20 as defined in [RFC 4648 section 4](https://tools.ietf.org/html/rfc4648#section-4). 21 22 `privatekey` must be a PEM-encoded RSA private key that is not itself 23 encrypted. 24 25 Terraform has no corresponding function for _encrypting_ a message. Use this 26 function to decrypt ciphertexts returned by remote services using a keypair 27 negotiated out-of-band. 28 29 ## Examples 30 31 ``` 32 > rsadecrypt(filebase64("${path.module}/ciphertext"), file("privatekey.pem")) 33 Hello, world! 34 ```