Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CifR2BE7PBvRy5hT8TS9oz
14 lines
812 B
Plaintext
14 lines
812 B
Plaintext
$ java --enable-preview -cp ... JwtSigning (27.0.1.0.2+1)
|
|
== RS256 with an RSA key from PEM
|
|
header.payload = eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhbmt1ciIsImlzcyI6Imh0dHBzOi8vYW5rdXJtLmNvbSJ9
|
|
signature bytes = 256, jwt parts = 3
|
|
ok: RS256 signature verifies with the public PEM
|
|
== ES256 with an EC key from PEM (the trap is the signature format)
|
|
SHA256withECDSA -> DER, starts 0x30, length varies run to run, 70-72: true (JWT readers reject this)
|
|
SHA256withECDSAinP1363Format -> R||S, length 64 (what RFC 7518 requires for ES256)
|
|
ok: ES256 signature is exactly 64 bytes
|
|
ok: ES256 signature verifies with the public PEM
|
|
== EdDSA with an Ed25519 key from PEM
|
|
EdDSA signature bytes = 64 (the PKCS#8 file holds no public key, so there is nothing to decode for verifying here)
|
|
exit=0
|