Learn R Programming

jose (version 1.2.1)

read_jwk: JSON web-keys

Description

Read and write RSA, ECDSA or AES keys as JSON web keys.

Usage

read_jwk(file)

write_jwk(x, path = NULL)

Arguments

file

path to file with key data or literal json string

x

an RSA or EC key or pubkey file

path

file path to write output

Examples

Run this code
# generate an ecdsa key
library(openssl)
key <- ec_keygen("P-521")
write_jwk(key)
write_jwk(as.list(key)$pubkey)

# Same for RSA
key <- rsa_keygen()
write_jwk(key)
write_jwk(as.list(key)$pubkey)

Run the code above in your browser using DataLab