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:
parent
a4c44aa34a
commit
bb18479434
@ -66,7 +66,8 @@ final class OpenJdkSelfSignedCertGenerator {
|
|||||||
info.set(X509CertInfo.VALIDITY, new CertificateValidity(notBefore, notAfter));
|
info.set(X509CertInfo.VALIDITY, new CertificateValidity(notBefore, notAfter));
|
||||||
info.set(X509CertInfo.KEY, new CertificateX509Key(keypair.getPublic()));
|
info.set(X509CertInfo.KEY, new CertificateX509Key(keypair.getPublic()));
|
||||||
info.set(X509CertInfo.ALGORITHM_ID,
|
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.
|
// Sign the cert to identify the algorithm that's used.
|
||||||
X509CertImpl cert = new X509CertImpl(info);
|
X509CertImpl cert = new X509CertImpl(info);
|
||||||
|
3
pom.xml
3
pom.xml
@ -97,7 +97,7 @@
|
|||||||
<testJvm />
|
<testJvm />
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
<!-- JDK14 -->
|
<!-- JDK15 -->
|
||||||
<profile>
|
<profile>
|
||||||
<id>java15</id>
|
<id>java15</id>
|
||||||
<activation>
|
<activation>
|
||||||
@ -118,6 +118,7 @@
|
|||||||
<skipOsgiTestsuite>true</skipOsgiTestsuite>
|
<skipOsgiTestsuite>true</skipOsgiTestsuite>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
|
<!-- JDK14 -->
|
||||||
<profile>
|
<profile>
|
||||||
<id>java14</id>
|
<id>java14</id>
|
||||||
<activation>
|
<activation>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user