signature

Where and why JVM checks that the return type of entry method main(String args[]) is void and not anything else?

耗尽温柔 提交于 2019-11-28 09:11:10
问题 I will try to answer both, please correct me if I am wrong: Where: If a static method is being called using Classname .method() or using reflection then it doesn’t matter even if you change the return type of the calling method, the same method will still be called. So JVM probably checks this in one of the native methods of jvm.cpp methodHandle m (THREAD, init_klass->find_method(vmSymbols::object_initializer_name(),> vmSymbols:: void_method_signature() )); if (m.is_null()) { ------ THROW_MSG

Unable to sign a file with nodejs crypto

二次信任 提交于 2019-11-28 05:46:11
问题 I've created a private Key with nodejs crypto and want to sign a file with this key. My code is following: var ecdh = crypto.createECDH('brainpoolP512t1'); ecdh.generateKeys(); var key = ecdh.getPrivateKey('buffer'); var data= fs.readFileSync(req.file.path); var sign = crypto.createSign('sha512'); sign.update(data); var signature = sign.sign(key, 'hex'); But I get the error: Error: error:0906D06C:PEM routines:PEM_read_bio:no start line at Error (native) at Sign.sign (crypto.js:283:26) at /...

How to determine at run-time if app is for development, app store or ad hoc distribution?

坚强是说给别人听的谎言 提交于 2019-11-28 02:49:15
Is there a way to determine programmatically if the currently running app was built and signed for development only or whether it was built for distribution? And can one determine if was build for app store or ad hoc distribution? Is it e.g. possibly to access the code signature and get the information from there? Or are there certain files present in one of variants that don't exist in the other ones? Is part of the bundle info? Or can it be derived from the executable file? Any hints are appreciated. It seems that the embedded.mobileprovision file is in ASN.1 format. The easiest way to check

Inserting Signature into Outlook email from Excel VBA

懵懂的女人 提交于 2019-11-28 02:06:22
I am trying to automate some emails using VBA for Excel. Everything so far is fine, except trying to keep my signature in the email. Once you tell VBA to create a new email, it will already contain your default signature. This can be seen if you try Outmail.Display . However if you overwrite the .HTMLBody property, it will be deleted. My simple attempt was to save the contents of .HTMLBody to a signature (string), and then reassign it to .HTMLBody just to test it out. However the resulting email will be void of any signature. Code to copy and re-insert the signature: Dim myOlApp As Outlook

SignedXml.CheckSignature fails in .NET 4 but it works in .NET 3.5, 3 or 2

此生再无相见时 提交于 2019-11-28 01:47:10
I have a response from a 3-rd party web service. I load an XmlDocument with that response. string txt = readStream.ReadToEnd(); response = new XmlDocument(); response.PreserveWhitespace = true; response.LoadXml(txt); return response; Now I would like to verify that the respones is signed using the certificate. I have a VerifyXmlDoc(XmlDocument xmlDoc) method which I have found on msdn . I know that the message is correct. public bool VerifyXmlDoc(XmlDocument xmlDoc) { SignedXml signed = new SignedXml(xmlDoc); XmlNodeList signatureNodeList = xmlDoc.GetElementsByTagName("Signature"); signed

Different signatures when using C routines and openssl dgst, rsautl commands

雨燕双飞 提交于 2019-11-28 01:27:23
I am using following statement to create a RSA public and private key. openssl genrsa -out ksign_private.pem 1024 openssl rsa -in ksign_private.pem -pubout > ksign_public.pem Then I have program that uses, PEM_read_RSAPrivateKey, EVP_PKEY_assign_RSA, EVP_SignInit, EVP_SignUpdate, EVP_SignFinal functions from openssl libcrypto to generate signature file. I also have routine that verifies that signature can be verified using PEM_read_RSA_PUBKEY, EVP_PKEY_assign_RSA, EVP_VerifyInit, EVP_VerifyUpdate, EVP_VerifyFinal. Source code for these routines is attached below. When using these functions I

Android In-App Billing : Security.java says “Signature Verification Failed”

扶醉桌前 提交于 2019-11-27 21:41:05
问题 I have implemented a test app with Android's In-App Billing. I have filled in my Public Key in the Security.java file. Everything works, but when I submit the payment, the app crashes. I receive an error in LogCat that says "Signature Verification Failed", which corresponds to this bit of code: if (!sig.verify(Base64.decode(signature))) { Log.e(TAG, "Signature verification failed."); return false; } If I change that bit to return true instead of return false, then everything works properly -

Android compare signature of current package with debug.keystore

自古美人都是妖i 提交于 2019-11-27 18:12:38
As all we do I have application which is signed by debug.keystore (by default) when it is in development mode (build). When it goes production we sign it with our private key. Is there any way to determine at runtime that current package is signed with debug.keystore (is in development mode) or is signed with our private key (is in production mode). I have tried something like PackageManager packageManager = getPackageManager(); try { Signature[] signs = packageManager.getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES).signatures; for (Signature signature : signs) { Log.d(TAG,

Is there a library for iPhone to work with HMAC-SHA-1 encoding

落爺英雄遲暮 提交于 2019-11-27 17:54:49
For all operation with Amazon services(S3, EC2, SimpleDB) You need to sign all resquest with HMAC-SHA-1 Signature( http://en.wikipedia.org/wiki/HMAC , http://docs.amazonwebservices.com/AWSFWS/latest/DeveloperGuide/index.html?SummaryOfAuthentication.html ). I'm working under asp.net backend and there is no problems. Problem is in the iPhone application. iPhone developer says that there is no way to use HMAC-SHA-1 encoding, and he have no rigths to implement his own algorithm. As programmer I cannot understand why there can be a problem. So I want too know is iPhone developer right? I've never

How to show digital PDF signature in all document's Page using iText?

断了今生、忘了曾经 提交于 2019-11-27 16:18:54
I've been working on a digital signature function for some days, now that I have everything working it is time to try to print the stamp in all pages but I'm not doing great... Trying to give a quick resume, to show the stamp what I do is creating PdfStamper, PdfSignatureAppearance and a Rectangle, then call the appearance.setVisibleSignature(rectangle, 1, "SIGNATURE") The second parameter "1" above is the page number that I want to show the stamp, it is okay to be 1 by now, as I tried to do in order to show stamp in other page was creating other instances of PdfStamper, PdfSignatureAppearance