NOTA: La traducción de esta documentación es un esfuerzo personal y voluntario, no es un documento oficial de Sun Microsystems ni Oracle ni está patrocinado por ninguna de estas empresas. Los documentos originales (en inglés) están disponibles en: http://java.sun.com/docs/books/tutorial/.
Dirija cualquier comentario, petición, felicitación, etc. a tutorialesjava_@RROBA_codexion.com.
Si desea ayudar a mantener en funcionamiento esta web, colaborar con la traducción de estos documentos o necesita que se traduzca algĂșn capĂ­tulo en concreto puede realizar una donación directa mediante Paypal:
Compile and Run the Program (The Java™ Tutorials > Security Features in Java SE > Generating and Verifying Signatures)
Trail: Security Features in Java SE
Lesson: Generating and Verifying Signatures
Section: Verifying a Digital Signature
Compile and Run the Program
Home Page > Security Features in Java SE > Generating and Verifying Signatures
Compile and Run the Program

Here is the complete source code for the VerSig.java program, with some comments added.

Compile and run the program. Remember, you need to specify three arguments on the command line:

Since you will be testing the output of the GenSig program, the file names you should use are

Here's a sample run; the bold indicates what you type.

%java VerSig suepk sig data
signature verifies: true
Previous page: Verify the Signature
Next page: Weaknesses and Alternatives