digital-signature

openssl digest different in c compared to java

ぃ、小莉子 提交于 2019-12-24 08:58:34
问题 Following is the code which is part of the DigitalSigning Handler final String NAMESPACEURI_WSSECURITY_WSU= "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"; final String NAMESPACEURI_WSSECURITY_WSSE = "http://docs.oasisopen.org/wss/2004/01/oasis-200401-wss-wssecurity-secext- 1.0.xsd"; final String NAMESPACEURI_XMLSIGNATURE_DS = "http://www.w3.org/2000/09/xmldsig#"; final String ATTRIBUTENAME_X509TOKEN = "http://docs.oasis-open.org/wss/2004/01/oasis-200401

Offline PDF timestamping using iText

自作多情 提交于 2019-12-24 08:38:27
问题 is it possible to timestamp PDF document offline using iText or any other component? I've googled standard solution utilizing iText and TSAClient class but it requires TSA as online service. We have certificate from TSA (including private key) whose purpose is to create timestamp signatures but I can't find any technical way how to do it with iText. Thanks for any guidance. Richmond 回答1: I've googled standard solution utilizing iText and TSAClient class but it requires TSA as online service.

get hash from pdf with iText 2.1.7 or Digital Signature Service

♀尐吖头ヾ 提交于 2019-12-24 07:59:19
问题 I'm migrating a project from iText 5 to iText 2/or DSS (https://ec.europa.eu/cefdigital/wiki/display/CEFDIGITAL/eSignature.) Due to the difference between iText versions (DSS use iText 2.17) i can't get a proper signed hash. Here the code migrated from itex 5 : // We get the self-signed certificate from the client CertificateFactory factory = CertificateFactory.getInstance("X.509"); Certificate[] chain = new Certificate[1]; chain[0] = factory.generateCertificate(new ByteArrayInputStream

M2crypto Signature vs OpenSSL Signature

∥☆過路亽.° 提交于 2019-12-24 07:59:03
问题 I have a pair of ECDSA keys and using the following code, I am trying to compare the signatures for a 'hello' string computed using OpenSSL and M2Crypto library in python. Here is the code: import subprocess from hashlib import sha256 public_key_filename = 'ca_pu.pem' private_key_filename = 'ca_pr.pem' signature_filename = 'signature' sigoutput = open(signature_filename, 'w') cmd = 'openssl dgst -sha256 -sign'.split() cmd.append(private_key_filename) p = subprocess.Popen(cmd, stdin=subprocess

Signed PDF showing message “The validity of the document is unknown”, iText

这一生的挚爱 提交于 2019-12-24 07:55:05
问题 I am using iText to apply digital signatures in PDF. The digitally signed PDF is showing message like "the validity of the document certification is unknown. The author could not be verified.At least one signature has problems." at the top. When I add the certificate to my trust identities which is used to create signed PDF, then the generated signed PDF shows "Signed and all signatures are valid". Is it possible to fix this by without adding certificate to trusted identities? Thanks in

How to load PKCS7 (.p7b) file in java

独自空忆成欢 提交于 2019-12-24 05:33:33
问题 I have a pkcs7 file, and I want to load it and extract its contents. I tried these two methods: byte[] bytes = Files.readAllBytes(Paths.get("myfile.p7b")); FileInputStream fi = new FileInputStream(file); //Creating PKCS7 object PKCS7 pkcs7Signature = new PKCS7(bytes); or this FileInputStream fis = new FileInputStream(new File("myfile.p7b")); PKCS7 pkcs7Signature = new PKCS7(fis); but I got IOException: Sequence tag error So how can I load this .p7b file ? 回答1: Finally I did it with

How to verify PDF digital signature in Ruby

喜夏-厌秋 提交于 2019-12-24 03:26:26
问题 I added a digital signature as mentioned in "Insert digital signature into existing pdf file" and stored that certificate as a PEM file in local. How can I verify the signature with a stored certificate? This is sample code from source: open 'certificate.pem', 'w' do |io| io.write cert.to_pem end #Saving certificate cert = OpenSSL::X509::Certificate.new(File::read('certificate.pem')) #Opening certificate to verify. This gives error. how to convert pem string to certificate. pdf = PDF.read(

Tamper-proof configuration files in .NET?

坚强是说给别人听的谎言 提交于 2019-12-24 02:48:28
问题 We ship a .NET application with an associated configuration file. Our consultants create the configuration file during installation. We'd like to make it hard for the client to tamper with the configuration file. What avenues do we have? At the moment, I'm thinking about signing the configuration file with our private key and verifying it against the public key when the application starts. I'd then hide the public key in the EXE somewhere. How might I go about doing this? Are there better

How to embed hash in exe file with signtool.exe

夙愿已清 提交于 2019-12-24 02:43:24
问题 I am using signtool.exe to sign exe file. I am trying to embed my exe file with the .pfx certificate along with the signed hash of exe(generated signed hash using openssl). I am able to sign only with certificate. But I need to embed the signed hash in the exe as well. Probably signtool.exe sign /as could help. /as option does not expect any argument so not able to pass my hash there. Could someone please help me sign my exe with certificate and hash. Thanks, 回答1: The version of Signtool

Android/Python How to verify Signature SHA256withRSA and PKCS1 Padding

无人久伴 提交于 2019-12-23 18:49:05
问题 I'm new member, I have waited two days to find solution verify signature from android client to python server. First I create Key pair and generate signature from private key. Thank you pedrofb I have updated full code. verify done in python server. protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); KeyPairGenerator keyPairGenerator = null; try { KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore"); keyStore