Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This script is different from postwork because it runs on client side and it has user context. For example applying digital signature on file attachment.

 

Code Block
languagejs
titleSign File Attachment
var fileId = $Xml.Evaluate('File');
var attachSource = true; // true is default. Specifies the source file should be embedded in signature or not.
var format = 'X'; // X value is is default. BES, T, C, X, A values also can be used.

AltiKare.Signature.signFiles($Xml.sign([fileId], attachSourceSelectAll('Files/File'), format).then(function(result) {
    
	if (result) {
	    // result.certificateName contains the name of signer
    	// result.certificateIssuer contains the issuer of signer certificate
    	// result.certificateSerialNumber contains the serial number of signer
    	// result.files.forEach(function(file) {
    		// file.sourceId contains source file id.
            // file.id contains the signature file id. if this property same with sourceId than signatured embedded in source file (like pdf or eml file formats)
    	// });
	}
   
    $Complete(!!result);
});

...