2

I am getting the exception ,

java.security.SignatureException: invalid encoding for signature

in my program . the following is the code snippet

Signature sig=Signature.getInstance("SHA1WithDSA"); sig.initVerify(qakeyPair.getPublic()); sig.update(data.getBytes()); sig.verify(sig_bytes) 

why is this happening..?

1 Answer 1

2

The contents of sig_bytes are not a valid signature according to what the algorithm expects. Perhaps they're the byte representation of a base64 or hex encoded signature rather than the decoded signature data.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.