digital-signature

Get Visible Signature from a PDF using PDFBox?

时光毁灭记忆、已成空白 提交于 2019-11-28 11:30:39
Is it possible to extract the visible signature (image of capture) of an signed PDF with the OSS libary PDFBox? Workflow: - list all signatures of a file - show with signatures include an visible signature - show which are valid - extract images of signatures (need to extract correct image for each signature) something in oop style like following would be awesome: PDFSignatures [] sigs = document.getPDFSignatures() sig[0].getCN() ... (Buffered)Image visibleSig = sig[0].getVisibleSignature() Found class PDSignature and how to sign a PDF, but not a solution to extract an visible signature as

In Itext 7, how to sign a pdf with 2 steps?

*爱你&永不变心* 提交于 2019-11-28 11:00:00
问题 Following the answers given in this previous question : In Itext 7, how to get the range stream to sign a pdf?, i've tried to reimplement the two steps signing method working in Itext 5 but i encounter an issue when trying to reopen the document result of the first step (with the PdfReader or a pdf reader).(invalid document) Here is the presigning part for a document already containing an empty signature field named certification ... why is the result of this step invalid ? PdfReader reader =

Error occurred while decoding OAEP padding

别来无恙 提交于 2019-11-28 10:55:59
While decrypting text using RSACryptoServiceProvider.Decrypt , I am getting the error: Error occurred while decoding OAEP padding. Here's my code: CspParameters cspParam = new CspParameters(); cspParam = new CspParameters(); cspParam.Flags = CspProviderFlags.UseMachineKeyStore; clsCertificates cc = new clsCertificates(); string a = ""; cc.OpenStoreIE(ref a); cc.SetProperties(); X509Certificate2 cert = new X509Certificate2(); cert = cc.x509_2Cert; RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(cspParam); //to gentrate private and public keys from the certificate rsa.FromXmlString

How to change the coordinates of Signature in CoSign Signature SOAP API and place it over some given text (i.e. Sign Here)?

一笑奈何 提交于 2019-11-28 10:52:18
问题 My pdf file will have an area with the text "Sign here". It could be anywhere in the pdf(i.e. the coordinates for that area is not defined) . I would like to add the signature over that given area or text(eg "Sign Here") in my pdf file. In the given code http://developer.arx.com/quick-start/sapi-web-services/#t-helloworld , how can I achieve this? 回答1: You need to know which page, and where on the page, the graphical part of the digital signature should be placed. One way to determine the

Add signed/authenticated attributes to CMS signature using BouncyCastle

妖精的绣舞 提交于 2019-11-28 10:17:05
I want to generate a simple CMS signature using bouncycastle. This code works! Security.addProvider(new BouncyCastleProvider()); String password = "123456"; KeyStore ks = KeyStore.getInstance("PKCS12"); ks.load(new FileInputStream("c:/cert_123456.p12"), password.toCharArray()); String alias = (String)ks.aliases().nextElement(); PrivateKey key = (PrivateKey)ks.getKey(alias, password.toCharArray()); Certificate[] chain = ks.getCertificateChain(alias); CMSSignedDataGenerator generator = new CMSSignedDataGenerator(); generator.addSigner(key, (X509Certificate)chain[0], CMSSignedDataGenerator.DIGEST

iText - Generating PDF hash without certificate chain

隐身守侯 提交于 2019-11-28 09:31:44
I'm trying to build an application where the following happens: A client requests a PDF-hash from the server. The server generates the hash of a PDF-file and sends this to the client. The client signs this hash with his private key and sends the signed hash along with the public part of his own certificate. The server generates a new, signed PDF file. The problem I'm having with this: It seems impossible for the server to generate a to-be-signed hash without having the client's certificate available beforehand. I'd really prefer to create a solution where the server does not need to know the

Adding a digital signature to a pdf file [duplicate]

梦想与她 提交于 2019-11-28 09:22:41
Possible Duplicate: Digitally sign PDF files In the application a user will upload a PDF file and then upload a personal signature created using a digital pen. How can I embed this signature in the pdf file? Use a PDF editing library. I've used this one before: http://pdfsharp.com/PDFsharp/ JoeManiaci As far as I have been able to figure out, you can't programmatically sign the document and still have it be a valid signature. I am looking at this from the most strictest of positions though. I am a DoD contractor tasked with doing as much as I can automating the creating of pdf documents and

What is the difference between the different padding types on iOS?

泄露秘密 提交于 2019-11-28 09:10:09
On iOS, the Certificate, Key, and Trust Services API contains the following padding types: kSecPaddingNone kSecPaddingPKCS1 kSecPaddingPKCS1MD2 kSecPaddingPKCS1MD5 kSecPaddingPKCS1SHA1 A user on the Apple CDSA mailing list says that "kSecPaddingPKCS1 [...] is the same as PKCS #1 1.5". The Certificate, Key, and Trust Services Reference annotates the latter three padding types ( kSecPaddingPKCS1MD2 , kSecPaddingPKCS1MD5 , and kSecPaddingPKCS1SAH ) with "Standard ASN.1 padding will be done, as well as PKCS1 padding of the underlying RSA operation". What is the difference to kSecPaddingPKCS1 ? Is

In Itext 7, how to get the range stream to sign a pdf?

梦想与她 提交于 2019-11-28 08:45:09
问题 I'm trying to migrate my application from iText 5.5.9 to iText 7 and I have a problem with signing a document on the server using a signature created on the client (described in the Digital Signatures for PDF documents). As the getRangeStream() method isn't public anymore as it was in iText 5.5.9, how can I obtain a reference to the range stream? 回答1: getRangeStream is not the only method that was refactored from PdfSignatureAppearance to PdfSigner and made protected on that way. The same

How to retrieve my public and private key from the keystore we created

旧城冷巷雨未停 提交于 2019-11-28 07:01:17
My task is the following: Retrieve my public and private key from the keystore I created. Use these keys to encrypt a paragraph using my RSA 2048-bit public key. Digitally sign the result using the DSA-SHA-1 signature algorithm. Save the digital signature output on a file called output.dat . The program below is throwing error : "java.security.InvalidKeyException: No installed provider supports this key: sun.security.provider.DSAPublicKeyImpl". import java.security.*; import java.security.KeyStore.*; import java.io.*; import java.security.PublicKey; import java.security.PrivateKey; import