Open mvayngrib opened 5 years ago
Why does it break other crypto? Does it replace some provider that you need?
@tananaev yep, see the code here https://github.com/tradle/react-native-ecc/blob/master/android/src/main/java/com/rn/ecc/ECCModule.java
sign
doesn't work, the SC provider seems to get in the way. I printed the providers:
with passport-reader:
SC
AndroidKeyStoreBCWorkaround
AndroidOpenSSL
BC
Crypto
HarmonyJSSE
AndroidKeyStore
without passport reader:
AndroidKeyStoreBCWorkaround
AndroidOpenSSL
BC
Crypto
HarmonyJSSE
AndroidKeyStore
Not sure how to solve the issue. Maybe there is a way to specify provider explicitly?
i've googled a fair bit. One way is to insertProviderAt before the relevant code in this module, and then remove it after. However, as it's executing in the background, it will probably affect anything that happens to be using crypto at the same time.
some libraries allow you to setProvider explicitly, e.g. here, but i'm not really familiar with the libraries being used here. Maybe you can check if u know where to look?
Unfortunately I don't have much time to dedicate to this project.
Q: is there a way to only use the Spongy/BouncyCastleProvider for the particular operations needed for chip reading/auth? Mutating the global list of providers breaks other crypto I'm doing. Thanks!
edit: i tried
addProvider()
instead, but then it doesn't scan the chip