Thursday 13 March 2014

PKIX path building failed: unable to find valid certification path to requested target


PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Solution:
  • 1. Issue related to path of jks file 
  • 2.  please add the certificate to jks.

javax.crypto.BadPaddingException: Data must start with zero


This is related to RSA Encryption issue.

If it comes in decryption process, then you might be using wrong private key.

In my case , it was happened once . I try to encrypt the plain text with public key but with wrong exponent value. When I am trying to decrypt using private key of the same pair , it throws the same exception "javax.crypto.BadPaddingException: Data must start with zero".

Solution :
I changed  the Public exponent to correct value and then issue solved.

Suggestion:
Please check the that you are using right key pairs at enryption and decryption levels.