Skip to content

Commit

Permalink
Merge pull request quarkusio#30131 from sberyozkin/smallrye_jwt_exclu…
Browse files Browse the repository at this point in the history
…de_eddsa_from_native

Add Jose4j OctetKeyPairJsonWebKey substitutions
  • Loading branch information
gsmet authored Jan 3, 2023
2 parents f6d00db + 5f4fc13 commit 4fa6890
Showing 1 changed file with 29 additions and 0 deletions.
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;
}
}

0 comments on commit 4fa6890

Please sign in to comment.