Skip to Main Content

Java Card

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to get public key by using modulus and exponent

UmerMar 31 2011 — edited Apr 1 2011
Dear sir
I have modulus and exp of the public key, how can i combine them to ge the complete public key, in the host app. These values are coming from the java card ??
i am getting these as follows:
			   rAPDU = channel.transmit(new CommandAPDU(getPublicKeyModCommand));
			   if (rAPDU.getSW() != 0x9000)
			   {  
				   System.out.println("Could not get the modulus");
			   }
			   if (rAPDU.getSW() == 0x9000)
			   {  
				   modulus = new BigInteger(rAPDU.getData());
				   arrayPrint(rAPDU.getData());
			   } 
			   
			   rAPDU = channel.transmit(new CommandAPDU(getPublicKeyExpCommand));
			   if (rAPDU.getSW() != 0x9000)
			   {  
				   System.out.println("Could not get exp");
			   }
			   System.out.println();
			   if (rAPDU.getSW() == 0x9000)
			   {
				   exponent = new BigInteger(rAPDU.getData());
				   arrayPrint(rAPDU.getData());
			   } 
This post has been answered by safarmer on Apr 1 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2011
Added on Mar 31 2011
14 comments
2,024 views