Posted By:
Greg_Kaestle
Posted On:
Thursday, August 9, 2001 08:50 AM
Hello all, i am having a problem, and was wondering if anyone could help. I created a private key using openssl, and pkcs8 packed in der format with the command % openssl pkcs8 -outform DER -in newreq.pem -out client.key -topk8 Now, I import that into a byte[] byteKey, and execute the following code: PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(byteKey); KeyFactory keyFactory = KeyFactory.getInstance("RSA"); // I HAVE USED "DSA" TOO PrivateKey privKey = keyFactory.generatePrivate(privKeySpec); But i get InvalidKeySpecException and it doesn't seem like I should be - Can anyone help me out?
More>>
Hello all, i am having a problem, and was wondering if anyone could help.
I created a private key using openssl, and pkcs8 packed in der format with the command
% openssl pkcs8 -outform DER -in newreq.pem -out client.key -topk8
Now, I import that into a byte[] byteKey, and execute the following code:
PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(byteKey);
KeyFactory keyFactory = KeyFactory.getInstance("RSA"); // I HAVE USED "DSA" TOO
PrivateKey privKey = keyFactory.generatePrivate(privKeySpec);
But i get InvalidKeySpecException and it doesn't seem like I should be - Can anyone help me out?
Thanks,
Greg
<<Less