Questions tagged [digital-signature]

mathematical scheme for demonstrating the authenticity of a digital message or document (Wikipedia). A cryptographic toolkit is often used along with a public-private key pair to digitally sign a message and to verify a message.

Digital signatures are often used in a cryptographically secure message exchange to provide:

  • Authentication - proof that a message was sent from a trusted party
  • Integrity - proof that a message was not tampered with in transit
  • Non-repudiation - the receiver can proof to a third party that the message originated from the original sender

Message authentication codes (MAC) also offer authentication and integrity protection, but no non-repudiation.

Digital signatures generally make use of a public-private key pair. A private key is used to sign the message and a public key is used to verify the integrity and authenticity of a message.

If a message has been tampered with or was not signed by the expected party the verification of the signature will fail.

An example of digitally signing a simple message in java then verifying the result:

KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA"); 
KeyPair keyPair = kpg.generateKeyPair();

byte[] message = "My message is strong!".getBytes();

// Sign our message
Signature signer = Signature.getInstance("SHA1withRSA");
signer.initSign(keyPair.getPrivate());
signer.update(message);
byte[] signatureData = signer.sign();

// Verify our message using the public key + signatureData
Signature verifier = Signature.getInstance("SHA1withRSA");
verifier.initVerify(keyPair.getPublic());
verifier.update(message);

assertTrue(verifier.verify(signatureData));

See also:

3380 questions
1
vote
0 answers

What is best alternative to Java applets for performing Digital Signatures

We were using java applets to digitally sign the document. As we know that java applets has been deprecated in almost all the browsers we have migrated to Jnlp. Now with jnlp we are facing multiple downloads issue(Each time user has to download the…
Vijaya
  • 157
  • 1
  • 16
1
vote
1 answer

Read Certificate from USB token in javascript

I want to read certificate from Digital Signature (USB token) in Javascript, i need both public and private key... ? Any help would be appreciated....
mayur saini
  • 209
  • 7
  • 17
1
vote
1 answer

What need to be done for calling web-methods that requires digital signature

I am working on this application that will call a web service developed by Company ABC. Here are few requirements that they have described. The data passed to web service methods & the data returned in response is digitaly signed. It is client…
imak
  • 6,489
  • 7
  • 50
  • 73
1
vote
0 answers

"An internal certificate chaining error has occurred" error while signing email in C#

I'm trying to digitally sign some content, including the whole certificate chain in the signature (so that recipient can verify the signature with no problems). I get the following error: "An internal certificate chaining error has occurred" when…
German Latorre
  • 10,058
  • 14
  • 48
  • 59
1
vote
0 answers

How to sign the BinarySecurityToken by configuration instead of code

We have to consume a service from an external party and we were having issues because the BinarySecurityToken was not being signed in the SOAP message. We found several online references that finally helped us and it all comes down to the fact that…
1
vote
1 answer

How to associate certificate information to already signed data?

I am trying to add digital signature to pdf document using pdf-box library (v2.0.8). I am receiving already signed content from a webservice (signed with only private key). Now I would need to associate certificate information to this signed data so…
1
vote
0 answers

Not able to display digital signature related details using PDVisibleSignDesigner using pdfbox v2.0.8

I have followed this link to add external digital signature(visible signature) using pdfbox v2.0.8. I am able to see the signature with image in the document but I am not able to see any additional details with this signature rectangle. Q1. How can…
Abhishek Dadhich
  • 321
  • 2
  • 10
1
vote
1 answer

SAML Token: Why use multiple Hash/Digest Algorithms: sha256 and sha1?

I'm reading this IBM Developer Works SAML article, where you can see two different signature/digest algorithms below: sha1 and sha256. I'm curious why both are listed and what is being signed by which method. That article says, "the [IdP] applies a…
mellow-yellow
  • 1,670
  • 1
  • 18
  • 38
1
vote
0 answers

Problem with verifying an ECDSA Signature with openssl

I am using openssl to verify ECDSA Signatures of a smartcard. However, I am running in trouble with two cards. A challenge is sent to the card, signed and then sent back. the signature is verified using the public key. I have posted a question here…
tzippy
  • 6,458
  • 30
  • 82
  • 151
1
vote
1 answer

.NET: Invalid Signature in RS256 signed JWT

I need to create a Json Web Token and signing it with an asymetric RS256 algorithm. The key used for signing should be taken from a X509 certificate and be validated by the receiver using the public key. Using HMAC and password works fine, but the…
Christian
  • 21
  • 2
1
vote
1 answer

Akka ActorSystem never terminate in Java

Im using Akka 2.5.6 in Java 8 and I want to know the right way to finish de ActorSystem, part of the functionality of my code is to process some XML files and validate them, to achieve this I have created 3 actors: Controller, Processor and…
1
vote
1 answer

Where to find root and intermediate certificates having a security token with only end certificate in it

First i must say im kinda new at digital signatures and PKI. I have a few questions regarding the way the whole PKI infrastructure works. Lets say i have a security token containing my private key + my valid end-entity certificate. Therefore i can…
K.Tsanov
  • 151
  • 2
  • 7
1
vote
1 answer

tcpdf and digital signature certification

I'm trying to do a simple pdf certificate signing in php with tcpdf. I'm running example 52 but the information on my pdf reader (osx preview) says: Encryption: No Permissions: You have full permissions for this PDF. You can copy text, print or make…
Edson Medina
  • 9,862
  • 3
  • 40
  • 51
1
vote
1 answer

JWT public key vs private key signature validation -- what is the difference?

I am using this library, node-jwks-rsa, to fetch JWT keys from my auth0 jwks.json file in order to verify that the id_token my application retrieves after authentication is actually coming from my auth provider. Under the hood it uses this method to…
TheFastCat
  • 3,134
  • 4
  • 22
  • 32
1
vote
0 answers

Building a pkcs7 signature in php aleady knowing the signature

My goal is to sign pdf and e-mails on my server, using an USB token on the client side. So I would like to build a PKCS7 signature in PHP, but the signature will be obtained from the USB token, that's why I can't use openssl pkcs7 implementation. I…
Redox
  • 31
  • 1
  • 3
1 2 3
99
100