VerifyFileSignature

VerifyFileSignature[{"file",sig},key]

verifies the digital signature sig for file using the specified public key.

VerifyFileSignature[{"file",range,sig},key]

verifies the digital signature sig for the specified range of bytes in the file.

VerifyFileSignature[{{"file1",range1,sig1},{"file2",range2,sig2},},key]

verifies the digital signatures sigi for each of rangei of bytes in the filei, all using the specified public key.

VerifyFileSignature[key]

represents an operator form of VerifyFileSignature that can be applied to files.

Details

Examples

open allclose all

Basic Examples  (2)

Generate an RSAbased key pair:

Generate a digital signature using your private key:

Verify a digital signature using your public key:

Sign a message using a hashing function of your choice:

Verification will automatically consider the hashing function used for signing:

Scope  (5)

File Types  (2)

Digitally sign and verify a signed CloudObject:

Create and verify a signature of the file specified by a File object:

Byte Ranges  (1)

If the signature was created for a range of bytes in the file, VerifyFileSignature will need the same range specified:

Compute a signature for the first 100 bytes of a file:

Verify the signature for the same range of bytes:

The signature will not be valid for a different range of bytes or the whole file:

Operator Form  (1)

Generate an elliptic curvebased key pair:

Apply the operator form of GenerateDigitalSignature to a file:

Verify a digital signature using your public key:

Multiple Files  (1)

Sign several files with the same set of keys:

Verify their signatures:

Properties & Relations  (1)

Uploading a file to the Wolfram Cloud keeps the contents of the file intact. When verifying the digital signatures of the original file and the cloud copy, they are both valid.

Copy a file to the cloud:

Create the signature for both the local and cloud copies of the file:

All possible combinations of files and signatures are valid:

Introduced in 2020
 (12.1)