digital-signature

Adjust width for image in Itextsharp while adding digital signature in GRAPHIC_AND_DESCRIPTION mode C# .net

試著忘記壹切 提交于 2020-05-17 06:27:08
问题 I want to adjust width of added Image along with description while signing pdf using itextsharp library C#. My code below regarding setting image and descreption in signature: var pdfStamper = PdfStamper.CreateSignature(reader, os, '\0', null, true); var signatureAppearance = pdfStamper.SignatureAppearance; var imageData = Path.Combine(_env.WebRootPath, ImagePathere); var image = Image.GetInstance(imageData); signatureAppearance.SignatureGraphic = image; BaseFont bf = BaseFont.CreateFont

jwt signature: RS256 or HS256

元气小坏坏 提交于 2020-05-15 05:42:08
问题 In Auth0 there are 2 algorithms for jwt token signature: RS256 and HS256. RS256 is an asymmetric algorithm which means that there are two keys: one public and one private (secret). Auth0 has the secret key, which is used to generate the signature, and the consumer of the JWT has the public key, which is used to validate the signature. HS256 is a symmetric algorithm which means that there is only one secret key, shared between the two parties. The same key is used both to generate the

signedXml.LoadXml((XmlElement)nodeList[0]); returns Malformed SignedInfo/Reference

别来无恙 提交于 2020-04-18 01:08:13
问题 I've been developing this console application for about close to 2-3 months now. What I'm trying to achieve from the console application is to generate data files and sign the files into a "signature.xml" file. It is working using several custom methods to sign (without use of Regedit Key). However, once the number of references goes over 99, it refuses to sign and gives the error "Malformed SignedInfo/Reference..". Even though previously it did work and this error has never surfaced. I've

“AT least one signature is invalid” error message after removing signature from pdf using itext

给你一囗甜甜゛ 提交于 2020-03-27 02:40:34
问题 I have a digitally signed pdf with multiple signatures. Now I want to remove only one of the signatures. I am using itext for the same. The code is as follows: PdfReader reader = new PdfReader(src_path); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest_path)); { AcroFields.Item item = stamper.getAcroFields().getFieldItem(fieldname); ClearSignatureDictionary(item.getMerged(0)); ClearSignatureDictionary(item.getWidget(0)); ClearSignatureDictionary(item.getValue(0)); } }

How do you encode the Certificate Revocation List (CRL) stream bytes in PDF?

末鹿安然 提交于 2020-03-25 18:39:15
问题 I sign a PDF and I add update version in which I write the DSS with its CRLs, Certs, VRI. 19 0 obj [15 0 R 16 0 R] endobj 20 0 obj [13 0 R 14 0 R] endobj 11 0 obj [15 0 R 16 0 R] endobj 12 0 obj [13 0 R 14 0 R] endobj 17 0 obj << /CRL 11 0 R /Cert 12 0 R >> endobj 18 0 obj << /5F44CF6F351DFD45FB62F3D0ED046408BC892797 17 0 R >> endobj 21 0 obj << /VRI 18 0 R /CRLs 19 0 R /Certs 20 0 R >> I am confused about how should I write the Certificate and CRL streams. 15 0 obj << /Length 1454 /Filter

How to create digitally signed Xml Message using standard ISO20022 in .net ( C# )?

霸气de小男生 提交于 2020-03-21 06:39:30
问题 My project needs integration with payment gateway. The project is built in .net ( c# ) To integrate the gateway i need to sign XML message digitally following ISO 20022 standard. I am using dot net library SignedXml of System.Security.Cryptography The sample format and my code is shown below : Sample Code: <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> <ds:SignatureMethod Algorithm=

How to create digitally signed Xml Message using standard ISO20022 in .net ( C# )?

心不动则不痛 提交于 2020-03-21 06:38:33
问题 My project needs integration with payment gateway. The project is built in .net ( c# ) To integrate the gateway i need to sign XML message digitally following ISO 20022 standard. I am using dot net library SignedXml of System.Security.Cryptography The sample format and my code is shown below : Sample Code: <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> <ds:SignatureMethod Algorithm=

Java Exception during signature verification (error decoding signature bytes)

好久不见. 提交于 2020-03-04 07:11:48
问题 I have to verify a certificate. I'm not an expert of cryptography, so probably I did something (or everything :) ) wrong. When the code reach the last step ( boolean b = sig.verify(CertSign); ), it fires an exception: java.security.SignatureException: error decoding signature bytes . Could someone help me to figure out what I'm doing wrong? The following is a test code that shows the problem: private void test() { byte [] CertBody = new byte[]{(byte)0x7F,(byte)0x4E,(byte)0x81,(byte)0x82,

Java Exception during signature verification (error decoding signature bytes)

瘦欲@ 提交于 2020-03-04 07:11:12
问题 I have to verify a certificate. I'm not an expert of cryptography, so probably I did something (or everything :) ) wrong. When the code reach the last step ( boolean b = sig.verify(CertSign); ), it fires an exception: java.security.SignatureException: error decoding signature bytes . Could someone help me to figure out what I'm doing wrong? The following is a test code that shows the problem: private void test() { byte [] CertBody = new byte[]{(byte)0x7F,(byte)0x4E,(byte)0x81,(byte)0x82,

Can't figure out why my PDF signature is not LTV enabled

断了今生、忘了曾经 提交于 2020-02-29 08:53:40
问题 I'm generating a PDF document with signature and I want it to be LTV enabled. For this, I sign the PDF when creating it and then I add the second version containing the DSS with the validation related informations (VRI). As I found in some articles, I need to add the Certificate chain (without the root certificate - Authority) and the Certificate Revocation List (CRL). In my case, both will have 2 elements. After that I add the entry for the VRI which is a SHA-1 hash of the signature content