Valid parameters when generate ECKeyPair
Posted: Wed Aug 26, 2015 5:28 am
Code like this:
when key pair generated, Which parameters play a role? publicKey's or privateKey's???
I'll have a test on the jcop card, wait the result.
Code: Select all
KeyPair keyPair = new KeyPair(KeyPair.ALG_EC_FP, KeyBuilder.LENGTH_EC_FP_160);
ECPublicKey publicKey = (ECPublicKey) keyPair.getPublic();
ECPrivateKey privateKey = (ECPrivateKey) keyPair.getPrivate();
byte[] a1 = {};
byte[] b1 = {};
byte[] a2 = {};
byte[] b2 = {};
publicKey.setA(a1, (short) 0, (short) a1.length);
publicKey.setB(b1, (short) 0, (short) b1.length);
// ...;
privateKey.setA(a2, (short) 0, (short) a2.length);
privateKey.setB(b2, (short) 0, (short) b2.length);
// ...;
keyPair.genKeyPair();
break;
when key pair generated, Which parameters play a role? publicKey's or privateKey's???
I'll have a test on the jcop card, wait the result.