Skip to Main Content

Java Security

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 PublicKey() from X509 certificate

843811Mar 11 2005
Hi All!,

I am using "out.println("Public key: "+x509certificate.getPublicKey());" to extract the publick key from the certificate..it is giving me the modulus and the exponent given below :

My Code:
fileinputstream = new FileInputStream(request.getParameter("file"));
X509Certificate x509certificate =
(X509Certificate)certificatefactory.generateCertificate(fileinputstream);

out.println("Public key: "+x509certificate.getPublicKey());"

Can anyone tell me how to get public key from the X509 and Pkcs7 certificate . How to use getPublicKey()..

Please Help

Publick keyRSA Public Key modulus: c745cb4daa4eea3f5e904b03f6887b36fee992346dc3ce43d0b5e8175e035297681ac22d17723df7fc9f10969d99ec4d25598658c27b8e0ae2cff6d36ee39a02534577d30f668568f74cc9928992a0699e1ad3c349eb542e9d7d64ade9fe90e025ad5ad60b598dfb46783402c40259e580234be878a1f487b8d22410e1cb14709f81fafd1e363a1c4541f4f754996b7a789a2af7ff180e0bf601107d305eb3d502ccc8df9761cffff9e09f0ac222bafc13b111cef0b6941e7a8dacdbd0f39b6fc3cff382cd8bdf5067c102ebf988054a0cdddde06db4add795c872766543ebb910b4137f8acd349e4fbb37f5753a4af57358470c04eb76ce8f4b09fd6f6576cf public exponent: 10001



Thanks & Regards,
San
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 8 2005
Added on Mar 11 2005
0 comments
332 views