E-Signature verification

gautam_dhamija
Tera Contributor
In ServiceNow, is there a method to verify digital signatures in attached documents? I attempted to use document intelligence, but it was not effective for this purpose, so I need a way to specifically check for digital signatures
1 REPLY 1

PrashantLearnIT
Giga Sage

HI Gautam,

 

ServiceNow does not provide a built-in method specifically for verifying digital signatures in attached documents. Document Intelligence, as you experienced, is not tailored for this particular use case. However, you can create a custom solution by leveraging ServiceNow's ability to integrate with external systems and use scripts.

Here is an approach you could take:

1. Use External Libraries or Services: Utilize external libraries or services that can verify digital signatures. For example, you can use libraries like iText for PDF documents, which supports digital signature verification.

2. Custom Script: Write a custom script in ServiceNow that calls an external service or library to verify the signature. This script could be triggered when a document is uploaded.

3. REST API Integration: If the verification service is available as a REST API, you can integrate it with ServiceNow using the Outbound REST feature.

Steps to Implement:

1. Set Up the External Service:
- Ensure you have an external service or library set up that can verify digital signatures.

2. ServiceNow Script Include:
- Create a Script Include in ServiceNow that handles the interaction with the external service.

```javascript
var DigitalSignatureVerifier = Class.create();
DigitalSignatureVerifier.prototype = {
initialize: function() {},

verifySignature: function(documentId) {
var gr = new GlideRecord('sys_attachment');
gr.get(documentId);
var documentContent = gr.getValue('payload'); // Adjust based on actual document storage

// Call external service or library to verify signature
var verificationResult = this.callExternalService(documentContent);
return verificationResult;
},

callExternalService: function(documentContent) {
var requestBody = {
"document": documentContent
};

var restMessage = new sn_ws.RESTMessageV2();
restMessage.setEndpoint('https://external-service-url/verify');
restMessage.setHttpMethod('POST');
restMessage.setRequestBody(JSON.stringify(requestBody));

var response = restMessage.execute();
var responseBody = response.getBody();
var responseJson = JSON.parse(responseBody);

return responseJson.isSignatureValid;
},

type: 'DigitalSignatureVerifier'
};

3. Business Rule:
- Create a Business Rule that triggers on document upload to call the Script Include.

```javascript
(function executeRule(current, previous /*null when async*/) {
var verifier = new DigitalSignatureVerifier();
var isSignatureValid = verifier.verifySignature(current.sys_id);

if (!isSignatureValid) {
gs.addErrorMessage('The document signature is invalid.');
current.setAbortAction(true);
}
})(current, previous);

4. Handle Validation Results:
- Based on the verification result, you can take appropriate actions like rejecting the document upload or notifying the user.

 Example Scenario:

1. User Uploads Document:
- User uploads a document to a ServiceNow record.

2. Business Rule Triggered:
- The Business Rule triggers on the document upload event.

3. Script Include Verification:
- The Script Include fetches the document content and sends it to the external service for signature verification.

4. Result Handling:
- The result from the external service determines whether the document upload proceeds or is aborted with an error message.

By following these steps, you can effectively verify digital signatures in documents attached to ServiceNow records.

 

 

********************************************************************************************************
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.

********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect


Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************