0

How to register AES for BC to the Quarkus native image?

I am getting the following error

 java.security.NoSuchAlgorithmException: no such algorithm: AES for provider BC
    at sun.security.jca.GetInstance.getService(GetInstance.java:87)
    at javax.crypto.JceSecurity.getInstance(JceSecurity.java:127)

The same thing works perfectly fine in standard execution.

I am using QUARKUS 2.12.1 and GraalVM 22.2.0

With -H:+TraceSecurityServices, the Following error

com.oracle.svm.core.jdk.UnsupportedFeatureError: Trying to verify a provider that was not registered at build time: BC version 1.6605. All providers must be registered and verified in the Native Image builder. 
    at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:89)
    at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:387)
    at javax.crypto.Cipher.getInstance(Cipher.java:718)
    at javax.crypto.Cipher.getInstance(Cipher.java:642)
```

user3577622
  • 145
  • 1
  • 1
  • 9
  • Try running your program with native-image-agent enabled, then pass the resulting config files to native-image. That doesn't always help, but should cover basic reflection/SPI usage – peterz Sep 14 '22 at 09:17
  • I am running using QUARKUS plugin and I am not able to find using native-image-agent. if I run native-image directly, it throws com.oracle.svm.core.util.VMError$HostedError: Error in @InjectAccessors handling of field org.wildfly.common.net.Inet.INET4_ANY – user3577622 Sep 21 '22 at 11:24

0 Answers0