pkcs#7

PdfPKCS7 .verify() return false

别等时光非礼了梦想. 提交于 2020-01-23 04:00:09
问题 I have been working with itextpdf-5.5.5, and the Integrity check return false. PdfPKCS7 pkcs7 = fields.verifySignature(name); pkcs7.verify();<------ HERE return false But Adobe Acrobat Reader say: Signed and all signatures are valid. :( This is the document: Test.pdf. Could someone explain what is happening?. Thanks in advance 回答1: The CMS signature container embedded in your PDF has some questionable properties. In particular it has an encapsulated content, even though it merely is a byte

How to extract and verify PDF signature (PKCS7) with openssl?

不羁岁月 提交于 2020-01-16 22:39:44
问题 I would like to detect signed PDFs in PHP and verify if the signature is valid. From this document I have written this PHP code below. What it does is: Extract the PKCS7 code (it works because I can get the details from Openssl) Compute the SHA256 hash of the document. At the end I has a PKCS7 file and a SHA256. Now, I would like to verify my signature against my PKCS7 file. How can I do this? I initially looked to the digest_enc_alg / sha256WithRSAEncryption / enc_digest , but it seems it is

How to extract and verify PDF signature (PKCS7) with openssl?

你离开我真会死。 提交于 2020-01-16 22:37:19
问题 I would like to detect signed PDFs in PHP and verify if the signature is valid. From this document I have written this PHP code below. What it does is: Extract the PKCS7 code (it works because I can get the details from Openssl) Compute the SHA256 hash of the document. At the end I has a PKCS7 file and a SHA256. Now, I would like to verify my signature against my PKCS7 file. How can I do this? I initially looked to the digest_enc_alg / sha256WithRSAEncryption / enc_digest , but it seems it is

How to extract and verify PDF signature (PKCS7) with openssl?

六月ゝ 毕业季﹏ 提交于 2020-01-16 22:37:07
问题 I would like to detect signed PDFs in PHP and verify if the signature is valid. From this document I have written this PHP code below. What it does is: Extract the PKCS7 code (it works because I can get the details from Openssl) Compute the SHA256 hash of the document. At the end I has a PKCS7 file and a SHA256. Now, I would like to verify my signature against my PKCS7 file. How can I do this? I initially looked to the digest_enc_alg / sha256WithRSAEncryption / enc_digest , but it seems it is

Generate valid CMS Signature file adding external PKCS#1 with Java

耗尽温柔 提交于 2020-01-15 05:56:07
问题 I'm generating CMS signature files with external PKCS#1 based on this thread. The first step is obtain the signed attributes from the original file to be signed in external application which is returning PKCS#1 byte array. Then build standard org.bouncycastle.cms.SignerInfoGenerator with original file hash, signed data (PKCS#1) and certificate to add to CMS, and finally create the attached signature . But when i'd tried to validate it using this code: String originalFile =

create PKCS7 with presigned data using bouncy castle

ⅰ亾dé卋堺 提交于 2020-01-13 20:34:13
问题 I would like to create a detached signature in a PDF file using a PKCS7 container. The data (hash) is being signed beforehand on a different device with the private key. I want to create a PKCS7 containing the signed data along with the certificate with the public key. I can't seem to create the PKCS7 with bouncy castle without supplying the private key and having the library signing the data. This doesn't seem to work: InputStream inStream = new FileInputStream("1_public.pem");

PDF Signature digest

回眸只為那壹抹淺笑 提交于 2020-01-11 03:03:28
问题 I have a quick question about calculating the digest of a PDF document to use for a digital signature (somewhat related to one of my earlier questions, I'm trying to figure out why you would need to know a client's certificate to create the correct digest). In Adobe's documentation about the PDF format the following is specified: A byte range digest shall be computed over a range of bytes in the file, that shall be indicated by the ByteRange entry in the signature dictionary. This range

C# Cades P7M with Smartcard

假装没事ソ 提交于 2020-01-05 08:31:40
问题 I read this post how can sign a file with BouncyCastle dll in c# and I would to know if it is possible found some support for certificates stored in smartcard. What I'm trying to do is to create P7M cades but it seems impossibile to found any dopcumentation, .NET classes or free library. 回答1: You can also try this c# ported version of an European Commission initiative: DSS .NET It supports CAdES. Try using the MSCAPISignatureToken and the guide in the CookBook CookBook 回答2: I used DSS.NET

Bouncy Castle i cannot get all certificate

孤人 提交于 2020-01-02 15:14:10
问题 I'm trying to read certificate from smime.p7s file, the certificate chain is: Baltimora Cyber Trust --> DigitPA --> Aruba PEC So when i'm trying to extract, I retrieve only the last two certificate, the last like subject and the first like issuer. What am I wrong? the code: private List<CertificateInfo> reading(ASN1InputStream asn1Stream) throws IOException, CMSException, CertificateException { ArrayList<CertificateInfo> infos = new ArrayList<CertificateInfo>(); ASN1Primitive obj = asn1Stream

Extracting individual .cer certificate from a .p7b file in java

心不动则不痛 提交于 2020-01-02 07:46:07
问题 I am new to Cryptography and so please excuse me if you think this is a basic question I have a .p7b file which I need to read and extract the individual public certificates i.e the .cer files and store it in the key store. I need not worry about persisting in the key store as there is already a service which takes in the .cer file as byte[] and saves that. What i want to know is , how do i read the .p7b and extract the individual .cer file? I know that can be done via the openSSL commands,