github.com/hugorut/terraform@v1.1.3/website/docs/language/functions/rsadecrypt.mdx (about)

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