Subject: [jose] ES6 Serialization Applied to JS/JSON Encryption

From: Anders Rundgren <[email-masked]>
Date: Sat, 28 Nov 2015 16:24:34 +0100

Although encryption by definition is "cryptic", ES6 serialization rules can be used to at least make headers readable.

{
   "encryptedKey":
     {
       "alg": "RSA-OAEP-256",
       "jwk":
          {
             "kty": "RSA",
             "n": "v4c1pLMaEmFfdkZpENozKE8bl9Eb...w_SHgxYYIrO7QXNsUuSK1-rTw1d6vjbw",
             "e": "AQAB"
          },
       "cipherText": "JV0LQMLs7vE60ramSBaynuIbrHjk...YEyxkaFBsvq_NOq--2DEPkGtukJesVQ"
     },
   "alg": "A128CBC-HS256",
   "iv": "5JIFqZMBuvFm2mOhfEsCxQ",
   "tag": "vxMxd7hjuklgonO8s1jBVg",
   "cipherText": "oPZGHcG19s9ucVE8ghekaXM5NbL94...lHlIZhFPKA1tCKCyeUWqMvx0Yc"
}

- Anders