signature

How can i sign hash of xml file and integrate signature in original file

落爺英雄遲暮 提交于 2020-08-10 18:58:33
问题 Is there a way to sign the hash of an xml file and then integrate this signed hash into the original file. For the PDF signature I use iText and it works very well. UPDATE 1 : Sign Original XML FILE public class SignXML { static String fileToSign = "B:/tmp/client/032936.xml"; static String signedFile = "B:/tmp/client/Signed-032936.xml"; static String certificate = "C:/lp7command/tools/certificate.p12"; static String password = "123456"; public static void main(String[] args) throws Exception{

unable to verify openssl signature in php compare to nodejs

拜拜、爱过 提交于 2020-06-29 03:45:11
问题 I am able to verify the signature by using Nodejs crypto.createVerify whereas PHP: openssl_verify always return false. Nodejs: Getting correct result const encryptKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; const crypto = require('crypto'); var data = Buffer.from(JSON.stringify(vd), "utf-8"); var password = Buffer.from(encryptKey, "utf-8"); var hashPassword = crypto.createHash('sha256').update(password).digest(); var data ='oubWLpvUHAX5Z/9fmiCx8PGTqDl0