FAQ Database Discussion Community


Unable to get SignerCertificate from CMSSigned data

java,security,digital-signature,x509certificate,bouncycastle
While trying to extract SignerCertificate (X509) from CMS Signed data, my code is giving error, no certificate found. I am using bouncycastle libraries for this purpose. I think I am unable to sign it properly.The code snippets are attached, Have a look and please correct where I am going wrong....

Signing and verifying with java android

java,android,rsa,digital-signature,public-key-encryption
I'm trying to sign an encrypted message with a private key and verify it in Java. This is my first time working with encryption and signatures so I'm not sure how it is supposed to work and I'm kind of stuck here. The verification always returns false. I am posting...

Digital Signature in java / android (RSA keys)

java,android,encryption,rsa,digital-signature
I would like to generate a digital signature in my java/android project with a private key(RSA) stored in DB. My 2 keys was generated with the below code (project is in production and I cannot change it): // Get keys pair (RSA) KeyPair rsaKyePair = createKeyPair(); // Get private/ public...

How to send a digital signed email or document from iphone ( iOS 8 ) [closed]

ios,iphone,digital-signature
I need a way to create a digital signed document and send using a digital signed e-mail from my iPhone ( iOS 8 ) Any suggestions regarding apps are kindly appreciated Thanx...

about visible digital signatures

itext,digital-signature
Given an input pdf file with visible digital signatures, I would like to obtain a new pdf file that preserves the visual representation of the signatures as graphical objects but not longer as signatures fields. I have done that with a tool (see the input and the output files) but...

verifying digital signature in c#

c#,.net,certificate,digital-signature,x509certificate
I have a signed "DLL" file that I want to validate his digital signature in run time ("Before I'm loading it") I have the public key of the certificate embedded in my code, Is there a way to get the "message digest" from the digital signature? or another way to...

Digitaly link between app and WP

security,windows-phone-8,digital-signature
I have a WebAPI web service which works under https protocol and WP8 app which gets the data from this web service. I have been ask to digitally sign the app with web service. I'm not sure how can I do it or is it even possible but the idea...

Difference between Sha1WithRSA and Sha1WithRSAEncryption?

java,rsa,digital-signature,sha1,public-key-encryption
I've noticed these two algorithms that have different names, but functionally sound very similar. When I looked further, I've found out Sha1WithRSA is available across many Security Providers, but Sha1WithRSAEncryption is only available if I use the BouncyCastle Provider. Example: JcaContentSignerBuilder("SHA1WithRSAEncryption").setProvider("BC") Is it replacable with JcaContentSignerBuilder("SHA1WithRSA").setProvider("SunJSSE") ? Can someone throw...

Authenticity and Integrity of HTTP Requests

hash,http-post,digital-signature,integrity,authenticity
I have an API endpoint where external websites can submit a POST request. What would be the best method to make sure the requests are authentic and also are not tampered with, so they respect the principle of integrity? Since the data is not valuable such as credit card information,...

How to get signature Value from signed PDF in C#?

c#,pdf,itextsharp,digital-signature
How is it possible to get signature Value from signed PDF file? I can get all other data from signature except its value. Is there any way to get it in C#? PdfPKCS7 pk; PdfReader reader = new PdfReader(PdfFilename); AcroFields af = reader.AcroFields; var names = af.GetSignatureNames(); foreach (string name...

Working with EVP and OpenSSL, coding in C

c,encryption,openssl,digital-signature,evp-cipher
I've seen many questions on OpenSSL and EVP, but not very many clear answers, but I figured I'd still post my question here and hope for better feedback. The materials given to me are a signed file "symmetrickey.bin", an RSA key set "privatekey_A.pem", "publickey_A.pem", and the other user's public key...

I need to read the values in an XML signed from java

dom,digital-signature
I have a signed XML document, I can validate the signature, what interests me is to get certain fields with which to work: <?xml version="1.0" encoding="UTF-8"?> <inicio> <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> <ds:Reference URI="#1500-Fri Jan 30 19:11:38 BOT 2015"> <ds:Transforms>...

Sign PDF with smartcard in web context using CAPICOM & iTextSharp

itextsharp,activex,digital-signature,smartcard,capicom
Read through the following references: iText Digital signature white paper, and C# examples. (specifically chapter 4) For those interested, another great and concise summary of the PDF signing process. CAPICOM documentation. Online examples / questions here and on iText mailing list archives, such as here and here. Hashing code: BouncyCastle.X509Certificate[]...

create pdf dynamically and sign it using itext pdf

pdf,itext,digital-signature,itextpdf
I am dynamically creating a PDF document, add a signature field and afterwards trying to sign it. The signing works properly, but i am getting an exception: "certfied by %, invalid signature and signature contains invalid data" import java.io.BufferedOutputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import...

SignedXml Compute Signature with SHA256

c#,xml,encryption,digital-signature
I am trying to digitally sign a XML document using SHA256. I am trying to use Security.Cryptography.dll for this. Here is my code - CryptoConfig.AddAlgorithm(typeof(RSAPKCS1SHA256SignatureDescription),"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"); X509Certificate2 cert = new X509Certificate2(@"location of pks file", "password"); XmlDocument doc = new XmlDocument(); doc.PreserveWhitespace = true; doc.Load(@"input.xml"); SignedXml signedXml = new SignedXml(doc); signedXml.SigningKey =...

Digital Signature verfication,The selected certificate has errors not valid for usage [closed]

java,digital-signature
Invalid Signature Error when trying to validate signed PDF?

iText Stamping - Java [duplicate]

java,pdf,itext,digital-signature,invalidate
This question already has an answer here: how to add blank page in digitally signed pdf using java? 2 answers I am having trouble with stamping PDF documents without invalidating digital signatures. Current, I succeeded stamping a PDF. However, if the document is previously signed the signature is no...

Loading raw 64-byte long ECDSA public key in Java

java,cryptography,digital-signature,public-key,ecdsa
I have a raw (r,s) format ECDSA NIST P-256 public key. It seems that there is no simple way to load it into an object that implements java.security.interfaces.ECPublicKey. What is the cleanest way to load a 64 byte public key so that it can be used to check signatures?...

How to show digital signature VALUE in signature appearance of PDF file with iTextSharp

c#,itextsharp,digital-signature
Is it possible to append Digital signature VALUE in signature appearance while signing document, because I am using this part of code PdfFilename = txtFile.Text + "\\" + (string)chkLista.Items[i]; DestPdfFilename = txtFile.Text + "\\" + (string)chkLista.Items[i] + "-signed.pdf"; Org.BouncyCastle.X509.X509CertificateParser cp = new Org.BouncyCastle.X509.X509CertificateParser(); Org.BouncyCastle.X509.X509Certificate[] chain = new Org.BouncyCastle.X509.X509Certificate[] { cp.ReadCertificate(cert.RawData)...

node.js crypto signature and openssl signature does not match

node.js,openssl,rsa,digital-signature,sha256
I wanted to perform RSA-SHA512 on a file in node.js. I could calculate sha512 hash of the given data file which matches with that of openssl's. However when trying to get the digital signature on the same hash, node.js signature differs from openssl signature. Below is an example code snippet:...

Is checking one randomly chosen digital signature is enough for verifying multiple signed file?

java,certificate,x509certificate,digital-signature,bouncycastle
Imagine, I have multiple detached signatures of some binary file and they stored in different .sig files. When somebody modifies file, all signatures will become invalid. For xml an enveloped signature is widely used. Cheking it is more difficult - one have to extract last ds:Signature element, check signature, remove...

NDK application Signature Check

java,android,security,android-ndk,digital-signature
I have some security key in an application. I want to store it securly. I like to store it in a native shared library (maybe generated from some code). After that I want it to be returned by a method that will check the signature of the original APK. So...

Sending signature data in response APDU - Java Card

digital-signature,smartcard,javacard,apdu,ecdsa
I would like to sign some data (the MESSAGE byte array) on my Java Card and then return the signature in a response APDU. My code works fine (or at least I think it does and it returns 9000) without the line apdu.sendBytes(BAS, sSignLen), but when I uncomment it I...

Is it possible to use : using Windows.UI.Input.Inking; in Windows phone 8.1?

c#,windows-phone-8.1,digital-signature
I am trying to crete a windows 8.1 universal app .. on the phone app I want to have a digital signature using Capturing ink data .. I have seen the : https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn792131.aspx a problem appears when i use the : using Windows.UI.Input.Inking; any one knows why ? or what...

Sign PDF using an external service and iText

itext,digital-signature,digest
I have this scenario. I have an application that generates a PDF, and that needs to be signed. We have not the certificates to sign the document, because they're in a HSM, and the only way we could make use of the certificates is using a webservice. This webservice, offers...