digital-signature

Digital signature with CryptVerifySignature

╄→гoц情女王★ 提交于 2019-12-25 08:50:12
问题 I want to implement digital signature app using CryptVerifySignature. I've written this code(with help of MSDN example): #define Check(condition, message) if (!(condition)) { fprintf(stderr, "%s\n", message); goto Exit; }; void DigSign(const char* inputFileName, const char* signFileName) { HCRYPTPROV hProv; BYTE *pbBuffer= NULL; DWORD dwBufferLen = 0; HCRYPTHASH hHash; HCRYPTKEY hKey; HCRYPTKEY hPubKey; BYTE *pbKeyBlob; BYTE *pbSignature; DWORD dwSigLen; DWORD dwBlobLen; FILE* inputFile =

How to prevent my .exe to be recognized as malware?

巧了我就是萌 提交于 2019-12-25 07:59:16
问题 I have written a little tool a few days ago (see Github project here) that works as a single .exe portable file. It is compiled/linked with: cl mytool.c I have uploaded the .exe on internet, but when people try to download it (direct link here), the file is seen as malware / potential threat, and thus can't be downloaded. ( Note that when disabling antivirus for 10 minutes, it is possible to download it successfully. ) How to compile/link my tool so that my .exe file is seen as potential

Certifying Pdf document with iText

試著忘記壹切 提交于 2019-12-25 03:45:31
问题 I can sign my pdf and verify it by adding my smith.crt to be trusted in adobe reader (i get the green check mark) , my problem is certifying my pdf, i can not get the blue ribbon in the top left corner of my pdf, is it because i use the self-signed certificate? I get the message: The validity of the document certification is UNKNOWN. The author could not be verified. Can you please help me out, how can I get that blue ribbon? import java.io.FileInputStream; import java.io.FileOutputStream;

extract signature from digital certificate

折月煮酒 提交于 2019-12-25 03:26:50
问题 I get lot of pdfs in my system. I need to check if all of these files are:- digitally signed their integrity maintained(by comparing the hash of file content with the message digest embedded in /Contents. . I am using python to do this. Till now I have been able to get the /Content from signature dictionary using PyPDF2. The content is pkcs7--der encoded. Is there a way I can extract the signed message digest? Similar operation was done in C as this answer 回答1: DER is binary format, its

Invalid PDF digital signature in WinRT app

橙三吉。 提交于 2019-12-25 00:52:23
问题 I am trying to port a working solution for signing PDFs from a standard C# class library to portable class library (or windows store app 8.1). iTextSharp version: 5.5.3.0 The logic is as follows: I create a signature appearance in iTextSharp, hash it (SHA256, it's a third party requirement), send the hash to a webservice which returns me the signed content. As mentioned, the solution is working fine e.g. in ASP.net web applications, but all the attempts to implement it in the WinRT

CAdES Digital Signature

烈酒焚心 提交于 2019-12-24 15:20:16
问题 I've been trying to implement digital signing (CAdES) for PDF files using Portuguese Citizen Card, however I'm having a hard time figuring out the perfectly working solution. Currently I have two sets of code. First one: public void signCAdES(...) { String pkcs11Config = "name=GemPC" + "\n" + "library=C:\\WINDOWS\\SysWOW64\\pteidpkcs11.dll"; ByteArrayInputStream configStream = new ByteArrayInputStream(pkcs11Config.getBytes()); Provider pkcs11Provider = new sun.security.pkcs11.SunPKCS11

Digital Signature for Excel Macro

偶尔善良 提交于 2019-12-24 12:35:08
问题 In our project we have an excel template (.xlt) and an add-ins file (.xla). These files are used to create a dataview. Dataview is nothing but a kind of report. The xla contains code to create controls for creating, deleting, managing the dataview and its contents. These controls are OCX controls created in VC++ for creating the dataview. We have the add-ins code separately and the template file separately. The xlt and xla was digitally signed for ensuring that the code is tamper proof.

Changing signature appearance after signing pdf file with iTextSharp

こ雲淡風輕ζ 提交于 2019-12-24 11:52:06
问题 I'm writing a service where I pre-sign a pdf file with an empty container, take a hash of a byte range from the pdf file and send it to another service, that will allow a user to sign the hash using a mobile phone. I get back a certificate that I will inject into the signature container in the pre-signed pdf file. Everything works so far, except that I want to have visible signatures in the document. The visible signatures require the certificate to get information from it (like who signed it

PC/SC Functions for Digital Signature

感情迁移 提交于 2019-12-24 11:04:03
问题 I am trying to sign an XML document with the Micrisift API for the smart cards... So far I can list the card readers, connect to the right card and establish the context but after that I am not sure what is next...... What PC/SC Functions Do I need to call to sign a document with a private smartcard key? thanks in advance Javier 回答1: If you have a middleware installed you can use the Windows CAPI for cryptographic functions. Some middlewares also ship a PKCS#11 library you can use. If you don

Can't add ltv to PDF document. Error

柔情痞子 提交于 2019-12-24 10:46:09
问题 I'm sign document, using Itext. I have that method: public static void sign(String src, String dest, Certificate[] chain,PrivateKey pk, String digestAlgorithm, String provider,CryptoStandard subfilter, TSAClient tsa ) { // Creating the reader and the stamper PdfReader reader = new PdfReader(src); FileOutputStream os = new FileOutputStream(dest); PdfStamper stamper = PdfStamper.createSignature(reader, os, '\0'); // Creating the appearance PdfSignatureAppearance appearance = stamper