Fix compilation error on JDK 15 (#10462)

Motivation:

AlgorithmId.sha256WithRSAEncryption_oid was removed in JDK15 and later so we should not depend on it as otherwise we will see compilation errors

Modifications:

Replace AlgorithmId.sha256WithRSAEncryption_oid usage with specify the OID directly

Result:

Compiles on JDK15+
This commit is contained in:
Norman Maurer 2020-08-10 14:03:23 +02:00
parent 6240a4b03f
commit a2ebd65322
2 changed files with 4 additions and 2 deletions

View File

@ -64,7 +64,8 @@ final class OpenJdkSelfSignedCertGenerator {
info.set(X509CertInfo.VALIDITY, new CertificateValidity(notBefore, notAfter));
info.set(X509CertInfo.KEY, new CertificateX509Key(keypair.getPublic()));
info.set(X509CertInfo.ALGORITHM_ID,
new CertificateAlgorithmId(new AlgorithmId(AlgorithmId.sha256WithRSAEncryption_oid)));
// sha256WithRSAEncryption
new CertificateAlgorithmId(AlgorithmId.get("1.2.840.113549.1.1.11")));
// Sign the cert to identify the algorithm that's used.
X509CertImpl cert = new X509CertImpl(info);

View File

@ -97,7 +97,7 @@
<testJvm/>
</properties>
</profile>
<!-- JDK14 -->
<!-- JDK15 -->
<profile>
<id>java15</id>
<activation>
@ -118,6 +118,7 @@
<skipOsgiTestsuite>true</skipOsgiTestsuite>
</properties>
</profile>
<!-- JDK14 -->
<profile>
<id>java14</id>
<activation>