De interface van VDS Renaissance is in meerdere talen beschikbaar. De officiële documentatie wordt in het Engels onderhouden om één consistente en altijd actuele referentie te garanderen.
@VERIFY
[VDS7]
Syntax
@VERIFY(<data>, <signature>, <public key>)
Description
This function checks an Ed25519 digital signature. It returns 1 if <signature> is a valid detached signature of the bytes of <data> for <public key>, and an empty string otherwise.
| <data> | The data that was signed, exactly as it was signed — one changed character makes the signature invalid. |
| <signature> | The signature: 64 bytes written as 128 hexadecimal characters. |
| <public key> | The signer's public key: 32 bytes written as 64 hexadecimal characters. |
Hexadecimal values may be in upper or lower case. Any malformed input (wrong length, characters that are not hexadecimal) returns an empty string; the function never raises a run-time error.
Use @VERIFY for anything a program should accept only if it really comes from its publisher: license files, tokens, signed configuration files, update manifests. The private key stays with the publisher, who signs with @SIGN or with any other Ed25519 tool; the program contains only the public key, which is not a secret. No key and no file format are built into the language: each program brings its own.
As <data> is an ordinary function parameter, a comma inside it would split it. Build the data in a variable first, as in the example below.
OK
Unchanged.
Example
A license file in INI format holds a name, an e-mail address, an issue date and a signature. The signature was made by the publisher over the text name|email|date.
inifile open,myprog.lic
%N = @iniread(license,Name)
%E = @iniread(license,Email)
%D = @iniread(license,Issued)
%S = @iniread(license,Signature)
%Z = %N|%E|%D
if @verify(%Z,%S,8f58691883988abf29939d24744d8ab889c93cb53d2d9dd3806225b950b67fce)
info Licensed to %N
else
warn Invalid license file
end