开发者

java signature verification

I am getting the exception ,

java.security.SignatureException: invalid encodin开发者_如何学JAVAg 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..?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜