digital-signature

How to sign Visual Studio “Empty Project” executable for /integritycheck linker flag

丶灬走出姿态 提交于 2019-12-11 15:20:28
问题 I have a C++ program on visual studio that requires the linker flag '/integritycheck'. When I enable this flag, i cannot run the program due to not the file not being verified by windows. I have looked across the web for ways to create test signing certificates, and they all end the same way; The file was not able to be verified by windows. I'm running Visual Studio 2013 community on Windows 7. Just some of the sources I've looked at and followed through to the best of my ability: https://www

Digital signing code fails only on AIX

China☆狼群 提交于 2019-12-11 13:53:20
问题 I have the following codes which digitally signs an input XML file. For some reason, it works on Windows and Solaris, but it always fail on AIX no matter what the XML content is. public class Test { public static void main(String[] args) throws Exception { KeyStore keyStore = KeyStore.getInstance("JKS"); FileInputStream fileInputStream = new FileInputStream(args[0]); keyStore.load(fileInputStream, "password".toCharArray()); String alias = keyStore.aliases().nextElement(); PrivateKey

How can I benchmark signature algorithms (HMAC vs RSA) and compare them well?

丶灬走出姿态 提交于 2019-12-11 13:08:59
问题 I would like to kind of re-ask a question that was asked here two years ago (Benchmarking symmetric and asymmetric cryptography) but, as I find, was not satisfyingly answered. 1) I too would really like to back up the notion that RSA-like asymmetric cryptography is much more expensive than for example performing an HMAC operation with hard numbers. These numbers should be informative with regard to comparability of algorithms. 2) Moreover, I would be interested, in addition to mere mean

iText5.x Setting pushbutton appearance without breaking Seal

≯℡__Kan透↙ 提交于 2019-12-11 13:08:29
问题 Here is the context: We add two empty pages to an existing pdf, each containing an empty pushbutton field We apply a PAdES B-B seal with all modification rights on the document We modify a pushbutton to insert an image in it When we try to modify the pushbutton appearance to set an image, the seal validity breaks with "unauthorized modification" no matter what we try. Here is a code sample: PdfReader pdfReader = new PdfReader("test.pdf"); PdfStamper pdfStamper = new PdfStamper(pdfReader,

Should I use Base64 of HMAC digest or just HMAC hex digest?

混江龙づ霸主 提交于 2019-12-11 12:45:03
问题 Legend I expose an API which requires client to sign requests by sending two headers: Authorization: MyCompany access_key:<signature> Unix-TimeStamp: <unix utc timestamp in seconds> To create a signature part, the client should use a secret key issued by my API service. In Python (Py3k) it could look like: import base64 import hmac from hashlib import sha256 from datetime import datetime UTF8 = 'utf-8' AUTH_HEADER_PREFIX = 'MyCompany' def create_signature(access_key, secret_key, message): new

How to create a digital signature using SHA256 with ECDSA algorithm in C#

笑着哭i 提交于 2019-12-11 11:48:43
问题 I have a requirement to create a signature which is a URL-Safe-Base-64-encoded SHA256+ECDSA signature of a message. This will be used to consume a remote REST service. I have been given a HAL browser implementation which connects to them as expected and a test implementation done in SCALA. val token = generateToken() // Generates a random numeric token, different for each request val lines = line1 + "\n" + line2 + "\n" + line3 + "\n" val lineBytes = lines.getBytes() try { var sig = Signature

Why do I keep getting “The digital signature of the object did not verify” for Windows JavaEE installer

落爺英雄遲暮 提交于 2019-12-11 10:29:14
问题 I'm trying to download the Windows Java EE installer from Oracle's website but I continually receive "The digital signature of the object did not verify" error messages when I check the digital signature of the downloaded file. I've tried the following searches on this site (and similar searches on Google with no success): java ee +"digital signature" +"did not verify" 1 unrelated result java ee +"digital signature" +invalid 2 unrelated results I've downloaded the files on 3 separate machines

Detached PKCS#7 CMS With Strong Private Key Protection

牧云@^-^@ 提交于 2019-12-11 10:01:30
问题 I need to generate a PKCS#7/CMS detached signature, and I know I can do it easily that way : byte[] data = GetBytesFromFile(cheminFichier); X509Certificate2 certificate = null; X509Store my = new X509Store(StoreName.My,StoreLocation.CurrentUser); my.Open(OpenFlags.ReadOnly); X509Certificate2Collection certColl = X509Certificate2UI.SelectFromCollection(my.Certificates, "Test" , "Choose a certificate" , X509SelectionFlag.SingleSelection); certificate = certColl[0]; if (certificate == null)

C# implementation to get SignedCms from signed file

ⅰ亾dé卋堺 提交于 2019-12-11 09:29:45
问题 I am having an implementation using C++ CRYPT32.DLL to extract a SignedCms object from a signed c# assembly dll. The certificate used to sign the dll is expired but has a valid certificate chain inside. The important thing is that the certificate consists of three certificates which I all want to extract. private static readonly int CERT_QUERY_OBJECT_FILE = 0x00000001; private static readonly int CERT_QUERY_CONTENT_FLAG_ALL = 0x00003ffe; private static readonly int CERT_QUERY_FORMAT_FLAG_ALL

RSA SignatureException: Signature length not correct

瘦欲@ 提交于 2019-12-11 07:27:56
问题 I am having issues signing an rsa signature. I have a signature that has been encrypted with a private key. I have an issue when trying to validate it with the public key however. I get the following exception: java.security.SignatureException: Signature length not correct: got 336 but was expecting 128 at sun.security.rsa.RSASignature.engineVerify(RSASignature.java:189) at java.security.Signature$Delegate.engineVerify(Signature.java:1219) at java.security.Signature.verify(Signature.java:652)