Documentation

The Java™ Tutorials
Hide TOC
Input the Signature Bytes输入签名字节
Trail: Security Features in Java SE
Lesson: Generating and Verifying Signatures
Section: Verifying a Digital Signature

Input the Signature Bytes输入签名字节

Next, input the signature bytes from the file specified as the second command line argument.接下来,从指定为第二个命令行参数的文件中输入签名字节。

FileInputStream sigfis = new FileInputStream(args[1]);
byte[] sigToVerify = new byte[sigfis.available()]; 
sigfis.read(sigToVerify);
sigfis.close();

Now the byte array sigToVerify contains the signature bytes.现在字节数组sigToVerify包含签名字节。


Previous page: Input and Convert the Encoded Public Key Bytes
Next page: Verify the Signature