Add pem-api module: PEMDecoder/PEMEncoder (JEP 538 preview on JDK 27, JEP 542 final in JDK 28) for JWT keys, TLS, encrypted keys and BouncyCastle migration

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CifR2BE7PBvRy5hT8TS9oz
This commit is contained in:
2026-10-26 01:50:05 +00:00
co-authored by Claude Sonnet 5.5
parent c3cc57f482
commit 2e25042a68
34 changed files with 895 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
$ java --enable-preview -cp ... TlsFromPem (27.0.1.0.2+1)
== read a two-certificate chain file
CN=localhost
CN=pem-api demo CA
ok: the stream decoder returns the two certificates one by one
== server side: key + chain -> KeyStore -> KeyManagerFactory -> SSLContext
== client trusting only the CA certificate from ca.pem
HTTP 200 hello over TLS (TLSv1.3)
server presented: CN=localhost
ok: request over TLS succeeds
== same request with the JVM's default trust store (the CA is not in it)
javax.net.ssl.SSLHandshakeException: (certificate_unknown) PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
exit=0