「マイクロソフト系技術情報 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。
以下の内容で最終確認済み。
https://tools.ietf.org/html/rfc7516
JWE Compact Serialization or JWE JSON Serializationのどちらでも、基本的にすべてbase64urlでエンコードされる。
JWEの基本的なヘッダ(≒JWE Compact Serializationの場合の保護ヘッダ)には、以下のものがある。
{"alg":"RSA-OAEP","enc":"A256GCM"}{"alg":"RSA1_5","enc":"A128CBC-HS256"}{"alg":"A128KW","enc":"A128CBC-HS256"}認証付き暗号(AEAD)暗号化アルゴリズムについての知識が必要。
"enc"の認証付き暗号(AEAD)操作によって決定される。
暗号化アルゴリズムの以下の要素について理解が必要
となるもよう(鍵交換だが、アリスとボブではなく単なる公開鍵暗号化)。
鍵合意アルゴリズムの利用を意図したキー管理モード。
対称キーラッピングアルゴリズムの対称鍵に、
合意アルゴリズムの利用を意図したキー管理モード。
CEK値が当事者間で共有される鍵管理モード。
BASE64URL (UTF-8 (JWE Protected Header)) . BASE64URL(JWE Encrypted Key) . BASE64URL(JWE Initialization Vector) . BASE64URL(JWE Ciphertext) . BASE64URL(JWE Authentication Tag)
{
"protected":"<integrity-protected shared header contents>",
"unprotected":<non-integrity-protected shared header contents>,
"recipients":[
{"header":<per-recipient unprotected header 1 contents>,
"encrypted_key":"<encrypted key 1 contents>"},
...
{"header":<per-recipient unprotected header N contents>,
"encrypted_key":"<encrypted key N contents>"}],
"aad":"<additional authenticated data contents>",
"iv":"<initialization vector contents>",
"ciphertext":"<ciphertext contents>",
"tag":"<authentication tag contents>"
}
{
"protected":"<integrity-protected header contents>",
"unprotected":<non-integrity-protected header contents>,
"header":<more non-integrity-protected header contents>,
"encrypted_key":"<encrypted key contents>",
"aad":"<additional authenticated data contents>",
"iv":"<initialization vector contents>",
"ciphertext":"<ciphertext contents>",
"tag":"<authentication tag contents>"
}JOSEヘッダは、以下のメンバの和集合。
JWE JSON Serializationの場合に必要な、受信者毎に共通の非保護ヘッダ
JWE JSON Serializationの場合に必要な、受信者毎に個別の非保護ヘッダ
{"alg":"RSA-OAEP","enc":"A256GCM"} など。
※ JWE JSON Serializationを使用している場合は、上記を繰り返す。
ココの署名・暗号化アルゴリズムを使用すると良い。
-
-