这里面包含了一百多个JAVA源文件

源代码在线查看: e204. verifying a signature.txt

软件大小: 551 K
上传用户: maple_78
关键词: JAVA
下载地址: 免注册下载 普通下载 VIP

相关代码

				See also e198 Generating a Public/Private Key Pair and e202 Listing All Available Signature Algorithms. 
				    // Verifies the signature for the given buffer of bytes using the public key.
				    public static boolean verifySignature(PublicKey key, byte[] buffer, byte[] signature) {
				        try {
				            Signature sig = Signature.getInstance(key.getAlgorithm());
				            sig.initVerify(key);
				            sig.update(buffer, 0, buffer.length);
				            return sig.verify(signature);
				        } catch (SignatureException e) {
				        } catch (InvalidKeyException e) {
				        } catch (NoSuchAlgorithmException e) {
				        }
				        return false;
				    }
				
							

相关资源