signature

Get timestamp from Authenticode Signed files in .NET

夙愿已清 提交于 2019-11-27 04:14:33
We need to verify that binary files are signed properly with digital signature (Authenticode). This can be achieved with signtool.exe pretty easily. However, we need an automatic way that also verifies signer name and timestamp. This is doable in native C++ with CryptQueryObject() API as shown in this wonderful sample: How To Get Information from Authenticode Signed Executables However we live in a managed world :) hence looking for C# solution to the same problem. Straight approach would be to pInvoke Crypt32.dll and all is done. But there is similar managed API in System.Security

C++ Function Callbacks: Cannot convert from a member function to a function signature

家住魔仙堡 提交于 2019-11-27 02:21:52
I'm using a 3rd party library that allows me to register callbacks for certain events. The register function looks something like this. It uses the Callback signature. typedef int (*Callback)(std::string); void registerCallback(Callback pCallback) { //it gets registered } My problem is that I want to register a member function as a callback something like this struct MyStruct { MyStruct(); int myCallback(std::string str); }; MyStruct::MyStruct() { registerCallback(&MyStruct::myCallback); } int MyStruct::myCallback(std::string str) { return 0; } Of course, the compiler complains, saying error

Meaning of instantiation mode indicators in arguments of Prolog predicates

被刻印的时光 ゝ 提交于 2019-11-27 02:06:14
Looking at Prolog documentation, predicate signatures are sometimes written as following: foo(:Bar, +Baz, -Qux, ?Mop) What are : , + , - and ? for and how do I interpret them? Also, are these the only ones that exist or are there more of them? Paulo Moura Those prefix operators, in this context, represent instantiation modes, i.e. they tell you which arguments should be variables or instantiated when calling the predicate. They also tell you if an argument will be (possibly further) instantiated by the call. They can also be used to tell you that an argument is going to be meta-interpreted in

How to verify a jar signed with jarsigner programmatically

泄露秘密 提交于 2019-11-27 01:26:11
I'm wanting to sign a jar using jarsigner, then verify it using a Java application which does not have the signed jar as part of it's classpath (i.e. just using a filesystem location of the jar) Now my problem is getting the signature file out of the jar, is there a simple way to do this? I've had a play with the Inflater and Jar InputStreams with no luck. Or is this something that can be accomplished in a better way? Thanks The security Provider implementation guide outlines the process of verifying JARs. Although these instructions are for a JCA cryptographic service provider to verify

How do you verify an RSA SHA1 signature in Python?

回眸只為那壹抹淺笑 提交于 2019-11-27 00:22:43
I've got a string, a signature, and a public key, and I want to verify the signature on the string. The key looks like this: -----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDfG4IuFO2h/LdDNmonwGNw5srW nUEWzoBrPRF1NM8LqpOMD45FAPtZ1NmPtHGo0BAS1UsyJEGXx0NPJ8Gw1z+huLrl XnAVX5B4ec6cJfKKmpL/l94WhP2v8F3OGWrnaEX1mLMoxe124Pcfamt0SPCGkeal VvXw13PLINE/YptjkQIDAQAB -----END PUBLIC KEY----- I've been reading the pycrypto docs for a while, but I can't figure out how to make an RSAobj with this kind of key. If you know PHP, I'm trying to do the following: openssl_verify($data, $signature,

Android compare signature of current package with debug.keystore

不打扰是莪最后的温柔 提交于 2019-11-26 22:39:05
问题 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

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

别等时光非礼了梦想. 提交于 2019-11-26 21:59:52
问题 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

difference between signature versions - V1(Jar Signature) and V2(Full APK Signature) while generating signed apk in AndroidStudio?

橙三吉。 提交于 2019-11-26 21:20:50
Please select at least one of the signature versions to use in Android Studio 2.3 Now while generating signed apk in Android Studio, it's showing two options(CheckBox) namely 1. V1(Jar Signature) and 2. `V2(Full APK Signature)' as Signature Versions in last step of signed apk generating process. So, what is the difference between these V1(Jar Signature) and V2(Full APK Signature) in new Android Studio update? And which should I use(or both) for signing apk for play store release? Also I'm getting error Install Parse Failed No Certificates while installing apk when i use second option. It is a

Top-level const doesn't influence a function signature

不羁岁月 提交于 2019-11-26 21:05:44
From the C++ Primer 5th Edition, it says: int f(int){ /* can write to parameter */} int f(const int){ /* cannot write to parameter */} The two functions are indistinguishable . But as you know, the two functions really differ in how they can update their parameters. Can someone explains to me? EDIT I think I didn't interpret my question well. What I really care is why C++ doesn't allow these two functions simultaneously as different function since they are really different as to "whether parameter can be written or not". Intuitively, it should be! EDIT The nature of pass by value is actually

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

孤人 提交于 2019-11-26 19:16:11
问题 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