File Signing/Verification sample that hashes the data in a file and signs or verifies the signature with the private or public key respectively. Usage --------- The SignHash sample is run from the command line as follows: SignHash [md5|sha1] [|] [|] /s to Sign. /v to Verify. /cert [|] - use a certificate. /key [|] [|] use container with exchange or signature key. Signing --------------- /s for Signing When Signing, the is Hashed and signed with the private key. The private key can be a certificate or Crypto key container. Read the /cert or /key options for more information. After the file is signed, the signature is saved to . Verifying --------------- /v for Verifying When Verifying, the is Hashed and the is used along with the public key to verify the signature. The public key can be obtained from a certificate or key container. Using Certificates ------------------ /cert [|] A certificate can be used to sign or verify a file. The sample retrieves the certificate from a certificate store. To find a certificate to use you must supply the certificate name, certificate store name and whether you want to look in the user's store or the local machine store for the certificate. The most common request is to use the user's personal certificate store to find the certificate. In this case the store name is "MY" and the option would be used. Using Key Containers -------------------- /key [|] [|] A key container can be used to sign or verify a file. A key container represents a CryptAPI container that holds the private/public key. The option selects the user store and selects the machine store. selects the exchange key in the container and selects the signature key.