Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

convert RSA Array of Byte Arrays( modulus & Exponent) Key Material into java.security.Public

2 views
Skip to first unread message

Herb McCutchan

unread,
Feb 11, 2005, 2:44:00 PM2/11/05
to
Does any one know how to convert RSA modulus & exponent ( return from a
token as a pubspec[][] into a java.security.Public object.

this is my best guess but it has a hole in the middle.

pubKeySpec[][] = ....from JNI PKCS11 API call
RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(new
BigInteger(pubSpec[0]),
new BigInteger(pubSpec[1]));

WHat goes here?

X509EncodedKeySpec pukeySPK = new X509EncodedKeySpec( ? );
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
java.security.PublicKey publicKey = keyFactory.generatePublic(pukeySPK);


Thanks
Herb

0 new messages