forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#30131 from sberyozkin/smallrye_jwt_exclu…
…de_eddsa_from_native Add Jose4j OctetKeyPairJsonWebKey substitutions
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...ld/runtime/src/main/java/io/quarkus/smallrye/jwt/build/runtime/graalvm/Substitutions.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.quarkus.smallrye.jwt.build.runtime.graalvm; | ||
|
||
import java.util.function.BooleanSupplier; | ||
|
||
import com.oracle.svm.core.annotate.Substitute; | ||
import com.oracle.svm.core.annotate.TargetClass; | ||
|
||
@TargetClass(className = "org.jose4j.jwk.OctetKeyPairJsonWebKey", onlyWith = JavaVersionLessThan17.class) | ||
final class Target_org_jose4j_jwk_OctetKeyPairJsonWebKey { | ||
@Substitute | ||
public Target_org_jose4j_jwk_OctetKeyPairJsonWebKey(java.security.PublicKey publicKey) { | ||
} | ||
|
||
@Substitute | ||
Target_org_jose4j_jwk_OctetKeyPairUtil subtypeKeyUtil() { | ||
return null; | ||
} | ||
} | ||
|
||
@TargetClass(className = "org.jose4j.keys.OctetKeyPairUtil", onlyWith = JavaVersionLessThan17.class) | ||
final class Target_org_jose4j_jwk_OctetKeyPairUtil { | ||
} | ||
|
||
class JavaVersionLessThan17 implements BooleanSupplier { | ||
@Override | ||
public boolean getAsBoolean() { | ||
return Runtime.version().version().get(0) < 17; | ||
} | ||
} |