RSA Key Spec problem
I basically got this code right from the Tutorial at:
http://java.sun.com/docs/books/tutorial/security1.2/apisign/enhancements.html
.
.
.
//"buf" is a byte array containing my RSA private key
java.security.spec.X509EncodedKeySpec spec =
new java.security.spec.X509EncodedKeySpec(buf);
java.security.KeyFactory key = java.security.KeyFactory.getInstance("RSA");
java.security.PrivateKey priv = key.generatePrivate(spec);
java.security.Signature sig = java.security.Signature.getInstance("RSA");
sig.initSign(priv);
.
.
.
It blows up at the line:
java.security.PrivateKey priv = key.generatePrivate(spec);
with the error:
java.security.spec.InvalidKeySpecException: Key spec not RSA.
What Key spec can I use that works with RSA? TIA!

