Sign tax payers documents before sending the documents to Egyptian Tax Authority. so you can integrate with any other application (Desktop Or Web)
- Download ETAHttpSignature.zip
- Extract ETAHttpSignature.zip files in safe folder
- Run HttpSignature.exe
- Now you can sign your invoice serialize data by sending it to
ws://localhost:18088
by WebSocket
- Sign Egyptian Tax EInvoice through Websocket
Send the following json as text
to ws://localhost:18088
{Document:'{serialize_data}',TokenCertificate:'Egypt Trust Sealing CA'}
And you will receive the json as text
and you should convert it to json
{cades:"{Data}"}
{Data}
could be :
- NO_SOLTS_FOUND
- PASSWORD_INVAILD
- CERTIFICATE_NOT_FOUND
- NO_DEVICE_DETECTED
- Or Signature as a long text
var signature;
var socket = new WebSocket("ws://localhost:18088");
function ConnectToSignatureServer() {
socket.send('{Document:\'{serialize_data}\',TokenCertificate:\'Egypt Trust Sealing CA\'}');
socket.onmessage = function (response) {
var responseObj = JSON.parse(response.data);
if(responseObj.cades != 'NO_SOLTS_FOUND' && responseObj.cades != 'PASSWORD_INVAILD' && responseObj.cades != 'CERTIFICATE_NOT_FOUND' && responseObj.cades != 'NO_DEVICE_DETECTED')
{
alert('Document Signed');
signature = responseObj.cades;
}else{
alert(responseObj.cades);
}
};
}
socket.onclose = function() {
alert('Connection is closed');
};
socket.onerror = function() {
alert('Connection Error');
};
socket.onopen = function() {
alert('Connection Open');
};
Your contribution is welcome
The MIT License (MIT). Please see License File for more information.