jose-jwt
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
「[[マイクロソフト系技術情報 Wiki>http://techinfoofmicros...
-[[戻る>JWT]]
* 目次 [#u45db361]
#contents
*概要 [#rb87a68b]
名前の通り、[[JWT]]ライブラリである「jose-jwt」が良さそう...
**特徴 [#o4d29f44]
Readme.md中で、以下の様に述べられている。
-.NETと[[.NET Core]]用の最小 or ゼロ依存のアルティメット[...
-jose.4.j、Nimbus-JOSE-JWT、json-jwtライブラリとの互換性...
**[[比較>JWT#r4ac23c8]] [#efad17e4]
ライトユーザー向けではなく、ヘビーユーザー向け。
-クロスプラットフォーム実装
-ClientではなくAuthZサイド実装用
的な。
*詳細 [#jebc97ce]
**機能 [#v9a01dd1]
***[[JWS]] [#l00fa0a9]
署名・検証
***[[JWE]] [#pd6a0dcb]
暗号化・復号化
***ユーティリティ [#n2439696]
・・・
**依存関係 [#da102a96]
以下を使用している。
#ref(browser.png,left,nowrap,参照設定)
***[[CAPI(CSP)、CNG>.NETの署名・暗号化アルゴリズム#fde2f1...
-実装がある。
--https://github.com/dotnet/corefx/tree/master/src/System...
--https://github.com/dotnet/corefx/tree/master/src/System...
-しかし、実際に動かすと...([[コチラ>#j86fe726]])。
--プロバイダ~
Windows上でも、Linux上でもNotImplementedExceptionになる。
--CngKey~
Windows上では動作するが、Linux上では、PlatformNotSupporte...
Unhandled Exception: System.PlatformNotSupportedExceptio...
at System.Security.Cryptography.CngKeyBlobFormat.get_...
at Security.Cryptography.EccKey.New(Byte[] x, Byte[] ...
---[[X509Certificate2.GetECDsaPrivateKey()>OpenSSL#w0f78b...
why CngKey.Import is not supported on ubuntu? · Issue #18...
https://github.com/dotnet/corefx/issues/18733
***[[OpenSSL>OpenSSL#dbb192d0]] [#l3af4ef0]
-上記の、AlgorithmとX509Certificateでは、更に下位にOpenSS...
--Algorithm~
https://github.com/dotnet/corefx/tree/master/src/System.S...
--X509Certificate~
https://github.com/dotnet/corefx/tree/master/src/System.S...
-ネイティブ実装~
ライセンスには各種Linuxディストリビューション毎のネイティ...
当該ライブラリのクロスプラットフォーム対応も完了している...
#ref(license.png,left,nowrap,license)
**Linux上 [#j6420fdb]
***WSL上での.NET Core開発 [#t837eaeb]
-[[「/mnt/c」※ 1 を経由して実行>Windows Subsystem for Lin...
※ 1 : DrvFs?のVFSファイルシステムプラグイン。
-[[dotnetコマンド]]を使用して、ビルドと実行を行う。
***bcrypt.dllが見つからない。 [#mfc25367]
Unhandled Exception: System.DllNotFoundException: Unable...
(Exception from HRESULT: 0x8007007E)
at Jose.native.BCrypt.BCryptOpenAlgorithmProvider(Int...
at Jose.AesGcm.OpenAlgorithmProvider(String alg, Stri...
at Jose.AesGcm.Encrypt(Byte[] key, Byte[] iv, Byte[] ...
at Jose.AesGcmKeyWrapManagement.WrapNewKey(Int32 cekS...
at Jose.JWT.EncodeBytes(Byte[] payload, Object key, J...
*サンプル・コード [#q8a19d35]
**実装 [#q3a5562c]
https://github.com/OpenTouryoProject/SampleProgram/blob/m...
**実行 [#pe988d02]
-コマンド~
SampleProgramリポジトリを「C:\Git」にクローンした場合。
cd /mnt/c/Git1/SampleProgram/Other/Encryption/jose_jwt_S...
dotnet publish -c Release -r ubuntu.16.04-x64 --self-con...
cd jose_jwt_Sample/bin/Release/netcoreapp2.0/ubuntu.16.0...
dotnet jose_jwt_Sample.dll
**結果 [#n5e68266]
***出力(on Window) [#b265ce98]
RSA privateX509Key: is not null
RSA privateSignatureAlgorithm: sha256RSA
RSA privateX509Key.PrivateKey: is System.Security.Crypto...
RSA publicX509Key: is not null
RSA publicSignatureAlgorithm: sha256RSA
RSA publicX509Key: is System.Security.Cryptography.X509C...
RSA publicX509Key.Key: is System.Security.Cryptography.R...
DSA privateX509Key: is not null
DSA privateSignatureAlgorithm: System.Security.Cryptogra...
DSA privateX509Key.PrivateKey: is System.Security.Crypto...
DSA publicX509Key: is not null
DSA publicSignatureAlgorithm: System.Security.Cryptograp...
DSA publicX509Key: is System.Security.Cryptography.X509C...
DSA publicX509Key.Key: Internal.Cryptography.CryptoThrow...
privateDSA: is not null
ECDsa privateX509Key: is not null
ECDsa privateSignatureAlgorithm: sha256ECDSA
ECDsa privateX509Key.PrivateKey: System.NotSupportedExce...
ECDsa publicX509Key: is not null
ECDsa publicSignatureAlgorithm: sha256ECDSA
ECDsa publicX509Key: is System.Security.Cryptography.X50...
ECDsa publicX509Key.Key: System.NotSupportedException, T...
privateECDsa: is not null
publicECDsa: is not null
--------------------------------------------------------...
JwsAlgorithm.none: eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.e...
JwsAlgorithm.HS256: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
JWT Header: {"alg":"HS256","typ":"JWT"}
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JwsAlgorithm.RS256: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
JWT Header: {"alg":"RS256","typ":"JWT"}
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JwsAlgorithm.ES256: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9...
JWT Header: {"alg":"ES256","typ":"JWT"}
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.RSA1_5, JweEncryption.A128CBC_HS256: eyJhbG...
JWT Header: {"alg":"RSA1_5","enc":"A128CBC-HS256"}
- JWE Encrypted Key: KfU6IprzIIQBWcSiN3G5sU8BN1UA_m17Kgs...
- JWE Initialization Vector: QjJKl0Yq-yiU_Kvi31Aw5Q
- JWE Ciphertext: 1v7oiXXTRuMQ6B2wuVZHsMmkkfRZ8kRY5HluSi...
- JWE Authentication Tag: 8c-M08sMyFZC3k5rSYcamA
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.RSA_OAEP, JweEncryption.A256GCM: eyJhbGciOi...
JWT Header: {"alg":"RSA-OAEP","enc":"A256GCM"}
- JWE Encrypted Key: WTHZMC0ZApHIs0aJX10q2hPpe6uYT-0IYep...
- JWE Initialization Vector: N6bHpmIf_61AqfOz
- JWE Ciphertext: ZMF9pX3srN-Rl-NQDbaNZSG4p5GiPbSFB3Q-fd...
- JWE Authentication Tag: 1Tr-Nne9x0x2Kt8XCYRWBg
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.DIR, JweEncryption.A128CBC_HS256: eyJhbGciO...
JWT Header: {"alg":"dir","enc":"A128CBC-HS256"}
- JWE Encrypted Key:
- JWE Initialization Vector: -0WCyaIBCnH4XNPFf7CQQg
- JWE Ciphertext: LvSzXkSHInUbHrYovoiQAeCfr39Vhu98vjzpJm...
- JWE Authentication Tag: qp1aPGQgVXaOPD-uFFvSTw
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.A256KW, JweEncryption.A256CBC_HS512: eyJhbG...
JWT Header: {"alg":"A256KW","enc":"A256CBC-HS512"}
- JWE Encrypted Key: X3l4kS2DDU08YOr8p-lFbxMmWyJ4oV9NjgE...
- JWE Initialization Vector: jdGmcQ8Gvs2qJDQ_Uit3RA
- JWE Ciphertext: AfB3jBklSYpA1isPjtWpwXWJ6twQl2ILoHrysQ...
- JWE Authentication Tag: L3oBVsQISga8OX_gK6skvkXkN7BVSh...
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.A256GCMKW, JweEncryption.A256CBC_HS512: eyJ...
JWT Header: {"alg":"A256GCMKW","enc":"A256CBC-HS512","iv...
- JWE Encrypted Key: sacNOJZNjvaa4Op7lf0_LGigYfiIDAefuGn...
- JWE Initialization Vector: AxA471H1JlLIOHB3rbNplg
- JWE Ciphertext: -5RI7ackZh6eTAbzGMqIiik2tdhFFQYoQjPyBW...
- JWE Authentication Tag: fUXy3_RVeJ5JYUC3E3sq6vmA8FuJix...
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.ECDH_ES, JweEncryption.A256GCM: System.NotI...
JweAlgorithm.PBES2_HS256_A128KW, JweEncryption.A256CBC_H...
JWT Header: {"alg":"PBES2-HS256+A128KW","enc":"A256CBC-H...
- JWE Encrypted Key: txlaYhmMVIPSF8tJU1CNG5_94Th4U5oFWos...
- JWE Initialization Vector: FS62noEqP9Y0_V108WtizA
- JWE Ciphertext: fY2VHelOGc341BQ0SJfhYFvZ_VjAmeAi8M4dMI...
- JWE Authentication Tag: WYGrsQV7dwttuu1_zQBjd5jVlocdkV...
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
--------------------------------------------------------...
Adding extra headers to RS256: eyJhbGciOiJSUzI1NiIsInR5c...
JWT Header: {"alg":"RS256","typ":"JWT","cty":"JWT","keyi...
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
Strict validation(RS256): {"sub":"mr.x@contoso.com","exp...
***出力(on Linux) [#e516d6ff]
RSA privateX509Key: is not null
RSA privateSignatureAlgorithm: sha256RSA
RSA privateX509Key.PrivateKey: is System.Security.Crypto...
RSA publicX509Key: is not null
RSA publicSignatureAlgorithm: sha256RSA
RSA publicX509Key: is System.Security.Cryptography.X509C...
RSA publicX509Key.Key: is System.Security.Cryptography.R...
DSA privateX509Key: is not null
DSA privateSignatureAlgorithm: dsa_with_SHA256
DSA privateX509Key.PrivateKey: is System.Security.Crypto...
DSA publicX509Key: is not null
DSA publicSignatureAlgorithm: dsa_with_SHA256
DSA publicX509Key: is System.Security.Cryptography.X509C...
DSA publicX509Key.Key: is System.Security.Cryptography.D...
privateDSA: is not null
ECDsa privateX509Key: is not null
ECDsa privateSignatureAlgorithm: sha256ECDSA
ECDsa privateX509Key.PrivateKey: System.NotSupportedExce...
ECDsa publicX509Key: is not null
ECDsa publicSignatureAlgorithm: sha256ECDSA
ECDsa publicX509Key: is System.Security.Cryptography.X50...
ECDsa publicX509Key.Key: System.NotSupportedException, T...
privateECDsa: is not null
publicECDsa: is not null
--------------------------------------------------------...
JwsAlgorithm.none: eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.e...
JwsAlgorithm.HS256: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
JWT Header: {"alg":"HS256","typ":"JWT"}
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JwsAlgorithm.RS256: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
JWT Header: {"alg":"RS256","typ":"JWT"}
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JwsAlgorithm.ES256: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9...
JWT Header: {"alg":"ES256","typ":"JWT"}
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.RSA1_5, JweEncryption.A128CBC_HS256: eyJhbG...
JWT Header: {"alg":"RSA1_5","enc":"A128CBC-HS256"}
- JWE Encrypted Key: HxWK2wod23F8c7I0cR3CEIO-Le7Ijp5YnqH...
- JWE Initialization Vector: FvmunYTd-ywH_-9MIqdfkg
- JWE Ciphertext: Q6GRykB-v0dHQHgNFSyjueh9vPdn8NBNwtBWVQ...
- JWE Authentication Tag: ZN0UElA0ROGMqMyXTAF04w
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.RSA_OAEP, JweEncryption.A256GCM: System.Dll...
(Exception from HRESULT: 0x8007007E)
JweAlgorithm.DIR, JweEncryption.A128CBC_HS256: eyJhbGciO...
JWT Header: {"alg":"dir","enc":"A128CBC-HS256"}
- JWE Encrypted Key:
- JWE Initialization Vector: Hm6fqQ008JcA9g-19IqckQ
- JWE Ciphertext: Wtsi7F6KbJ9jqp26IAcDno_B5Z5xdmRSCmUMp5...
- JWE Authentication Tag: jpQ2rQmoEg1kHnkmBjLXMw
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.A256KW, JweEncryption.A256CBC_HS512: eyJhbG...
JWT Header: {"alg":"A256KW","enc":"A256CBC-HS512"}
- JWE Encrypted Key: smsrsSobtS4q7QHpcK_FtNdTkJxu18LOzRl...
- JWE Initialization Vector: plU_Z5Fm9mA2cE8ZAPNrAQ
- JWE Ciphertext: 1A94B7pu8PWSl25CksT3PoSfZS35bSt4_z5vli...
- JWE Authentication Tag: R9HTEmq2ZTkth57WFUWsUoQsZY3kCt...
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.A256GCMKW, JweEncryption.A256CBC_HS512: Sys...
(Exception from HRESULT: 0x8007007E)
JweAlgorithm.ECDH_ES, JweEncryption.A256GCM: System.Plat...
JweAlgorithm.PBES2_HS256_A128KW, JweEncryption.A256CBC_H...
JWT Header: {"alg":"PBES2-HS256+A128KW","enc":"A256CBC-H...
- JWE Encrypted Key: XKltmS-Uv8SRcpCxEiZZES8-NgwtcAHxoTc...
- JWE Initialization Vector: BSQA-sf_7SwiYIR7fZmP4A
- JWE Ciphertext: F-4Qe97AeAWZFqsmL-_LJp17ITY_KvMEcpbL_q...
- JWE Authentication Tag: 8gmpTzsnIJw4nY4NwEpYvMOO5IHYm2...
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
--------------------------------------------------------...
Adding extra headers to RS256: eyJhbGciOiJSUzI1NiIsInR5c...
JWT Header: {"alg":"RS256","typ":"JWT","cty":"JWT","keyi...
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
Strict validation(RS256): {"sub":"mr.x@contoso.com","exp...
***Inspect ECCurve [#zcb17741]
by the [[ObjectInspector.Inspect>https://github.com/OpenT...
[
Oid = Error. can't process, IsPrime = True, IsCharacte...
A = [255, 255, 255, 255, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,...
B = [90, 198, 53, 216, 170, 58, 147, 231, 179, 235, 18...
G = [
X = [107, 23, 209, 242, 225, 44, 66, 71, 248, 188, 2...
Y = [79, 227, 66, 226, 254, 26, 127, 155, 142, 231, ...
Order = [255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255...
Cofactor = [1],
Seed = [196, 157, 54, 8, 134, 231, 4, 147, 106, 102, 1...
CurveType = PrimeShortWeierstrass, Hash = null, Polyno...
Prime = [255, 255, 255, 255, 0, 0, 0, 1, 0, 0, 0, 0, 0...
]
*参考 [#s38a4b31]
**jose-jwt [#ff4c5656]
-NuGet Gallery | jose-jwt~
https://www.nuget.org/packages/jose-jwt/
-dvsekhvalnov/jose-jwt~
https://github.com/dvsekhvalnov/jose-jwt~
**検証 [#f84ed697]
-サイト~
https://jwt.io/
-公開鍵~
https://github.com/OpenTouryoProject/OpenTouryo/blob/deve...
----
Tags: [[:IT国際標準]], [[:認証基盤]], [[:クレームベース認...
終了行:
「[[マイクロソフト系技術情報 Wiki>http://techinfoofmicros...
-[[戻る>JWT]]
* 目次 [#u45db361]
#contents
*概要 [#rb87a68b]
名前の通り、[[JWT]]ライブラリである「jose-jwt」が良さそう...
**特徴 [#o4d29f44]
Readme.md中で、以下の様に述べられている。
-.NETと[[.NET Core]]用の最小 or ゼロ依存のアルティメット[...
-jose.4.j、Nimbus-JOSE-JWT、json-jwtライブラリとの互換性...
**[[比較>JWT#r4ac23c8]] [#efad17e4]
ライトユーザー向けではなく、ヘビーユーザー向け。
-クロスプラットフォーム実装
-ClientではなくAuthZサイド実装用
的な。
*詳細 [#jebc97ce]
**機能 [#v9a01dd1]
***[[JWS]] [#l00fa0a9]
署名・検証
***[[JWE]] [#pd6a0dcb]
暗号化・復号化
***ユーティリティ [#n2439696]
・・・
**依存関係 [#da102a96]
以下を使用している。
#ref(browser.png,left,nowrap,参照設定)
***[[CAPI(CSP)、CNG>.NETの署名・暗号化アルゴリズム#fde2f1...
-実装がある。
--https://github.com/dotnet/corefx/tree/master/src/System...
--https://github.com/dotnet/corefx/tree/master/src/System...
-しかし、実際に動かすと...([[コチラ>#j86fe726]])。
--プロバイダ~
Windows上でも、Linux上でもNotImplementedExceptionになる。
--CngKey~
Windows上では動作するが、Linux上では、PlatformNotSupporte...
Unhandled Exception: System.PlatformNotSupportedExceptio...
at System.Security.Cryptography.CngKeyBlobFormat.get_...
at Security.Cryptography.EccKey.New(Byte[] x, Byte[] ...
---[[X509Certificate2.GetECDsaPrivateKey()>OpenSSL#w0f78b...
why CngKey.Import is not supported on ubuntu? · Issue #18...
https://github.com/dotnet/corefx/issues/18733
***[[OpenSSL>OpenSSL#dbb192d0]] [#l3af4ef0]
-上記の、AlgorithmとX509Certificateでは、更に下位にOpenSS...
--Algorithm~
https://github.com/dotnet/corefx/tree/master/src/System.S...
--X509Certificate~
https://github.com/dotnet/corefx/tree/master/src/System.S...
-ネイティブ実装~
ライセンスには各種Linuxディストリビューション毎のネイティ...
当該ライブラリのクロスプラットフォーム対応も完了している...
#ref(license.png,left,nowrap,license)
**Linux上 [#j6420fdb]
***WSL上での.NET Core開発 [#t837eaeb]
-[[「/mnt/c」※ 1 を経由して実行>Windows Subsystem for Lin...
※ 1 : DrvFs?のVFSファイルシステムプラグイン。
-[[dotnetコマンド]]を使用して、ビルドと実行を行う。
***bcrypt.dllが見つからない。 [#mfc25367]
Unhandled Exception: System.DllNotFoundException: Unable...
(Exception from HRESULT: 0x8007007E)
at Jose.native.BCrypt.BCryptOpenAlgorithmProvider(Int...
at Jose.AesGcm.OpenAlgorithmProvider(String alg, Stri...
at Jose.AesGcm.Encrypt(Byte[] key, Byte[] iv, Byte[] ...
at Jose.AesGcmKeyWrapManagement.WrapNewKey(Int32 cekS...
at Jose.JWT.EncodeBytes(Byte[] payload, Object key, J...
*サンプル・コード [#q8a19d35]
**実装 [#q3a5562c]
https://github.com/OpenTouryoProject/SampleProgram/blob/m...
**実行 [#pe988d02]
-コマンド~
SampleProgramリポジトリを「C:\Git」にクローンした場合。
cd /mnt/c/Git1/SampleProgram/Other/Encryption/jose_jwt_S...
dotnet publish -c Release -r ubuntu.16.04-x64 --self-con...
cd jose_jwt_Sample/bin/Release/netcoreapp2.0/ubuntu.16.0...
dotnet jose_jwt_Sample.dll
**結果 [#n5e68266]
***出力(on Window) [#b265ce98]
RSA privateX509Key: is not null
RSA privateSignatureAlgorithm: sha256RSA
RSA privateX509Key.PrivateKey: is System.Security.Crypto...
RSA publicX509Key: is not null
RSA publicSignatureAlgorithm: sha256RSA
RSA publicX509Key: is System.Security.Cryptography.X509C...
RSA publicX509Key.Key: is System.Security.Cryptography.R...
DSA privateX509Key: is not null
DSA privateSignatureAlgorithm: System.Security.Cryptogra...
DSA privateX509Key.PrivateKey: is System.Security.Crypto...
DSA publicX509Key: is not null
DSA publicSignatureAlgorithm: System.Security.Cryptograp...
DSA publicX509Key: is System.Security.Cryptography.X509C...
DSA publicX509Key.Key: Internal.Cryptography.CryptoThrow...
privateDSA: is not null
ECDsa privateX509Key: is not null
ECDsa privateSignatureAlgorithm: sha256ECDSA
ECDsa privateX509Key.PrivateKey: System.NotSupportedExce...
ECDsa publicX509Key: is not null
ECDsa publicSignatureAlgorithm: sha256ECDSA
ECDsa publicX509Key: is System.Security.Cryptography.X50...
ECDsa publicX509Key.Key: System.NotSupportedException, T...
privateECDsa: is not null
publicECDsa: is not null
--------------------------------------------------------...
JwsAlgorithm.none: eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.e...
JwsAlgorithm.HS256: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
JWT Header: {"alg":"HS256","typ":"JWT"}
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JwsAlgorithm.RS256: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
JWT Header: {"alg":"RS256","typ":"JWT"}
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JwsAlgorithm.ES256: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9...
JWT Header: {"alg":"ES256","typ":"JWT"}
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.RSA1_5, JweEncryption.A128CBC_HS256: eyJhbG...
JWT Header: {"alg":"RSA1_5","enc":"A128CBC-HS256"}
- JWE Encrypted Key: KfU6IprzIIQBWcSiN3G5sU8BN1UA_m17Kgs...
- JWE Initialization Vector: QjJKl0Yq-yiU_Kvi31Aw5Q
- JWE Ciphertext: 1v7oiXXTRuMQ6B2wuVZHsMmkkfRZ8kRY5HluSi...
- JWE Authentication Tag: 8c-M08sMyFZC3k5rSYcamA
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.RSA_OAEP, JweEncryption.A256GCM: eyJhbGciOi...
JWT Header: {"alg":"RSA-OAEP","enc":"A256GCM"}
- JWE Encrypted Key: WTHZMC0ZApHIs0aJX10q2hPpe6uYT-0IYep...
- JWE Initialization Vector: N6bHpmIf_61AqfOz
- JWE Ciphertext: ZMF9pX3srN-Rl-NQDbaNZSG4p5GiPbSFB3Q-fd...
- JWE Authentication Tag: 1Tr-Nne9x0x2Kt8XCYRWBg
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.DIR, JweEncryption.A128CBC_HS256: eyJhbGciO...
JWT Header: {"alg":"dir","enc":"A128CBC-HS256"}
- JWE Encrypted Key:
- JWE Initialization Vector: -0WCyaIBCnH4XNPFf7CQQg
- JWE Ciphertext: LvSzXkSHInUbHrYovoiQAeCfr39Vhu98vjzpJm...
- JWE Authentication Tag: qp1aPGQgVXaOPD-uFFvSTw
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.A256KW, JweEncryption.A256CBC_HS512: eyJhbG...
JWT Header: {"alg":"A256KW","enc":"A256CBC-HS512"}
- JWE Encrypted Key: X3l4kS2DDU08YOr8p-lFbxMmWyJ4oV9NjgE...
- JWE Initialization Vector: jdGmcQ8Gvs2qJDQ_Uit3RA
- JWE Ciphertext: AfB3jBklSYpA1isPjtWpwXWJ6twQl2ILoHrysQ...
- JWE Authentication Tag: L3oBVsQISga8OX_gK6skvkXkN7BVSh...
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.A256GCMKW, JweEncryption.A256CBC_HS512: eyJ...
JWT Header: {"alg":"A256GCMKW","enc":"A256CBC-HS512","iv...
- JWE Encrypted Key: sacNOJZNjvaa4Op7lf0_LGigYfiIDAefuGn...
- JWE Initialization Vector: AxA471H1JlLIOHB3rbNplg
- JWE Ciphertext: -5RI7ackZh6eTAbzGMqIiik2tdhFFQYoQjPyBW...
- JWE Authentication Tag: fUXy3_RVeJ5JYUC3E3sq6vmA8FuJix...
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.ECDH_ES, JweEncryption.A256GCM: System.NotI...
JweAlgorithm.PBES2_HS256_A128KW, JweEncryption.A256CBC_H...
JWT Header: {"alg":"PBES2-HS256+A128KW","enc":"A256CBC-H...
- JWE Encrypted Key: txlaYhmMVIPSF8tJU1CNG5_94Th4U5oFWos...
- JWE Initialization Vector: FS62noEqP9Y0_V108WtizA
- JWE Ciphertext: fY2VHelOGc341BQ0SJfhYFvZ_VjAmeAi8M4dMI...
- JWE Authentication Tag: WYGrsQV7dwttuu1_zQBjd5jVlocdkV...
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
--------------------------------------------------------...
Adding extra headers to RS256: eyJhbGciOiJSUzI1NiIsInR5c...
JWT Header: {"alg":"RS256","typ":"JWT","cty":"JWT","keyi...
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
Strict validation(RS256): {"sub":"mr.x@contoso.com","exp...
***出力(on Linux) [#e516d6ff]
RSA privateX509Key: is not null
RSA privateSignatureAlgorithm: sha256RSA
RSA privateX509Key.PrivateKey: is System.Security.Crypto...
RSA publicX509Key: is not null
RSA publicSignatureAlgorithm: sha256RSA
RSA publicX509Key: is System.Security.Cryptography.X509C...
RSA publicX509Key.Key: is System.Security.Cryptography.R...
DSA privateX509Key: is not null
DSA privateSignatureAlgorithm: dsa_with_SHA256
DSA privateX509Key.PrivateKey: is System.Security.Crypto...
DSA publicX509Key: is not null
DSA publicSignatureAlgorithm: dsa_with_SHA256
DSA publicX509Key: is System.Security.Cryptography.X509C...
DSA publicX509Key.Key: is System.Security.Cryptography.D...
privateDSA: is not null
ECDsa privateX509Key: is not null
ECDsa privateSignatureAlgorithm: sha256ECDSA
ECDsa privateX509Key.PrivateKey: System.NotSupportedExce...
ECDsa publicX509Key: is not null
ECDsa publicSignatureAlgorithm: sha256ECDSA
ECDsa publicX509Key: is System.Security.Cryptography.X50...
ECDsa publicX509Key.Key: System.NotSupportedException, T...
privateECDsa: is not null
publicECDsa: is not null
--------------------------------------------------------...
JwsAlgorithm.none: eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.e...
JwsAlgorithm.HS256: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
JWT Header: {"alg":"HS256","typ":"JWT"}
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JwsAlgorithm.RS256: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
JWT Header: {"alg":"RS256","typ":"JWT"}
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JwsAlgorithm.ES256: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9...
JWT Header: {"alg":"ES256","typ":"JWT"}
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.RSA1_5, JweEncryption.A128CBC_HS256: eyJhbG...
JWT Header: {"alg":"RSA1_5","enc":"A128CBC-HS256"}
- JWE Encrypted Key: HxWK2wod23F8c7I0cR3CEIO-Le7Ijp5YnqH...
- JWE Initialization Vector: FvmunYTd-ywH_-9MIqdfkg
- JWE Ciphertext: Q6GRykB-v0dHQHgNFSyjueh9vPdn8NBNwtBWVQ...
- JWE Authentication Tag: ZN0UElA0ROGMqMyXTAF04w
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.RSA_OAEP, JweEncryption.A256GCM: System.Dll...
(Exception from HRESULT: 0x8007007E)
JweAlgorithm.DIR, JweEncryption.A128CBC_HS256: eyJhbGciO...
JWT Header: {"alg":"dir","enc":"A128CBC-HS256"}
- JWE Encrypted Key:
- JWE Initialization Vector: Hm6fqQ008JcA9g-19IqckQ
- JWE Ciphertext: Wtsi7F6KbJ9jqp26IAcDno_B5Z5xdmRSCmUMp5...
- JWE Authentication Tag: jpQ2rQmoEg1kHnkmBjLXMw
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.A256KW, JweEncryption.A256CBC_HS512: eyJhbG...
JWT Header: {"alg":"A256KW","enc":"A256CBC-HS512"}
- JWE Encrypted Key: smsrsSobtS4q7QHpcK_FtNdTkJxu18LOzRl...
- JWE Initialization Vector: plU_Z5Fm9mA2cE8ZAPNrAQ
- JWE Ciphertext: 1A94B7pu8PWSl25CksT3PoSfZS35bSt4_z5vli...
- JWE Authentication Tag: R9HTEmq2ZTkth57WFUWsUoQsZY3kCt...
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
JweAlgorithm.A256GCMKW, JweEncryption.A256CBC_HS512: Sys...
(Exception from HRESULT: 0x8007007E)
JweAlgorithm.ECDH_ES, JweEncryption.A256GCM: System.Plat...
JweAlgorithm.PBES2_HS256_A128KW, JweEncryption.A256CBC_H...
JWT Header: {"alg":"PBES2-HS256+A128KW","enc":"A256CBC-H...
- JWE Encrypted Key: XKltmS-Uv8SRcpCxEiZZES8-NgwtcAHxoTc...
- JWE Initialization Vector: BSQA-sf_7SwiYIR7fZmP4A
- JWE Ciphertext: F-4Qe97AeAWZFqsmL-_LJp17ITY_KvMEcpbL_q...
- JWE Authentication Tag: 8gmpTzsnIJw4nY4NwEpYvMOO5IHYm2...
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
--------------------------------------------------------...
Adding extra headers to RS256: eyJhbGciOiJSUzI1NiIsInR5c...
JWT Header: {"alg":"RS256","typ":"JWT","cty":"JWT","keyi...
Decoded: {"sub":"mr.x@contoso.com","exp":1300819380}
Strict validation(RS256): {"sub":"mr.x@contoso.com","exp...
***Inspect ECCurve [#zcb17741]
by the [[ObjectInspector.Inspect>https://github.com/OpenT...
[
Oid = Error. can't process, IsPrime = True, IsCharacte...
A = [255, 255, 255, 255, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,...
B = [90, 198, 53, 216, 170, 58, 147, 231, 179, 235, 18...
G = [
X = [107, 23, 209, 242, 225, 44, 66, 71, 248, 188, 2...
Y = [79, 227, 66, 226, 254, 26, 127, 155, 142, 231, ...
Order = [255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255...
Cofactor = [1],
Seed = [196, 157, 54, 8, 134, 231, 4, 147, 106, 102, 1...
CurveType = PrimeShortWeierstrass, Hash = null, Polyno...
Prime = [255, 255, 255, 255, 0, 0, 0, 1, 0, 0, 0, 0, 0...
]
*参考 [#s38a4b31]
**jose-jwt [#ff4c5656]
-NuGet Gallery | jose-jwt~
https://www.nuget.org/packages/jose-jwt/
-dvsekhvalnov/jose-jwt~
https://github.com/dvsekhvalnov/jose-jwt~
**検証 [#f84ed697]
-サイト~
https://jwt.io/
-公開鍵~
https://github.com/OpenTouryoProject/OpenTouryo/blob/deve...
----
Tags: [[:IT国際標準]], [[:認証基盤]], [[:クレームベース認...
ページ名: