Page 1 of 1
generate RSA public and private key
Posted: Wed Jun 22, 2016 11:19 pm
by Tazmania09
When I generated RSA public and private key by KeyPair(KeyPair.ALG_RSA, KeyBuilder.LENGTH_RSA_1024) , I got 6F 00.
But when I used KeyPair(KeyPair.ALG_RSA_CRT, KeyBuilder.LENGTH_RSA_1024) , it can be successfull. I have no idea about why this happened. Hope anyone help me find the reason. Thanks a lot
Re: generate RSA public and private key
Posted: Thu Jun 23, 2016 6:10 am
by corleoner
The reason that you got 6F 00 is because there is un-handled exception in your code. Use try/catch statements to catch exception and find out exception reason.
Moreover, it turns out that ALG_RSA_CRT is the same as ALG_RSA, so if there is something wrong with ALG_RSA, just use ALG_RSA_CRT.
Re: generate RSA public and private key
Posted: Thu Jun 23, 2016 3:20 pm
by rena2019
corleoner wrote:Moreover, it turns out that ALG_RSA_CRT is the same as ALG_RSA, so if there is something wrong with ALG_RSA, just use ALG_RSA_CRT.
what? ALG_RSA_CRT is the same as ALG_RSA?
Re: generate RSA public and private key
Posted: Thu Jun 23, 2016 9:46 pm
by corleoner
rena2019 wrote:corleoner wrote:Moreover, it turns out that ALG_RSA_CRT is the same as ALG_RSA, so if there is something wrong with ALG_RSA, just use ALG_RSA_CRT.
what? ALG_RSA_CRT is the same as ALG_RSA?
Well.. Isn't that so? If I said something wrong or misunderstood something, please correct me. thanks