return JDKKeyFactory.createPrivateKeyFromDERStream(
new ByteArrayInputStream(((PKCS8EncodedKeySpec)keySpec).getEncoded()));
}
catch (Exception e)
{
throw new InvalidKeySpecException(e.toString());
}
}
throw new InvalidKeySpecException("Unknown KeySpec type.");
}