Ashwin
Ashwin

Reputation: 13517

Signature method in xml signature

In signature method in xml signature you have specify in this format : SignatureMethod.RSA_SHA1 but when using normal signature you just do

Cipher c1=Cipher.getInstance("RSA");

So what is the difference between these two?

Upvotes: 0

Views: 776

Answers (1)

Buhake Sindi
Buhake Sindi

Reputation: 89169

The difference is simple:

RSA is a (public-key) cryptography algorithm, where the public key is used to encrypt important message. The encrypted data must be decrypted with the private key.

RSA-SHA1, on the other hand, is a combination of RSA cryptography + SHA1 Message Digest. A message digest is a one-way hashing function, which has four main or significant properties:

  • it is easy to compute the hash value for any given message
  • it is infeasible to generate a message that has a given hash
  • it is infeasible to modify a message without changing the hash
  • it is infeasible to find two different messages with the same hash

In Digital Signature, one would want a guarantee that the signature is valid from sender to receiver. A signature is created through a cryptographic algorithm (e.g. RSA) and then a verification process is done to public key, message, and signature through a hashing function (e.g. SHA-1) for authenticity.

Upvotes: 2

Related Questions