I have created a sample web service to digitally sign a document using etoken. It is creating the Signature file for the first time.But when I am trying to run the web service again it throwing me the following error.Can anyone update regarding this?

java.security.InvalidKeyException: Private keys must be instance of RSAPrivate(Crt)Key or have PKCS#8 encoding at sun.security.rsa.RSAKeyFactory.translatePrivateKey(RSAKeyFactory.java:288) at sun.security.rsa.RSAKeyFactory.engineTranslateKey(RSAKeyFactory.java:191) at sun.security.rsa.RSAKeyFactory.toRSAKey(RSAKeyFactory.java:111) at sun.security.rsa.RSASignature.engineInitSign(RSASignature.java:106) at sun.security.rsa.RSASignature.engineInitSign(RSASignature.java:99) at java.security.Signature$Delegate.init(Signature.java:1152)

0

There are 0 best solutions below