flutter-rsa icon indicating copy to clipboard operation
flutter-rsa copied to clipboard

infinity waiting when rsa sign

Open cwangfr opened this issue 3 years ago • 7 comments

Hi, I have a strange problem here. When I use the RSA SignPSS feature, there is an infinite wait. I use Android Studio, use usb cable connect with my Samsung Tab7. If I start program on device, keep usb cable connect, the function always ok, but, when I start program, and then disconnect the usb cable, the signPSS could not return result. here is my code :

final _pkcs12KeyPair = await RSA.convertPKCS12ToKeyPair(
    (await rootBundle.loadString('assets/key.base64')), "miipos");
var signature = await RSA.signPSS(
    value, Hash.SHA512, SaltLength.AUTO, _pkcs12KeyPair.privateKey); // always waiting there, never return the result signature

var result = signature.replaceAll("+", "-").replaceAll("/", "_");
debugPrint(result);
debugPrint("****** end sign ******");

thanks

cwangfr avatar Feb 14 '22 12:02 cwangfr

Have you found a solution?

zaqzaq163 avatar Mar 27 '23 10:03 zaqzaq163

Hi @zaqzaq163 , @cwangfr thanks for report this issue, please could you provide a full example to help me to reproduce it here

jerson avatar Mar 27 '23 14:03 jerson

Hi @jerson, I use IOS device, when I transfer code from swift to objective-c and submit to testflight, signPKCS1v15 can't return result and wait infinitely

zaqzaq163 avatar Apr 16 '23 13:04 zaqzaq163

@zaqzaq163 which version are you using?

jerson avatar Apr 16 '23 13:04 jerson

I have tested version 3.5.3 and 3.5.6, it doesn't work

zaqzaq163 avatar Apr 16 '23 13:04 zaqzaq163

Hi @zaqzaq163 I'm still trying to reproduce it, but I couldn't, could you provide me a full example with a sample private key or a pkcs12 and the arguments you are using

jerson avatar Apr 24 '23 02:04 jerson

@zaqzaq163 I just released a new version, please take a look when you get a chance https://pub.dev/packages/fast_rsa/versions/3.5.7 if doesn't work either please send me a full example to try to reproduce it here, thank you.

jerson avatar Apr 24 '23 03:04 jerson