Page 1 of 1

initialize the key

Posted: Wed Oct 12, 2016 5:12 am
by mukundis
I created a RSAPrivateCrtKey in order to get the p prime via the getP() method.
My code:

Code: Select all

static RSAPrivateCrtKey prime =  = (RSAPrivateCrtKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_CRT_PRIVATE, KeyBuilder.LENGTH_RSA_512, false);
...
//  initialize the RSAPrivateCrtKey
...
prime.getP(tab, (short)0);


But how to initialize the key? I don't know how to write this part of code.

Re: initialize the key

Posted: Wed Oct 12, 2016 10:28 pm
by wumindejia
You can refer to viewtopic.php?f=31&t=737

Re: initialize the key

Posted: Thu Oct 13, 2016 4:38 am
by Pf6KINE
use genKeyPair method of KeyPair class

Re: initialize the key

Posted: Thu Oct 13, 2016 5:29 am
by mukundis

Thanks for your help.

Re: initialize the key

Posted: Thu Oct 13, 2016 5:30 am
by mukundis
Pf6KINE wrote:use genKeyPair method of KeyPair class


That's a good idea. Thanks a bunch.