开发者

java signature verification

开发者 https://www.devze.com 2023-01-20 13:16 出处:网络
I am getting theexception , java.security.SignatureException: invalid encodin开发者_如何学JAVAg for signature

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

精彩评论

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