digital-signature

Should interop assemblies be signed?

本秂侑毒 提交于 2019-12-01 15:57:37
问题 We have a set of COM components developed in VC++. When a reference to such component is added to a .NET project Visual Studio generates an interop assembly. We have a set of such assemblies now. While running our daily build we sign all the produced binaries with a digital signature. Interop assemblies are not signed since we don't feel we are the authors - anyone can use Visual Studio and produce the same assemblies. Should we sign the interop assemblies as well? Should we also sign them

iOS verify digital signature

我的未来我决定 提交于 2019-12-01 12:19:22
In my application, I have a public key (represented as string), plain message and digital signature, represented as base64 encoded string, hashed with SHA256 and encrypted with RSA). Now, I need to verify digital signature. I was trying to do as follows: create SecKeyRef from NSString (taken from here ) create SHA256 digest from original message verify signature using SecKeyRawVerify function (I am trying to avoid using OpenSSL function) Additionally, my digital signature was created using Java's SHA256withRSA method. I was reading here that SHA256WithRSA appends algorithm identifier with the

get original content of a pdf signed with itextsharp

别来无恙 提交于 2019-12-01 12:00:51
I'm trying to get the original document of a signed PDF in order to compare it's hash with an stored doc. This is really easy when the document has several signatures, with acrobat reader you can go the previous revision of the document save it and that's it. Surprisingly this does not work with the first signature, where there is no straight forward way to get the original data. As it is not possible to do it with the reader I have tried programatically with iTextSharp. However although I have googled deeply I have not found how to do it. The only relevant post I found is this one but no

X509Certificate2 validation on web service

旧城冷巷雨未停 提交于 2019-12-01 10:59:48
I'm developing WCF web service that checks if a certificate in XML signature is valid. XML is signed with qualified and valid X509 certificate. While I am running service within Visual Studio development environment X509Certificate2.Verify() and X509Chain.Build() methods return TRUE. But when I publish my service under IIS these methods return FALSE. What I am doing wrong or what is missing? Here is my validation code: public static void VerifyXml(XmlDocument xDoc) { // Create a new SignedXml object and pass it // the XML document class. SignedXml signedXml = new SignedXml(xDoc); // Find the

get original content of a pdf signed with itextsharp

纵饮孤独 提交于 2019-12-01 10:08:20
问题 I'm trying to get the original document of a signed PDF in order to compare it's hash with an stored doc. This is really easy when the document has several signatures, with acrobat reader you can go the previous revision of the document save it and that's it. Surprisingly this does not work with the first signature, where there is no straight forward way to get the original data. As it is not possible to do it with the reader I have tried programatically with iTextSharp. However although I

M2Crypto RSA.sign vs OpenSSL rsautl -sign

只愿长相守 提交于 2019-12-01 08:58:48
问题 M2Crypto and OpenSSL CLI doesn't seem to create the same digital signature. Here is the code that I use in Python: import M2Crypto rsa = M2Crypto.RSA.load_key("privkey.pem") open("sig_m2crypto", "w").write(rsa.sign("md5-digest", "md5")) Here is the command line with OpenSSL: echo "md5-digest" | openssl rsautl -sign -inkey privkey.pem > sig_openssl With the same input, the result of sig_m2crypto and sig_openssl are always different. The significance would be I can not verify signatures

Create RSA-SHA1 signature

妖精的绣舞 提交于 2019-12-01 07:48:37
问题 Is it possible to create a RSA-SHA1 signature with a X509-certificate stored in Azure Key Vault? [non-repudiation certificate] Unfortunately, I can't change the hash-algorithm to SHA256 or something safer, and I really need to store the certficate in Azure Key Vault as Key. So far I've tried await kvClient.SignAsync(keyVaultUrl, "RSNULL", digest); // digest = 20byte SHA1 await kvClient.SignAsync(keyVaultUrl, "RSNULL", ans1Digest); // asn1Digest = 35byte SHA1 wrapped in ANS1 structure The

git verify trusted tags

爷,独闯天下 提交于 2019-12-01 07:41:45
I would like to include git tag -v command into the deployment process to catch unsigned tags or tags signed by a non-trusted GPG key. The command returns with an exit code of 0 if the tag has a valid signature, but does not care wether the signed key is trusted or not. I don't want to resort to grepping the resulting GPG message manually I haven't tried it yet, and the documentation doesn't mention exit codes, but you could try git-verify-tag plumbing command Update Having no easy way to test this, I've reviewed the source code: https://github.com/git/git/blob

X509Certificate2 validation on web service

谁说胖子不能爱 提交于 2019-12-01 07:32:51
问题 I'm developing WCF web service that checks if a certificate in XML signature is valid. XML is signed with qualified and valid X509 certificate. While I am running service within Visual Studio development environment X509Certificate2.Verify() and X509Chain.Build() methods return TRUE. But when I publish my service under IIS these methods return FALSE. What I am doing wrong or what is missing? Here is my validation code: public static void VerifyXml(XmlDocument xDoc) { // Create a new SignedXml

iOS verify digital signature

谁都会走 提交于 2019-12-01 07:28:53
问题 In my application, I have a public key (represented as string), plain message and digital signature, represented as base64 encoded string, hashed with SHA256 and encrypted with RSA). Now, I need to verify digital signature. I was trying to do as follows: create SecKeyRef from NSString (taken from here) create SHA256 digest from original message verify signature using SecKeyRawVerify function (I am trying to avoid using OpenSSL function) Additionally, my digital signature was created using