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
- The signature in VerifyFileSignature must be a DigitalSignature object generated by GenerateFileSignature.
- The key is a PublicKey object. Possible types of keys are "EllipticCurve" and "RSA".
- VerifyFileSignature returns True or False for each provided signature, indicating whether or not the signatures are valid.
- VerifyFileSignature supports the following range specifications:
-
n first n bytes -n last n bytes {m,n} bytes m through n 0 no bytes All all bytes - Range specification All is equivalent to {1,-1}.
- Signature verification for File["file"] and CloudObject[…] is also supported.
Examples
open allclose allBasic Examples (2)
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 curve–based key pair:
Apply the operator form of GenerateDigitalSignature to a file:
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:
Create the signature for both the local and cloud copies of the file:
All possible combinations of files and signatures are valid:
Text
Wolfram Research (2020), VerifyFileSignature, Wolfram Language function, https://reference.wolfram.com/language/ref/VerifyFileSignature.html.
CMS
Wolfram Language. 2020. "VerifyFileSignature." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/VerifyFileSignature.html.
APA
Wolfram Language. (2020). VerifyFileSignature. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VerifyFileSignature.html