react-native-secure-key-store icon indicating copy to clipboard operation
react-native-secure-key-store copied to clipboard

not working on api level 22

Open bang9 opened this issue 6 years ago • 3 comments

image

log

02-22 17:34:07.991 5287-5363/com.medium.wallet.blockey W/System.err: java.lang.IllegalStateException: Can't generate certificate
        at android.security.AndroidKeyPairGenerator.generateKeyPair(AndroidKeyPairGenerator.java:136)
        at java.security.KeyPairGenerator$KeyPairGeneratorImpl.generateKeyPair(KeyPairGenerator.java:276)
        at com.reactlibrary.securekeystore.RNSecureKeyStoreModule.getOrCreatePublicKey(RNSecureKeyStoreModule.java:87)
        at com.reactlibrary.securekeystore.RNSecureKeyStoreModule.getOrCreateSecretKey(RNSecureKeyStoreModule.java:129)
        at com.reactlibrary.securekeystore.RNSecureKeyStoreModule.setCipherText(RNSecureKeyStoreModule.java:140)
        at com.reactlibrary.securekeystore.RNSecureKeyStoreModule.set(RNSecureKeyStoreModule.java:58)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:135)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:818)
    Caused by: java.lang.UnsupportedOperationException: private exponent cannot be extracted
        at com.android.org.conscrypt.OpenSSLRSAPrivateKey.getPrivateExponent(OpenSSLRSAPrivateKey.java:161)
        at org.bouncycastle.jcajce.provider.asymmetric.rsa.RSAUtil.generatePrivateKeyParameter(Unknown Source)
        at org.bouncycastle.jcajce.provider.asymmetric.rsa.DigestSignatureSpi.engineInitSign(Unknown Source)

bang9 avatar Feb 22 '19 08:02 bang9

@Bang9 are you getting the same error on the actual device also?

pradeep1991singh avatar Feb 23 '19 03:02 pradeep1991singh

@Bang9 are you getting the same error on the actual device also?

@pradeep1991singh I don't have real device that has api level 22 , so I can't test

bang9 avatar Feb 23 '19 06:02 bang9

Im having the same issue on api level 22 as well - testing on an actual device

stacygohyunsi avatar Mar 01 '19 10:03 stacygohyunsi