bassemAgmi / EInvoicingSigner

A command prompt application used to serialize and sign tax payers documents before sending the documents to Egyptian Tax Authority.
71 stars 57 forks source link

Signature Question #21

Open alibeep1 opened 2 years ago

alibeep1 commented 2 years ago

Hi Bassem,

Can you please give a sample FullSignedDocument.json file because I doubt I am on the right track. For insight, after running the .bat file, the FullSignedDocument.json is just the same as the source document with the exception of the "Documents" wrapper. I see no additional signature, encryption or anything. This also makes me wonder why we use SHA-256 encryption functions. Kindly have a look at the attached images

Thanks. image image

Also, if you can explain this code block because I get errors if the SourceDocument type version is not equal to "0.9". The error can be seen below.

// retrieve cades if (request["documentTypeVersion"].Value<string>() == "0.9") { cades = "ANY"; } else { cades = tokenSigner.SignWithCMS(canonicalString); } File.WriteAllBytes(tokenSigner.DllLibPath+ @"\Cades.txt", System.Text.Encoding.UTF8.GetBytes(cades));

image

bassemAgmi commented 2 years ago

The code could not access the token library. May be you do not install token SDK.