Command-Line Demo User’s Guide

Once a key pair has been generated, the following top-level menu is displayed:

S - Sign a file using DSA/SHA

V - Verify a DSA signed file

Q - Quit

Enter choice:

Commands may be entered in either upper or lower case, and all but the initial letter of a command is ignored. So, for example, to sign a file you may either type “s” or “sign”.

The commands on this top-level menu are described below.

Sign a File

To sign a file:

1.Enter s.

2.You will be prompted in succession for:

the name and location of the file to be signed

the name of the file that will hold the signature

3.BDEMODSA uses the private key generated at the beginning of the session to create a signature and places the result in the specified file.

Verify a Signed File

To verify the signature for a file:

1.Enter v.

2.You will be prompted in succession for:

the name and location of the file that was signed

the name and location of the file containing the digital signature

3.BDEMODSA uses the public key generated at the beginning of the session to verify the signature. If the signature is valid, BDEMODSA prints “Signature verified.”; otherwise, BDEMODSA prints “ERROR: Invalid signature while verifying file.”

Note: If the signature was generated during a previous execution of BDEMODSA, it is necessary to re-use the seed from signature signing, otherwise verification will fail.

A p p e n d i x A C o m m a n d - L i n e D e m o s

3 3 3

Page 355
Image 355
RSA Security 5.2.2 manual Sign a File