Description Usage Arguments Details Value See Also Examples
Encrypt plain text into ciphertext, or the reverse
1 2 3 4 5 |
text |
For |
key |
A character string specifying a key ID, Amazon Resource Name (ARN), alias name, or alias ARN. When using an alias name, prefix it with “alias/”. |
encode |
A logical specifying whether to base 64 encode |
... |
Additional arguments passed to |
encrypt
encrypts source text using a KMS key. decrypt
reverses this process using the same key. reencrypt
reencrypts an (encrypted) ciphertext using a new key. The purpose of these functions, according to AWS, to is encrypt and decrypt data keys (of the source created with generate_data_key
) rather than general purpose encryption given the relatively low upper limit on the size of text
.
encrypt
returns a base64-encoded binary object as a character string.
create_kms_key
, generate_data_key
, generate_blob
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
# create a key
k <- create_kms_key()
# encrypt
tmp <- tempfile()
cat("example test", file = tmp)
(etext <- encrypt(tmp, k))
# decrypt
(dtext <- decrypt(etext, k, encode = FALSE))
if (require("base64enc")) {
rawToChar(base64enc::base64decode(dtext))
}
# cleanup
delete_kms_key(k)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.