Questions tagged [signature]

In computer programming, especially object-oriented programming, a method is commonly identified by its unique method signature, which usually includes the method name, and the number, types and order of its parameters. A method signature is the smallest type of a method. The signature tag should not be used to tag questions about digital signatures, email signatures or written signatures.

Method signature

In computer programming, especially object-oriented programming, a method is commonly identified by its unique method signature, which usually includes the method name, and the number, types and order of its parameters. A method signature is the smallest type of a method.

Method overloading

Method signatures can be used by the compiler to distinguish between methods with the same name, but with different parameters. This is called method overloading. The precise characteristics of method overloading depends on the programming language. Overloading should not be used for methods that perform an different operation as that will make the source code hard to read.

Examples

Example of declarations of two overloaded methods with the same name, but with a different method signature:

void drawPoint(int x, int y);
void drawPoint(Point p);

in this case it is likely that drawPoint(x, y) internally converts x and y into a Point instance. This kind of function is therefore called a convenience method.

Disambiguation

For digital signatures such as RSA or DSA signatures please use and/or . Email may contain an email-signature, PDF documents may contain a digitized written signature. These signatures don't have specialized tags, please use more generic tags such as and instead.

2003 questions
32
votes
5 answers

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

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.…
Codo
  • 75,595
  • 17
  • 168
  • 206
30
votes
8 answers

How do you verify an RSA SHA1 signature in Python?

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…
Andrew B.
  • 1,225
  • 1
  • 13
  • 18
30
votes
3 answers

JWT Keys - Asymmetric and Symmetric

I understand the difference between symmetric and asymmetric keys. I understand that the keys are used to calculate the signature and then verify them. However diving a little deeper, I'd like to understand a bit more which I'm having trouble…
n00b
  • 5,843
  • 11
  • 52
  • 82
28
votes
7 answers

Can the arguments of main's signature in C++ have the unsigned and const qualifiers?

The standard explicitly states that main has two valid (i.e., guaranteed to work) signatures; namely: int main(); int main(int, char*[]); My question is simple, would something like the following be legal? int main(const unsigned int, const char*…
bh9042
  • 291
  • 1
  • 3
  • 5
27
votes
6 answers

how to manage debug and release version on android device?

I'm new to Android dev and I'm almost ready to release a first version of my app :) While testing the signed release apk on my phone, it refuse to install because the debug version is installed with the debug signature. So I have to uninstall the…
Geob-o-matic
  • 5,940
  • 4
  • 35
  • 41
27
votes
2 answers

Android LVL Signature Verification Failed

I am trying to implement the APK Expansion Downloader Library into my application, but I am struggling to get past the LVL verification check. Everytime I run up the application, I get a "Signature verification failed" message back from the…
Mimminito
  • 2,803
  • 3
  • 21
  • 27
26
votes
4 answers

How to verify a jar signed with jarsigner programmatically

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…
James Carr
  • 797
  • 2
  • 10
  • 21
24
votes
2 answers

What are __signature__ and __text_signature__ used for in Python 3.4

If one does dir() on some builtin callables (class constructors, methods, etc) on CPython 3.4, one finds out that many of them often have a special attribute called __text_signature__, for example: >>> object.__text_signature__ '()' >>>…
22
votes
2 answers

Android in-app purchase server signature verification using php OpenSSL

In an attempt to follow some of the security guidelines for in-app purchase here: http://developer.android.com/guide/market/billing/billing_best_practices.html I am trying to do signature validation on a server instead of in the app iteself. I would…
Nathan Totura
  • 1,335
  • 1
  • 10
  • 10
22
votes
8 answers

Get timestamp from Authenticode Signed files in .NET

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…
SlavaGu
  • 817
  • 1
  • 8
  • 15
21
votes
4 answers

c# How to verify signature JWT?

I have a token, a file containing public key and I want to verify the signature. I tried to verify signature based on this. However, decodedCrypto and decodedSignature don't match. Here is my code: public static string Decode(string token, string…
anhtv13
  • 1,636
  • 4
  • 30
  • 51
20
votes
5 answers

How to find signature of apk file?

What's the easiest way to find signature of an apk file? Please note that I'm not asking about code. I just want to find it from my pc. Signature like this one 975yYkKAQF+KST7g3ASHvHkYopq=
user3548321
  • 523
  • 2
  • 8
  • 18
19
votes
3 answers

What is the difference between "descriptor" and "signature"?

I am now using ASM (Java bytecode instrumentation library). To retrieve the signature of given method, there is a field which is named "desc". I guess this is an abbreviation of "descriptor", but why isn't it named as "signature"? Is there any…
akry
  • 615
  • 2
  • 7
  • 14
19
votes
3 answers

Absolute minimum code to get a valid oauth_signature populated in Java or Groovy?

SO I am testing a Rest OAuth implementation. My testing tool will send the HTTP Request, but I need to prepare the Authorization header. What I need: I want a valid Authorization Header What I have: All the headers except the oauth_signature I also…
ads1serrr
  • 191
  • 1
  • 1
  • 4
19
votes
6 answers

How to generate Signature in AWS from Java

When I invoke API endpoints from REST client, I got error by concerning with Signature. Request: Host: https://xxx.execute-api.ap-southeast-1.amazonaws.com/latest/api/name Authorization: AWS4-HMAC-SHA256…
Tun Lin Aung
  • 339
  • 1
  • 4
  • 17