digital-signature

C# Add Timestamp to PKCS#7 CMS Digital Signature

生来就可爱ヽ(ⅴ<●) 提交于 2020-08-25 12:16:44
问题 I am a software developer in charge of a project to digitally sign text files with PCKS#7. There is a third party in charge of analysing the signed file to tell us if it's correct or not. The issue I'm having is that they say the signer info does not contain a timestamp. They assured me I do not need to hire an outside trusted server for the timestamp, that the server's timestamp would be enough. I have scoured the internet and came up with the following code to try and add the timestamp but

C# Add Timestamp to PKCS#7 CMS Digital Signature

為{幸葍}努か 提交于 2020-08-25 12:16:31
问题 I am a software developer in charge of a project to digitally sign text files with PCKS#7. There is a third party in charge of analysing the signed file to tell us if it's correct or not. The issue I'm having is that they say the signer info does not contain a timestamp. They assured me I do not need to hire an outside trusted server for the timestamp, that the server's timestamp would be enough. I have scoured the internet and came up with the following code to try and add the timestamp but

C# Add Timestamp to PKCS#7 CMS Digital Signature

蹲街弑〆低调 提交于 2020-08-25 12:15:37
问题 I am a software developer in charge of a project to digitally sign text files with PCKS#7. There is a third party in charge of analysing the signed file to tell us if it's correct or not. The issue I'm having is that they say the signer info does not contain a timestamp. They assured me I do not need to hire an outside trusted server for the timestamp, that the server's timestamp would be enough. I have scoured the internet and came up with the following code to try and add the timestamp but

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{

C# Add Timestamp to PKCS#7 CMS Digital Signature problem

时间秒杀一切 提交于 2020-08-10 18:50:12
问题 This question is the continuation of that one. I also try to communicate with a 3rd party AS2 server. I use the same code as the author of that post. This code (the corrected version) is: private byte[] Sign(byte[] content) { CmsSigner cmsSigner = new CmsSigner(_cert); cmsSigner.SignedAttributes.Add(new Pkcs9SigningTime(DateTime.Now)); SignedCms signedCms = new SignedCms(new ContentInfo(content)); signedCms.ComputeSignature(cmsSigner, true); return signedCms.Encode(); } But I get the

C# Add Timestamp to PKCS#7 CMS Digital Signature problem

安稳与你 提交于 2020-08-10 18:49:29
问题 This question is the continuation of that one. I also try to communicate with a 3rd party AS2 server. I use the same code as the author of that post. This code (the corrected version) is: private byte[] Sign(byte[] content) { CmsSigner cmsSigner = new CmsSigner(_cert); cmsSigner.SignedAttributes.Add(new Pkcs9SigningTime(DateTime.Now)); SignedCms signedCms = new SignedCms(new ContentInfo(content)); signedCms.ComputeSignature(cmsSigner, true); return signedCms.Encode(); } But I get the