Nothing
knitr::opts_chunk$set(echo = TRUE) knitr::opts_chunk$set(comment = "")
JSON Web Keys (JWK) is a format specified in RFC7517 for storing RSA/EC/AES keys in a JSON based format. It can be used to import/export such keys in the browser using the new W3C WebCryptoAPI.
The jose
package makes it easy to read/write such keys in R for use with JWT or any other functionality from the openssl
package.
library(openssl) library(jose) # Generate a ECDSA key key <- openssl::ec_keygen() jsonlite::prettify(write_jwk(key)) # Use public key pubkey <- as.list(key)$pubkey json <- write_jwk(pubkey) jsonlite::prettify(json) # Read JWK key (out <- read_jwk(json)) identical(pubkey, out)
JWT also specifies a format for encoding AES/HMAC secrets. Such secret keys are simply raw bytes.
# Random secret (key <- rand_bytes(16)) (jwk <- write_jwk(key)) read_jwk(jwk)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.