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!

Key Length from Certificate

843810Oct 28 2004 — edited Nov 1 2004
Given an X509 certificate with public key, is it possible to derive the Key Length ?

Example: ( from Bouncy Castle libs )

// Generate key pair
KeyPairGenerator keyGen = KeyPairGenerator.getInstance(
ecnryptionType,providerID );
keyGen.initialize(keyLen, new SecureRandom());
KeyPair keypair = keyGen.generateKeyPair();

keyLen in this example, is the Key length chosen for initialization ...when the public key is subsequently saved in the certificate, I would like to be able, later, to derive the key length used ?

Ideas ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 29 2004
Added on Oct 28 2004
1 comment
177 views