Compilation error in CryptographicStorageServiceImpl
Hi all, I checked-out the latest version of the branch 'develop' (97c49841), ran 'mvn clean compile' and got the following error:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/stephane/Documents/assembloo/engineering/repositories/stopcovid/robert-server/robert-crypto-grpc-server-storage/src/main/java/fr/gouv/stopc/robert/crypto/grpc/server/storage/cryptographic/service/impl/CryptographicStorageServiceImpl.java:[78,43] incompatible types: java.lang.String cannot be converted to sun.security.pkcs11.Config
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for robert-server 1.0.0-SNAPSHOT:
[INFO]
[INFO] robert-server ...................................... SUCCESS [ 0.803 s]
[INFO] robert-crypto-grpc-server-messaging ................ SUCCESS [ 3.913 s]
[INFO] robert-server-common ............................... SUCCESS [ 0.567 s]
[INFO] robert-server-database ............................. SUCCESS [ 0.787 s]
[INFO] robert-server-crypto ............................... SUCCESS [ 0.559 s]
[INFO] robert-server-ws-rest .............................. SUCCESS [ 1.295 s]
[INFO] robert-server-batch ................................ SUCCESS [ 0.423 s]
[INFO] robert-crypto-grpc-server-storage .................. FAILURE [ 0.638 s]
[INFO] robert-crypto-grpc-server .......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.398 s
[INFO] Finished at: 2020-06-01T07:54:17+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project robert-crypto-grpc-server-storage: Compilation failure
[ERROR] /home/stephane/Documents/assembloo/engineering/repositories/stopcovid/robert-server/robert-crypto-grpc-server-storage/src/main/java/fr/gouv/stopc/robert/crypto/grpc/server/storage/cryptographic/service/impl/CryptographicStorageServiceImpl.java:[78,43] incompatible types: java.lang.String cannot be converted to sun.security.pkcs11.Config
[ERROR]
For information I am using JDK11. I believe that this issue is related to using SunPKCS11 directly. It seems that it preferable to use Security.getProvider("SunPKCS11") as specified in the doc: https://docs.oracle.com/javase/9/security/pkcs11-reference-guide1.htm#JSSEC-GUID-97F1E537-CB59-4C7F-AB6B-05D4DBD69AC0
This issue can be fixed by replacing line 78 with this one:
this.provider = Security.getProvider("SunPKCS11").configure(configFile); and removing the import SunPKCS11