Add full Java 8 support: publish target, Java 8-safe crypto, CI matrix#3
Open
oleksandrlazarenko-pi wants to merge 5 commits into
Open
Add full Java 8 support: publish target, Java 8-safe crypto, CI matrix#3oleksandrlazarenko-pi wants to merge 5 commits into
oleksandrlazarenko-pi wants to merge 5 commits into
Conversation
BUILD: Target Java 8 for the published library.
FIX: Use SHA256withECDSA with manual DER<->raw conversion
18 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings full Java 8 support to owid-java: the published library targets Java 8, signing/verifying works on a Java 8 runtime, and CI now proves it across a JDK matrix.
This branch was cut from a fork
mainthat already carried the earlier Java 8 work, so against this repo'smainit bundles three related changes. It therefore supersedes #1 (Java 8 baseline) and #2 (Java 8 crypto fix) — it contains both, plus a new CI matrix — and those can be closed in favour of this one.Motivation
owid-java is consumed by SDKs on a Java 8 floor (e.g. 51Degrees
pipeline-java). The library must both compile to Java 8 bytecode and actually sign/verify at runtime on a Java 8 JVM. Previously neither the crypto nor the CI guaranteed that.Changes
1. Target Java 8 for the published library
maven.compiler.releaseset to8, so the shippedowidjar is Java 8 bytecode (major 52).Io.java: replacedByteArrayOutputStream.writeBytes(byte[])(Java 11) withwrite(b, 0, len)(Java 8) — the only Java 9+ API in the main sources.2. Java 8-safe signing / verifying (
Crypto.java)SHA256withECDSAinP1363Format(added to the JDK only in Java 15) with the standardSHA256withECDSA, converting between ASN.1 DER and the raw 64-byte (IEEE P1363) form in code.rfollowed by the 32-bytes.NoSuchAlgorithmException: SHA256withECDSAinP1363Format Signature not availablethe moment they signed or verified.3. Java 8 CI matrix (+ Java 8-compatible tests)
ci.yml: the test job now runs on Java 8, 11, 17, 21 (× ubuntu/windows), so the Java 8 runtime contract is verified rather than assumed.pom.xmlcompiles tests at release 8;List.of(...)→Collections.singletonList(...); therecord Fixtures→ a plainfinal class(same accessor names, so call sites are unchanged).Compatibility
FixturesTest,WireVectorsTest) confirm byte-for-byte interop with owid-js / owid-php / owid-python / owid-dotnet and pass unchanged.Testing
mvn clean test— 35/35 pass; test and main class files confirmed major 52 (Java 8).pipeline.did(Java) builds and passes 32/32 against this library, with its animal-snifferjava18API check green.